Bug 154 - option to use the target user's environment (like 'su -')
option to use the target user's environment (like 'su -')
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.6
PC All
: normal enhancement
Assigned To: Todd C. Miller
http://www.sudo.ws/mailman/htdig/sudo...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-14 11:27 MDT by Michael
Modified: 2004-10-14 15:31 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 Michael 2004-10-14 11:27:08 MDT
I think sudo very badly needs a cmdline flag to have a job run in the target 
user's (normally root's) environment, much like the standard command 'su -'.

  Currently, I can't reliably re/start apache under sudo, since 'sudo /etc/init.
d/httpd restart' applies my personal environment variables (LD_LIBRARY_PATH, 
etc) to the httpd process.  Another use case would be to enable basic commands 
like 'sudo useradd foo' instead of 'sudo /usr/sbin/useradd foo'.

  I think it may be common for sysadmin's to let some users be able to restart a 
webserver, but not have full root access.  In a case like that, it currently 
just isn't possible for the user to start httpd cleanly.
Comment 1 Todd C. Miller 2004-10-14 11:31:01 MDT
See the -i flag in sudo 1.6.8p1.  You can also specify that sudo should throw away the current 
environment and use a minimal one with the env_reset sudoers option.