Red Hat Bugzilla – Bug 76246
test -w /etc/passwd on immutable file fails
Last modified: 2007-04-18 12:47:44 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):
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