Bug 440417 - chmod failure when using --setugids
Summary: chmod failure when using --setugids
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm
Version: 5.1
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-04-03 13:54 UTC by Jim Perrin
Modified: 2013-03-07 12:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-07 12:51:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jim Perrin 2008-04-03 13:54:01 UTC
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):
rpm-4.4.2-47.el5.x86_64

How reproducible:
Always

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
fixed.

Comment 1 Jim Perrin 2008-04-03 19:38:02 UTC
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 19:45:18 UTC
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:
`0100644'

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 12:51:26 UTC
Turns out this has gotten fixed a long time ago in the rebase to rpm 4.4.2.3:

https://rhn.redhat.com/errata/RHBA-2009-0079.html


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