Linux: anthony:/home/anthony:9% uname -a Linux lappy.slc.edu 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i686 unknown anthony:/home/anthony:10% su Password: [root@lappy anthony]# echo $USER root [root@lappy anthony]# exit anthony:/home/anthony:11% su -l Password: [root@lappy /root]# echo $USER root [root@lappy /root]#
FreeBSD: anthony:/home/anthony:20% uname -a FreeBSD flack.slc.edu 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000 [EMAIL PROTECTED]:/usr/src/sys/compile/GENERIC i386 anthony:/home/anthony:21% su Password: flack# echo $USER anthony flack# exit anthony:/home/anthony:22% su -l Password: flack# echo $USER root flack# logout anthony:/home/anthony:23% From 'info su' on my linux box: By default, `su' does not change the current directory. It sets the environment variables `HOME' and `SHELL' from the password entry for USER, and if USER is not the super-user, sets `USER' and `LOGNAME' to USER. By default, the shell is not a login shell. su version (on my linux box): [root@lappy anthony]# su --version su (GNU sh-utils) 2.0 Written by David MacKenzie. Copyright (C) 1999 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@lappy anthony]# Perhaps it's time to contact gnu? -Anthony. [ and apologies for the line wrapping ] On Mon, Dec 17, 2001 at 03:09:19AM -0500, Brandon D. Valentine wrote: > On Sun, 16 Dec 2001, Anthony Schneider wrote: > > >Well, the reason I brought up $USER inheritance is that on linux, $USER > >is root after an su to root, whereas on FreeBSD, the $USER is the same > >as before the su. > > [Line wrap at 72, please] > > Excerpt from su(1): > --- > By default, the environment is unmodified with the exception of USER, > HOME, and SHELL. HOME and SHELL are set to the target login's default > values. USER is set to the target login, unless the target login has a > user ID of 0, in which case it is unmodified. The invoked shell is the > target login's. This is the traditional behavior of su. > <snip> > -l Simulate a full login. > --- > > You are observing none other than the expected behavior. I have never > seen Linux (GNU) su do things any differently in this regard. If they > do, it's broken. > > Brandon D. Valentine > -- > "Iam mens praetrepidans avet vagari." > - G. Valerius Catullus, Carmina, XLVI > > > To Unsubscribe: send mail to [EMAIL PROTECTED] > with "unsubscribe freebsd-hackers" in the body of the message
msg30202/pgp00000.pgp
Description: PGP signature