[MacPorts] #63858: sudo-1.9.8p2: defect: missing definition of minimum() macro in lib/util/arc4random_buf.c (runtime failure)

MacPorts noreply at macports.org
Mon Nov 8 12:38:42 UTC 2021


#63858: sudo-1.9.8p2: defect: missing definition of minimum() macro in
lib/util/arc4random_buf.c  (runtime failure)
---------------------+--------------------
 Reporter:  balanco  |      Owner:  (none)
     Type:  defect   |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.7.1
 Keywords:           |       Port:  sudo
---------------------+--------------------
 == Description:

 in `sudo-1.9.8p2`,

 both, `lib/util/arc4random.c` and `lib/util/arc4random_buf.c` make use of
 the `minimum()` macro,[[br]] but this macro is defined only 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[[br]]invocation of `sudo` then fails with:[[br]]
 `dyld: Symbol not found: _minimum`


 === Solution:

 include the definition of the `minimum()` macro also in
 `lib/util/arc4random_buf.c`:[[br]]
 a related patchfile is attached.

 (it arguably would be better to move the macro definition into a header
 file and wrap with an `#ifdef` to test whether it has already been
 defined...).

-- 
Ticket URL: <https://trac.macports.org/ticket/63858>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list