Bug 143826 - tcsh should clearly indicate root status after su
tcsh should clearly indicate root status after su
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: setup (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-29 01:38 EST by Christopher Beland
Modified: 2014-03-16 22:51 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.5.40-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-31 15:33:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Set $prompt and $promptchars to reflect UID=0 when $USER != root (327 bytes, patch)
2005-01-30 16:34 EST, Miloslav Trmač
no flags Details | Diff

  None (edit)
Description Christopher Beland 2004-12-29 01:38:24 EST
rootfiles-8-1
(Fresh Fedora Core 3 install)

My username is "beland" and my hostname is "stop".  Compare the
default prompts after su'ing to root, when root's shell is:

bash:
[root@stop beland]#
tcsh:
[beland@stop beland]$

I would expect the root prompt in tcsh to have either a # or a "root"
in it, to clearly indicate root status.  As it is for tcsh, it's the
same as if I were not su'd, except for the treatment of ~.

Beland
Comment 1 Bill Nottingham 2005-01-21 17:24:49 EST
[notting@nostromo ~]$ grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/tcsh
[notting@nostromo ~]$ su
[notting@nostromo notting]#

This is with FC devel; I do get the '#' distinguisher.

The name comes from %n... since that's substituted in by tcsh,
assigning there.
Comment 2 Miloslav Trmač 2005-01-30 16:34:07 EST
Created attachment 110419 [details]
Set $prompt and $promptchars to reflect UID=0 when $USER != root

I'm afraid this works "as designed". :/

"%n" is replaced by $user, which is initialized by $USER; (su) doesn't
change $USER when switching to root.

The easiest way to get bash-like behavior is the attached change to csh.cshrc;
if that doesn't look good enough, I can talk to the upstream about changing %n
behavior.
Comment 3 Bill Nottingham 2005-01-31 15:33:04 EST
While I think the tcsh behavior is wrong, not sure it's worth the
arguments with upstream. Feel free to bring it up with upstream, but
change added in 2.5.40-1.

Note You need to log in before you can comment on or make changes to this bug.