loginid vs. uid.

Tony Olekshy tony at oha.UUCP
Sat Jul 21 09:09:09 AEST 1990


In message <2793 at wyse.wyse.com>, bob at wyse.wyse.com (Bob McGowen x4312 dept208)
writes (about $LOGNAME):
>
> Consider the name of the variable.  It should point to your login name
> regardless of whom you su to or how you su, I would think.  Just like a
> 'who am i' looks in /etc/utmp (I believe) and gets your login name even
> if you are su'ed to another user.  This seems like proper behavior to me.

Beg to differ, but the Xenix manual page explicity says:

     SU(C)		      XENIX System V			 SU(C)

	                                      If the first argument to
	  su is	a -, the environment is	changed	to what	would be
	  expected if the user actually	logged in as the specified
	  user.

So, if we set up two terminals, and you `su - foo` and I "login: foo",
then what am I to *expect* $LOGNAME to be in each case?

--
Yours etc., Tony Olekshy.               Internet: tony%oha at CS.UAlberta.CA
					  BITNET: tony%oha.uucp at UALTAMTS.BITNET
					    uucp: alberta!oha!tony



More information about the Comp.unix.questions mailing list