Keeps incorrect MAIL= env var from previous user

Bug #507934 reported by Loïc Minier
10
This bug affects 2 people
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/initialuser which means that e.g. mail/mailx/mutt or even zsh are using the wrong mailbox.

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
ProcVersionSignature: Ubuntu 2.6.31-17.54-server
SourcePackage: sudo
Uname: Linux 2.6.31-17-server x86_64

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
A. Campbell (allenc28) wrote :

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.