From: pckizer@tamu.edu (Philip Kizer)
To: schaefer@z-code.com
Cc: becker@Atria.com, zsh-workers@math.gatech.edu
Subject: Re: USERNAME bug zsh-2.6-beta9
Date: Fri, 30 Jun 1995 12:10:01 -0500 [thread overview]
Message-ID: <970.804532201@gonzo.tamu.edu> (raw)
In-Reply-To: Your message of "Fri, 30 Jun 1995 09:41:28 PDT." <9506300941.ZM2145@zipx1.z-code.com>
"Bart Schaefer" <schaefer@z-code.com> wrote:
>On Jun 30, 10:20am, Philip Kizer wrote:
>} Subject: Re: USERNAME bug zsh-2.6-beta9
>}
>} becker@phobos.atria.com (Paul H. Becker) wrote:
>} >One (tiny) problem I have found with zsh-2.6-beta9 (as well as
>} >zsh-2.6-beta9-hzoli9) is that when I "su" to a new user, $USERNAME stays
>} >the same as the person I initially logged in as ($LOGNAME). Previous
>} >version of zsh (zsh-2.6-beta8) correctly change $USERNAME when I "su".
>Er, sorry, but that's the correct behavior. USERNAME and USER and
>LOGNAME and HOME and so on should only get changed when you use "su -"
>(to run the new shell as a login shell). Otherwise the environment
>is supposed to remain that of the original user.
Well, I actually don't care about the environment variables, I only care
about the %n printed from the PROMPT or 'print -P', and anyway ... even
when I 'su -', _my_ username was getting printed instead of 'root'.
Granted, I use %# so the final character is a "#" instead of "%", but
that's why I use "%n", especially when su-ing, just as an on-screen
reminder.
"%n" should show the username of the uid running the shell in my opinion as
that's what current privileges are in effect. I guess this qualifies as a
minor change from the way it's documented, and it was just "wrong" for so
long I got used to it showing name of current uid. Which beta release did
that actually get "fixed"...about b7?
Getting it from the utmp will always break _all_ su's, even 'su -'. That's
why I chose the "fix" I did; logname will stay set from utmp as it is now,
but username will be set to the username of the uid running the process so
that "%n" shows the "correct" (IMO) information.
Suggestions for a cleaner way while keeping "%n" able to show "root" when
you do a "su -"?
-philip
____________________________________________________________ Philip Kizer ___
Texas A&M CIS Operating Systems Group, Unix ( 409.862.4120 ) pckizer@tamu.edu
"Relying on the government to protect your privacy is like asking a peeping
tom to install your window blinds." -John Perry Barlow, EFF co-founder
next prev parent reply other threads:[~1995-06-30 17:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-06-30 15:10 Paul H. Becker
1995-06-30 15:20 ` Philip Kizer
1995-06-30 16:41 ` Bart Schaefer
1995-06-30 17:10 ` Philip Kizer [this message]
1995-06-30 18:20 ` Zoltan Hidvegi
1995-06-30 21:55 ` Richard Coleman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=970.804532201@gonzo.tamu.edu \
--to=pckizer@tamu.edu \
--cc=becker@Atria.com \
--cc=schaefer@z-code.com \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).