Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling 2.6.9-1.724 kernel update



On Tue, Jan 18, 2005 at 10:46:04PM -0500, Gordon Marx wrote:
> On Tue, 18 Jan 2005 22:31:59 -0500, Derek Martin <invalid at pizzashack.org> wrote:
> > If you use the -, $HOME gets reset to /root (or whatever root's home
> > dir is).  If you don't use '-', $HOME remains set to the home dir of
> > the user who ran su.
> 
> Nah, on my box the difference is that su - == su then cd. I dunno if
> distro has anything to do with it, but if so, I run Gentoo. (even if
> it doesn't, I still run Gentoo...oh hell, you know what I mean anyway)

Well, to be exact, the '-' tells su to make the exec()'d shell a login
shell.  This means that in addition to all the other things that su
normally does (changing U/GIDs), the new user's environment files
(.profile, .bashrc, etc.) will be sourced, and the working directory
will be changed to the new user's home directory.  What I said was
correct (even on your Gentoo box), just incomplete.

In my experience, the main reason using or not using '-' can make a
difference to some programs is because the user's environment
variables have the "wrong" values -- if '-' is not used, they retain
the values set for the old user.  In the case where one is su'ing to
root, this normally doesn't make too much difference, because root can
normally write anywhere on the filesystem.  However, if the program
makes assumptions about where files are, and is inconsistent about
using environment variables to find things, a conflict could occur.

If the programmer was careful, none of this should matter, usually.
But in some special cases, it does, and unfortunately programmers do
sometimes make mistakes.

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20050118/445631a8/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org