Bug 76246 - test -w /etc/passwd on immutable file fails
Summary: test -w /etc/passwd on immutable file fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: xinetd
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-18 17:27 UTC by Mike
Modified: 2007-04-18 16:47 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-13 21:30:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike 2002-10-18 17:27:36 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021016

Description of problem:
In the most recent update to xinetd (xinetd-2.3.9-0.73.i386.rpm), an addition to
the init script was added to test if /etc/passwd was writable by the user
running the script (ie, make sure he's root).

# Check that we can write to it... so non-root users stop here
[ -w /etc/passwd ] || exit 1

Using RedHat 7.3 (probably 7.2 and other versions) have sh-utils-2.0.11-14. If
you chattr +i /etc/passwd, the above test fails.

I tried this on debian with sh-utils 2.0.12 and it worked ok, so I'm guessing
they just added an immutable check inside 'test' itself.

My suggestion would be to use test -O instead or a real id=0 type check.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. chattr +i /etc/passwd
2. rpm -i xinetd-2.3.9-0.73.i386.rpm
3. /etc/init.d/xinetd restart (should do nothing)
	

Actual Results:  xinetd doesn't start

Additional info:


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