|
Bugzilla – Full Text Bug Listing |
| Summary: | sudo not changing to user's home | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Henrik Morsing <henrik> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | daniele |
| Priority: | low | ||
| Version: | 1.8.15 | ||
| Hardware: | IBM | ||
| OS: | AIX | ||
Sudo has never changed the current working directory but this is unrelated to the value of the HOME environment variable. If you run "sudo -u metro printenv HOME" you will see that it is being set to the proper value. I'm leaving this bug open since it would be useful to have an option that changes the cwd to the destination user's home directory. +1 on this In sudo 1.9.3 you can set the CWD on a per-rule basis or globally. For example, to always run commands in the target user's homedir you can use: Defaults runcwd=~ where '~' stands for the user's homedir. |
Using -H or always_set_home still preserves root's home directory: --> sudo -V Sudo version 1.8.15 [...] Environment variables to preserve: XAUTHORIZATION XAUTHORITY PS2 PS1 PATH LS_COLORS KRB5CCNAME HOSTNAME DISPLAY COLORS [...] --> sudo -H -u metron pwd / --> sudo -u metron ksh $ pwd / $ We have had this problem with 1.6.9p15 for years, decided to upgrade, but 1.8.15 does the same. Thanks