Bug 142083 - hardlinked file permissions, warning?
Summary: hardlinked file permissions, warning?
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2004-12-07 06:36 UTC by Nigel Kukard
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2006-02-12 16:20:19 UTC

Attachments (Terms of Use)

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.

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