Bug 904

Summary: sudo: setrlimit(8): Invalid argument
Product: Sudo Reporter: Marius Schamschula <mschamschula>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.29   
Hardware: Macintosh   
OS: MacOS X   
Attachments: Avoid setrlimit warnings on macOS

Description Marius Schamschula 2019-10-29 06:24:53 MDT
After updating to sudo 1.8.29 for MacPorts, I get the following message when invoking sudo:

sudo: setrlimit(8): Invalid argument

Also see: https://trac.macports.org/ticket/59513

This message is seen by multiple macOS versions. The ticket reporter is running 10.7.5, while my build machine has 10.14.6.
Comment 1 Todd C. Miller 2019-10-29 08:29:59 MDT
Created attachment 533 [details]
Avoid setrlimit warnings on macOS

macOS does not allow rlim_cur to be set to RLIM_INFINITY for RLIMIT_NOFILE.
We need to use OPEN_MAX instead as per the macOS setrlimit manual.
Comment 2 Todd C. Miller 2019-10-29 08:30:46 MDT
Committed as https://www.sudo.ws/repos/sudo/rev/2a00e62eaeb0
Comment 3 Todd C. Miller 2019-12-31 15:08:32 MST
Fixed in sudo 1.8.30