Bug 1008

Summary: missing definition of minimum() macro in lib/util/arc4random_buf.c (runtime failure)
Product: Sudo Reporter: Marius Schamschula <mschamschula>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.9.8   
Hardware: Macintosh   
OS: MacOS X   

Description Marius Schamschula 2021-11-08 18:16:59 MST
I have been made aware that there is an issue with

lib/util/arc4random.c and lib/util/arc4random_buf.c making use of the minimum() macro, but this macro is only defined in lib/util/arc4random.c (in line 59) and not in lib/util/arc4random_buf.c:

arc4random.c:59:#define minimum(a, b) ((a) < (b) ? (a) : (b))

Symptom:

sudo will configure (with a sprintf warning), build, install, and activate OK, but invocation of sudo then fails with:
dyld: Symbol not found: _minimum

Solution:

include the definition of the minimum() macro also in lib/util/arc4random_buf.c

Original report (with patch file): https://trac.macports.org/ticket/63858
Comment 1 Todd C. Miller 2021-11-08 18:19:10 MST
This was fixed by https://www.sudo.ws/repos/sudo/rev/a66c68c3a976
Comment 2 Todd C. Miller 2022-01-27 19:51:45 MST
The changes are present in the 1.9.9 release.