Bug 142083

Summary: hardlinked file permissions, warning?
Product: [Fedora] Fedora Reporter: Nigel Kukard <nkukard>
Component: rpmAssignee: Paul Nasrat <pnasrat>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: low Docs Contact:
Priority: medium    
Version: rawhideCC: pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-12 16:20:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Nigel Kukard 2004-12-07 06:36:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)

Description of problem:
When building an RPM package, if a file is installed to RPM_BUILD_ROOT
and hardlinked to another file name and an %{attr} statement added to
the first one, rpm does a double chown/chmod and resets permissions on
the first one.

for instance (in the %install section)...

touch RPM_BUILD_ROOT/sbin/a
chmod 644 RPM_BUILD_ROOT/sbin/a

in the %files section...

%attr(0755,root,root) /sbin/a

when installed both files with be 0644.

this is not really a bug in rpm, but maybe a warning would be a good idea?

Version-Release number of selected component (if applicable):
rpm-4.3.3 & rpm-4.4

How reproducible:

Steps to Reproduce:
1.create an rpm specfile which hardlinks one file to another name
2.create an attr statement  for first file and leave second file
without an %attr() statement
3.install rpm

Actual Results:  both files are set with default permissions of second
file above

Expected Results:  maybe a warning message?

Additional info:

Comment 2 Jeff Johnson 2006-02-12 16:20:19 UTC
There are a vanishingly small number of packages attempting both hardlinks
and %attr, so the work detecting different %attr modifiers on hardlinks is not
worth the effort imho.

The command
     rpm -V pkg
will detect multiple %attr apllied to hardlinks.