Bug 76246

Summary: test -w /etc/passwd on immutable file fails
Product: [Retired] Red Hat Linux Reporter: Mike <logan+redhat-bugzilla>
Component: xinetdAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-13 21:30:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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: