|
Bugzilla – Full Text Bug Listing |
| Summary: | CDPATH variable is not unset | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Jan Ingvoldstad <jani+sudo-bugzilla> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | CLOSED FIXED | ||
| Severity: | security | ||
| Priority: | normal | ||
| Version: | 1.6.6 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
|
Description
Jan Ingvoldstad
2004-10-18 15:18:50 MDT
The next release of sudo will strip out CDPATH by default. With all due respect, I think that version 1.6.8p2, which mentions CDPATH in the
release notes and the manual pages, does *not* really unset it :) Is it
possible that you missed actually adding CDPATH to the initial_badenv_table[]
array in env.c?
[roam@snark ~]> whoami
roam
[roam@snark ~]> sudo whoami
root
[roam@snark ~]> sudo -K
[roam@snark ~]> whoami
roam
[roam@snark ~]> sudo whoami
Password:
root
[roam@snark ~]> setenv CDPATH /home/roam
[roam@snark ~]> printenv | fgrep CDPATH
CDPATH=/home/roam
[roam@snark ~]> sudo printenv | fgrep CDPATH
CDPATH=/home/roam
[roam@snark ~]> sudo -V | head -1
Sudo version 1.6.8p2
[root@snark ~]# sudo -V | fgrep PATH
Ignore '.' in $PATH
TERMPATH
PATH_LOCALE
NLSPATH
[root@snark ~]#
A pretty much one-line patch (adding CDPATH to the initial_badenv_table[] array)
fixes the problem - CDPATH is no longer set, and is also displayed in the 'sudo
-V' output.
Whoops, I mistakenly only applied the bash function diff and not the CDPATH one. I've released 1.6. 8p3 which does include the CDPATH diff as well as a fix for systems where _PATH_VAR_TMP does not include a trailing slash. |