Bug 242

Summary: When run from a shell with ulimits enabled; sudo inherits ulimits when run as root
Product: Sudo Reporter: Alec Warner <antarus>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: low    
Version: 1.6.8   
Hardware: PC   
OS: Linux   

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.