[3035] in Athena Bugs
Re: 6.3B: su
daemon@ATHENA.MIT.EDU (probe@ATHENA.MIT.EDU)
Tue Aug 29 17:57:46 1989
From: <probe@ATHENA.MIT.EDU>
Date: Tue, 29 Aug 89 17:57:30 -0400
To: bugs@ATHENA.MIT.EDU, raeburn@ATHENA.MIT.EDU
Reply-To: Richard Basch <probe@ATHENA.MIT.EDU>
[3033] daemon@ATHENA.MIT.EDU Athena Bugs 08/29/89 10:41 (30 lines)
Subject: Re: 6.3B: su
Date: Tue, 29 Aug 89 10:41:18 -0400
From: Ken Raeburn <raeburn@ATHENA.MIT.EDU>
To: Richard Basch <probe@ATHENA.MIT.EDU>
Cc: bugs@ATHENA.MIT.EDU
In-Reply-To: Richard Basch's message of Tue, 29 Aug 89 06:33:55 -0400,
2) Any attempt at preserving the actual username
by doing this method is useless... a better way
would be to do a getlogin() call which reads the
entry from utmp. Who's to say, I haven't su'd
twice.
Unless you're using an xterm without a utmp entry, or using script.
There *is* no good way to do this.
3) The behavior within the program is inconsistent
between root and other usernames. Why should
"root" be special? In fact, who's to say that
uid 0 is called root. This is just one more
case of hard-coding.
I think "root" is also assumed as the default for "su", isn't it?
4) By removing the test, it becomes possible for
people to base their prompts on $user rather
than having to fork a "whoami" for every
invocation of .cshrc. Currently, there is no
other sure way of insuring that the uid has
not changed except for doing this call.
Um, how about $uid?
--[3033]--
Ok, let me state an obvious and general complaint about the entire
mechanism for only testing for root...
1) It is inconsistent with dealing with "root" and
other users. If it is only to preserve USER for
one case, this is BROKEN behavior; either do it
always, or never.
2) The thing that this program is trying to accomplish
with USER is what the WHO environment variable is
meant for.
I am willing to come up with more things as more arguments come back :)
Bug #2:
Now that you mention $uid -- it is a LOCAL hack, and is not documented
anywhere.
-Richard