--- Martin Orr <martin@walnut.methody.org> wrote:
On Mon, Jul 28, 2003 at 10:33:34AM +0100, Thomas Adam wrote:
--- Peter Wilson <peter.wilson@tuxite.com> wrote:
As far as my understanding of the philosophy of su is concerned, the default action is not to perform a 'login' but to change the effective guid and uid of the shell, this is the function of the '-' or '-l'
Yes, you are right when you say that a normal "su" changes the effective UID **and** GID, but that is only for the $USER, and NOT for the shell as you write above :) the shell does not have U{G}ID's!!!
Of course the shell has UID and GIDs. The shell is a process and every process has real, effective, saved and (on Linux) filesystem UIDs and GIDs which determine which files it can access and how it can interact with other processes. It makes no difference how you call su however - they will all be set to 0. (If you want to see these values, "cat /proc/$PID/status | grep Uid" will give them to you.)
:) *cough*, /bin/bash does not have a GID/UID assigned to it per se, which is now I interpreted Peter's initial sentence. /bin/bash (or whatever $SHELL is set to) is not the one that handles the U{G}ID's at all, that is done with the kernel (as you have spotted via "/proc"). Again, you're slightly in error as "su" is specified by "su [user]" will change the GID/UID for the [user] specified, and will NOT get changed to 0. -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/