Bug 440417 - chmod failure when using --setugids
chmod failure when using --setugids
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: packaging-team-maint
Depends On:
  Show dependency treegraph
Reported: 2008-04-03 09:54 EDT by Jim Perrin
Modified: 2013-03-07 07:51 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-03-07 07:51:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jim Perrin 2008-04-03 09:54:01 EDT
Description of problem:
if you try to restore an rpm to its original permissions using --setperms, rpm
exists with a chmod failure. 

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

How reproducible:

Steps to Reproduce:
1. install package
2. run rpm --setperms packagename
3. watch errors
Actual results:
On each file, rpm throws a chmod error similar to the one below (for httpd)
chmod: invalid mode: `0100644'
Try `chmod --help' for more information.
chmod: invalid mode: `0100644'
Try `chmod --help' for more information.
chmod: invalid mode: `0100644'
Try `chmod --help' for more information.

Expected results:
rpm properly resets permissions to default state. 

Additional info:

This is a very useful feature when attempting to repair a system, and should be
Comment 1 Jim Perrin 2008-04-03 15:38:02 EDT
Appears I spoke too soon. This appears to be more because of the use of
--setugids, not --setperms. --setperms works as advertised. It's --setuigids
which fails with the errors listed above. 
Comment 2 Jim Perrin 2008-04-03 15:45:18 EDT
UGH... STILL speaking too soon.

Individually each command succeeds. 

rpm --setperms httpd ; this succeeds
rpm --setugids httpd ; this succeeds
rpm --setperms --setugids httpd ; this fails with the error chmod: invalid mode:

rpm --setuigids --setperms httpd ; apparently command order matters. This fails
with an incremented (one for each file) list of:
sh: line 356: ch: command not found
sh: line 357: ch: command not found
sh: line 358: ch: command not found
sh: line 359: ch: command not found

It would seem that this is something minor and not escaped properly, though I'm
not sure where exactly. 
Comment 3 Panu Matilainen 2013-03-07 07:51:26 EST
Turns out this has gotten fixed a long time ago in the rebase to rpm


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