Bug 230764 - devel/libevent: Don't use arc4random_addrandom
Summary: devel/libevent: Don't use arc4random_addrandom
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Xin LI
URL:
Keywords: easy, needs-qa
Depends on:
Blocks: 230756
  Show dependency treegraph
 
Reported: 2018-08-20 05:05 UTC by Xin LI
Modified: 2018-10-08 11:41 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mm)
antoine: merge-quarterly-


Attachments
Proposed patch (1.19 KB, patch)
2018-08-20 05:05 UTC, Xin LI
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xin LI freebsd_committer freebsd_triage 2018-08-20 05:05:25 UTC
Created attachment 196373 [details]
Proposed patch

arc4random_addrandom should not be used directly, the interface will be removed soon (bug 230756).

Please upstream this patch.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-08-26 07:57:10 UTC
A commit references this bug:

Author: delphij
Date: Sun Aug 26 07:56:40 UTC 2018
New revision: 478104
URL: https://svnweb.freebsd.org/changeset/ports/478104

Log:
  devel/libevent: Don't use arc4random_addrandom.

  PR:		230764, 230756
  Approved by:	portmgr (antoine)

Changes:
  head/devel/libevent/Makefile
  head/devel/libevent/files/patch-evutil__rand.c
Comment 2 Xin LI freebsd_committer freebsd_triage 2018-08-26 08:05:13 UTC
Upstreamed (techinically, a bug reported by other user) at: https://github.com/libevent/libevent/issues/615

The issue was fixed in their 'master' already.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2018-08-26 09:51:22 UTC
(In reply to Xin LI from comment #0)
> arc4random_addrandom should not be used directly

Is this true for all supported FreeBSD releases e.g., on 10.4? arc4random_addrandom() is not a macro, so #ifdef arc4random_addrandom will always return false even if it's available.
Comment 4 Xin LI freebsd_committer freebsd_triage 2018-08-27 16:48:20 UTC
(In reply to Jan Beich from comment #3)

Hmm that's good point! So the more correct way to do it would be to just remove the code...
Comment 5 Jan Beich freebsd_committer freebsd_triage 2018-10-08 11:33:05 UTC
No, the correct fix is backporting upstream commit. What you landed is neither consistent with future versions of libevent nor with previous versions of FreeBSD.

PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES=	6541168d7037.patch:-p1
Comment 6 Jan Beich freebsd_committer freebsd_triage 2018-10-08 11:41:35 UTC
Also, what landed doesn't conflict with upstream commit. On future update there's a good chance the port maintainer may not notice it's no longer necessary.