Bug 76246 - test -w /etc/passwd on immutable file fails
test -w /etc/passwd on immutable file fails
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: xinetd (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-18 13:27 EDT by Mike
Modified: 2007-04-18 12:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-13 16:30:13 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)

  None (edit)
Description Mike 2002-10-18 13:27:36 EDT
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.