Bug 242 - When run from a shell with ulimits enabled; sudo inherits ulimits when run as root
When run from a shell with ulimits enabled; sudo inherits ulimits when run as...
Status: RESOLVED WONTFIX
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.8
PC Linux
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-22 18:01 MDT by Alec Warner
Modified: 2007-04-24 14:18 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Warner 2007-04-22 18:01:37 MDT
A rather contrived example:

antarus@kyoto ~ $ ulimit -v 10000
antarus@kyoto ~ $ sudo gaim
gaim: error while loading shared libraries: libpangoft2-1.0.so.0: failed to map segment from shared object: Cannot allocate memory
antarus@kyoto ~ $ 

When switching from UserA to UserB I can see some merit in keeping ulimits enforced; but enforcing ulimits on root serves no real purpose.
Comment 1 Todd C. Miller 2007-04-24 14:18:06 MDT
Sudo's pam config file should include pam_limits.so which allows system-wide and per-user limits to be specified (including root) in /etc/security/limits.conf.  If nothing is specified there then the current limits will be passed on to the program executed by sudo.  As far as I can tell, sudo's behavior is consistent with what happens when you su to root.