Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: USERNAME bug zsh-2.6-beta9



becker@xxxxxxxxxxxxxxxx (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".

>As a result, prompt="%n>" will not display the correct username.
>
>(btw: zsh is great, I really appreciate all the efforts...)

Ah...I definitaly agree with you, this got me to finally track down the
change, this works for me:

*** init.c.bak	Fri Jun 30 10:18:35 1995
--- init.c	Fri Jun 30 10:18:49 1995
***************
*** 513,519 ****
  	else
  	    logname = ztrdup("");
      }
!     username = ztrdup(logname);
  
      /* Try a cheap test to see if we can *
       * initialize $PWD from $HOME        */
--- 513,519 ----
  	else
  	    logname = ztrdup("");
      }
!     username = ztrdup(pswd->pw_name);
  
      /* Try a cheap test to see if we can *
       * initialize $PWD from $HOME        */

Much better...thanks for complaining :)


-philip

____________________________________________________________ Philip Kizer ___
Texas A&M CIS Operating Systems Group, Unix ( 409.862.4120 ) pckizer@xxxxxxxx

"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



Messages sorted by: Reverse Date, Date, Thread, Author