Keeps incorrect MAIL= env var from previous user
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo |
Unknown
|
Unknown
|
|||
sudo (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: sudo
Hi
If I login over ssh as initialuser to a server and "sudo -i -u anotheruser" or "sudo -s -u anotheruser", MAIL= is set to /var/mail/
It seems that MAIL is set in either of these ways:
- sshd sets it (apparently by default; not sure how to override)
- pam_mail sets it unless noenv is passed in the PAM config; the default PAM config for "login" and "su" use pam_mail without noenv and the default config of sshd uses pam_mail *with* noenv
- some custom shell config might set it
Either we fix sshd/login NOT to set MAIL by default, but I don't think that's useful, or we fix sudo to set MAIL=, at least in some cases. I think sudo -i should definitely cause MAIL to be set properly.
Bye
ProblemType: Bug
Architecture: amd64
Date: Fri Jan 15 15:11:13 2010
DistroRelease: Ubuntu 9.10
Package: sudo 1.7.0-1ubuntu2
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/zsh
ProcVersionSign
SourcePackage: sudo
Uname: Linux 2.6.31-17-server x86_64
Quickly adding myself to the 'affected persons' count. Sudo claims -i "simulates initial login". Initial login sets MAIL correctly. I advise sudo su - while this broken -i behavior persists.