Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 81421 - MAIL env. var. set to different values by su and login
Summary: MAIL env. var. set to different values by su and login
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 79174 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-09 15:16 UTC by Brad
Modified: 2005-02-10 10:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brad 2005-02-09 15:16:53 UTC
For the root user:

/bin/su sets the MAIL env var to /root/

/bin/login sets the MAIL env var to /var/mail/root

The su behaviour is incorrect!

Reproducible: Always
Steps to Reproduce:
1.login
2.env |grep MAIL
3. logout

4. Log in as another user
5. su -
6. env|grep MAIL

Actual Results:  
MAIL=/var/mail/root

MAIL=/root/

Expected Results:  
MAIL=/var/mail/root

MAIL=/var/mail/root

First of all, its possible some process other than su is messing up the MAIL env
var, I looked at the code for login, and it does what I consider the correct thing.

Of course it has an easy workaround, though its not actually a foolproof workaround.
Comment 1 Sven Wegener gentoo-dev 2005-02-09 15:35:39 UTC

*** This bug has been marked as a duplicate of 70101 ***
Comment 2 Brad 2005-02-09 17:56:09 UTC
I appreciate the rapid response, but I think given the resolution for the dupe will not fix this particular bug.  The problem will still exist.  

Consider the following sequence of commands:

> su -
> mail

/root/ is not a valid inbox format

And not suprising, its a directory.  It makes no sense.  My bet is that su is broken, probably simply compiled with an incorrect option.

Please unresolve, or un-dupe my bug and mark it will not fix, as it is not resolved by the proposed fix.

Sorry, I originally added these comments to the dupe.  I apologize.

Thanks!
Comment 3 Sven Wegener gentoo-dev 2005-02-09 20:28:44 UTC
Which version of sys-apps/shadow are you using? Please provide the output of emerge --info too
Comment 4 Brad 2005-02-09 21:04:09 UTC
Requested Info below.  I will look at the source to su, and determine if the problem is in the source for su sometime in the next couple days.

--
[ebuild   R   ] sys-apps/shadow-4.0.5-r2

Portage 2.0.51-r15 (default-linux/x86/2004.0, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.10-gentoo-r6 i686)
=================================================================
System uname: 2.6.10-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb  9 2005, 11:25:29)]
ccache version 2.3 [enabled]
dev-lang/python:     2.2.3-r5, 2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.4.19-r1, 2.4.21-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -ffast-math -fomit-frame-pointer -foptimize-sibling-calls -funroll-loops -mfpmath=sse -mmmx -msse"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -ffast-math -fomit-frame-pointer -foptimize-sibling-calls -funroll-loops -mfpmath=sse -mmmx -msse"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks fixpackages sandbox sfperms userpriv"
GENTOO_MIRRORS="ftp://ibiblio.org/pub/Linux/distributions/gentoo/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://cudlug.cudenver.edu/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X Xaw3d aalib aim alsa apache2 apm arts audiofile avi berkdb bindist bitmap-fonts bonobo cdr crypt cups curl directfb emacs encode esd evo f77 fam flac font-server foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 guile imagemagick imlib ipv6 java jpeg junit leim libg++ libwww mad mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl oscar oss pam pdflib perl png ppds python qt quicktime readline sdl slang spell sse ssl svga tcltk tcpd tetex theora tiff truetype truetype-fonts type1-fonts x86 xml xml2 xmms xv yahoo zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS

Comment 5 Sven Wegener gentoo-dev 2005-02-09 21:35:19 UTC
If you could please unmask sys-apps/shadow-4.0.5-r3 via /etc/portage/package.keywords
on your system and update. It should be fixed in that version and that fix is
part of bug #70101 IIRC.
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2005-02-09 22:57:24 UTC
Any reason why it is still not marked stable?  This is now shadow-4.0.5-r3 or
later ...
Comment 7 Sven Wegener gentoo-dev 2005-02-09 23:07:15 UTC
No reason I'm aware of.
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2005-02-10 09:29:45 UTC
*** Bug 79174 has been marked as a duplicate of this bug. ***
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2005-02-10 10:35:57 UTC
Ok, bumped -r3 to stable.