Bug 14271

Summary: rpm-3.0.3-5x calls chmod incorrectly
Product: [Retired] Red Hat Linux Reporter: Need Real Name <petr.novotny>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-07-21 14:01:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2000-07-19 09:45:10 UTC
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 
stage:

+ /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`
fileutils-3.16-9


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!]

Comment 1 Need Real Name 2000-07-19 09:51:01 UTC
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).

Comment 2 Jeff Johnson 2000-07-19 14:20:04 UTC
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
	%_fixowner
	%_fixgroup
	%_fixperms
from /usr/lib/rpm/macros in rpm-3.0.4, put in /etc/rpm/macros. Or simply comment
the values
out of /usr/lib/rpm/macros in rpm-3.0.3.

Comment 3 Jeff Johnson 2000-07-21 14:01:01 UTC
*** Bug 9411 has been marked as a duplicate of this bug. ***

Comment 4 Jeff Johnson 2000-07-24 19:51:17 UTC
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
patching virgin
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
%_fixowner/%_fixuser/%_fixgroup
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
rpm-3.0.5-7.5x.
configuration