Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 81262

Summary: /etc/profile checks that user is called root, instead of checking uid 0
Product: Gentoo Linux Reporter: Yosef Meller <yosefm>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WORKSFORME    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Test for $UID instead of `whoami`

Description Yosef Meller 2005-02-08 10:33:05 UTC
The superuser on a linux system doesn't have to be called root, it only needs to be the zeroth user. But /etc/profile checks the name rather than the number.

Reproducible: Always
Steps to Reproduce:
1. Change user 0 name to 'gever' in /etc/passwd
2. Update /etc/shadow to match.
3. login as 'gever'

Actual Results:  
The result is immediately visible - the prompt is green instead of red.

Expected Results:  
Test for UID instead of name
Comment 1 Yosef Meller 2005-02-08 10:35:00 UTC
Created attachment 50755 [details, diff]
Test for $UID instead of `whoami`
Comment 2 SpanKY gentoo-dev 2005-02-08 10:40:54 UTC
looks like your patch is reversed and against baselayout-1.9.x ...

baselayout-1.11.x does this correctly:
if [ "$EUID" = 0 ] || [ "`/bin/whoami`" = 'root' ]; then