Date: Mon, 17 Dec 2001 01:04:19 -0800 From: Kent Stewart <kstewart@owt.com> To: Anthony Schneider <aschneid@mail.slc.edu> Cc: "Brandon D. Valentine" <bandix@looksharp.net>, Andreas Klemm <andreas@apsfilter.org>, apsfilter-hackers@apsfilter.org, freebsd-hackers@FreeBSD.ORG Subject: Re: aps2file doesn't work on FreeBSD Message-ID: <3C1DB513.1020807@owt.com> References: <20011216195054.A36208@mail.slc.edu> <20011217030451.V94172-100000@turtle.looksharp.net> <20011217035644.A40375@mail.slc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Anthony Schneider wrote: > 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]# It may work on Linux that way but you are supposed to do a "su -" on FreeBSD. For example, opal:kent> su Password: opal# env USER=kent opal:kent> su - Password: USER=root The system knows the difference. Kent > > > 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 jkh@bento.FreeBSD.org:/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 majordomo@FreeBSD.org >>with "unsubscribe freebsd-hackers" in the body of the message >> > -- Kent Stewart Richland, WA mailto:kbstew99@hotmail.com http://users.owt.com/kstewart/index.html FreeBSD News http://daily.daemonnews.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C1DB513.1020807>