Red Hat Bugzilla – Bug 14271
rpm-3.0.3-5x calls chmod incorrectly
Last modified: 2008-05-01 11:37:56 EDT
After problems with rpm-3.0.4-5x (see bug 10763) I decided to downgrade to
rpm-3.0.3-5x to build me a OpenSSH. However, the build breaks in %prep
+ /bin/chown -Rhf root .
/bin/chown: --no-dereference (-h) is not supported on this system
Bad exit status from /var/tmp/rpm-tmp.29466 (%prep)
[root@saturnin SPECS]# rpm -qf `which chown`
The 3.0.3-5x rpm has no special requirements about fileutils. The %prep
stage of the openssh.spec file contains only %setup -a 1, nothing more.
[This sucks: OpenSSH requires rpm>=3.0.3 to --rebuild. 3.0.3 can't do
chmod, 3.0.4 completely zarks up the cpio archive (see bug 10763), 3.0.5
doesn't exist for 5.x (glibc2.0) systems, the precompiled OpenSSH packages
require glibc2.1. Doh!]
I should perhaps add that rpm 3.0.4 recompiles the whole package correctly
(without any problems with chmod) but then fails to create a valid cpio archive
(and consequently a valid .i386.rpm binary package).
To use rpm-3.0.4 on Red Hat 5.x
add --nolibio to the command line
To revert to rpm-3.0.3, grab the definitions of
from /usr/lib/rpm/macros in rpm-3.0.4, put in /etc/rpm/macros. Or simply comment
out of /usr/lib/rpm/macros in rpm-3.0.3.
*** Bug 9411 has been marked as a duplicate of this bug. ***
More information on chmod:
For hysterical reasons, lchown is not supported at all in 2.0.x kernels and
libc5. That's the reason
why chmod is failing.
For other hysterical reasons, rpm does chown/chgrp/chmod when unpacking and
sources at the end of %prep, and this is a rather largish problem when running
across, for example, a dangling symlink contained in a tarball.
I still suggest that the correct solution is to undefine all of
and to control for ownership and mode within packaging. However, the support
(and enabled in the default configuration!) for this "feature" must remain in
rpm for legacy reasons.
The other issue, building with rpm-3.0.4 using --nolibio, has been fixed in