Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 81262 - /etc/profile checks that user is called root, instead of checking uid 0
Summary: /etc/profile checks that user is called root, instead of checking uid 0
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 10:33 UTC by Yosef Meller
Modified: 2005-02-08 10:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Test for $UID instead of `whoami` (profile_uid.patch,352 bytes, patch)
2005-02-08 10:35 UTC, Yosef Meller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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