Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#63858 closed defect (fixed)

sudo @1.9.8p2: defect: missing definition of minimum() macro in lib/util/arc4random_buf.c (runtime failure)

Reported by: balanco Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: Schamschula (Marius Schamschula), balanco
Port: sudo

Description

Description:

in sudo-1.9.8p2,

both, lib/util/arc4random.c and lib/util/arc4random_buf.c make use of the minimum() macro,
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
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:
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...).

Attachments (1)

sudo_1.9.8p2-patch-add-definition-of-minimum-macro-to-arc4random_buf.txt (254 bytes) - added by balanco 2 years ago.
patchfile for sudo-1.9.8p2: inject the missing macro definition of "minimum()" (taken from lib/util/arc4random.c) into lib/util/arc4random_buf.c

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by balanco

patchfile for sudo-1.9.8p2: inject the missing macro definition of "minimum()" (taken from lib/util/arc4random.c) into lib/util/arc4random_buf.c

comment:1 Changed 2 years ago by balanco

Cc: balanco added

comment:2 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Sounds like an upstream bug? Not MacPorts-specific? Have you already filed an upstream bug report?

comment:3 Changed 2 years ago by Schamschula (Marius Schamschula)

I've filed an upstream ticket https://bugzilla.sudo.ws/show_bug.cgi?id=1008

comment:4 Changed 2 years ago by Schamschula (Marius Schamschula)

In 209e74d24ccbf670240d814970fb613de54e181c/macports-ports (master):

sudo: fix missing definition of minimum() macro

See: #63858
See: https://bugzilla.sudo.ws/show_bug.cgi?id=1008

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: sudo-1.9.8p2: defect: missing definition of minimum() macro in lib/util/arc4random_buf.c (runtime failure)sudo @1.9.8p2: defect: missing definition of minimum() macro in lib/util/arc4random_buf.c (runtime failure)

Upstream says they fixed it this way: https://www.sudo.ws/repos/sudo/rev/a66c68c3a976

Anything remaining to do before closing this ticket?

comment:6 Changed 2 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: newclosed

Yes, I was made aware of the upstream patch after applying the patch attached to this ticket. It will be in the next update to sudo.

I left the ticket open, in case of any issues with the original patch.

None so far. Closing the ticket.

Last edited 2 years ago by Schamschula (Marius Schamschula) (previous) (diff)
Note: See TracTickets for help on using tickets.