From owner-freebsd-hackers Mon Dec 17 1: 5: 2 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from rutger.owt.com (rutger.owt.com [204.118.6.16]) by hub.freebsd.org (Postfix) with ESMTP id 13D5C37B41A for ; Mon, 17 Dec 2001 01:04:56 -0800 (PST) Received: from owt.com (owt-207-41-94-232.owt.com [207.41.94.232]) by rutger.owt.com (8.9.3/8.9.3) with ESMTP id BAA22383; Mon, 17 Dec 2001 01:04:19 -0800 Message-ID: <3C1DB513.1020807@owt.com> Date: Mon, 17 Dec 2001 01:04:19 -0800 From: Kent Stewart User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Anthony Schneider Cc: "Brandon D. Valentine" , Andreas Klemm , apsfilter-hackers@apsfilter.org, freebsd-hackers@FreeBSD.ORG Subject: Re: aps2file doesn't work on FreeBSD References: <20011216195054.A36208@mail.slc.edu> <20011217030451.V94172-100000@turtle.looksharp.net> <20011217035644.A40375@mail.slc.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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. >> >>-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