Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 00:44:27 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Eitan Adler <lists@eitanadler.com>
Cc:        freebsd-current Current <freebsd-current@freebsd.org>
Subject:   Re: prompt w/ uid 0 for cshrc
Message-ID:  <20121118234426.GA16628@dft-labs.eu>
In-Reply-To: <CAF6rxg=V4gbOKOfB%2BJ-fzxHDjqducd8C7d7f1Oxz-UxbquVKeg@mail.gmail.com>
References:  <CAF6rxg=V4gbOKOfB%2BJ-fzxHDjqducd8C7d7f1Oxz-UxbquVKeg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 18, 2012 at 06:32:20PM -0500, Eitan Adler wrote:
> Hey,
> 
> at the moment the current default csh prompt looks like
> 
> user@hostname:directory% command
> 
> This leads to an unexpected[*] result when using su (without "-").
> 
> In particular the user part is *not* changed to "root" (or "toor" or
> any other superuser indication) although the promptchar is changed to
> "#".
> This causes some confusion for new users and even some experienced ones.
> 
> I worked around this issue by including the following
> 
>         if ($uid == 0) then
>                 set user = root
>         endif
> 
> which I'm not certain is a good idea.
> 
> I would like to replace this with logic like
> 
> if $uid = 0 AND $user != toor AND $user != root
>   set user = "+$user"
> endif
> 
> does anyone think this is a bad idea? can anyone propose a better
> idea? Is the status quo okay?
> 

Just take user name from id -nu.

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121118234426.GA16628>