|
Bugzilla – Full Text Bug Listing |
| Summary: | PATH not preserved in 1.6.9p19 | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Ben Lentz <ben.lentz> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED INVALID | ||
| Severity: | normal | ||
| Priority: | normal | ||
| Version: | 1.6.9 | ||
| Hardware: | PC | ||
| OS: | AIX | ||
You are overriding the default set of variables to preserve. What you want is: Defaults env_keep += "ODMDIR" since you want to add ODMDIR to the list of things to preserve. Ugh. You're right, my fault. I assumed that the sudo -V preserve list was a dynamically generated result set of the existing rules in the sudoers file. |
Platform: AIX 5.3.0 TL8 SP2 Version: sudo-1.6.9p19 The PATH variable should be preserved according to the output of "sudo sudo -V", but is not when any env_keep entry is present. Everything looks good with the configuration and the -V output: $ grep env_keep /etc/sudoers Defaults env_keep = "ODMDIR" $ sudo sudo -V Sudo version 1.6.9p19 --SNIP-- Environment variables to preserve: --SNIP-- PATH --SNIP-- However, it does not appear to actually work: $ echo $PATH; sudo sh -c "echo \$PATH" /home/blentz/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/opt/pware/bin:/opt/local/bin /usr/bin:/bin But, if I remove env_keep for the unrelated ODMDIR variable (and, assuming env_reset is active, according to the documentation), PATH is properly preserved: $ grep env_keep /etc/sudoers #Defaults env_keep = "ODMDIR" $ echo $PATH; sudo sh -c "echo \$PATH" /home/blentz/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/opt/pware/bin:/opt/local/bin /home/blentz/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/opt/pware/bin:/opt/local/bin