Bug 515685

Summary: %defattr(644,root,root,-) does not set default %attr owner and group
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: ffesti, herrold, jnovy, opensource, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-06 12:22:04 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 Till Maas 2009-08-05 11:33:30 UTC
Description of problem:
If i use %defattr(755,root,root-) and later %attr(644,-,-) foofile, the owner and group of foofile are not set to root.

Version-Release number of selected component (if applicable):
rpm-4.7.0-2.fc11
rpm-4.6.1-1.fc10

How reproducible:
always

Steps to Reproduce:
1. wget http://till.fedorapeople.org/tmp/attrtest.spec
2. rpmbuild -bb attrtest.spec
3. rpm -qp --qf "[%-8{fileusername} %-8{filegroupname} %{filenames}\n]" ~/rpmbuild/RPMS/noarch/attrtest-0-1.fc11.noarch.rpm | grep $USER
  
Actual results:
till     till     /attr

Expected results:
grep should not match / all contents should belong to root:root

Comment 1 Till Maas 2009-08-05 11:37:57 UTC
I expected the beheaviour because of this documentation:

http://www.rpm.org/max-rpm-snapshot/s1-rpm-specref-files-list-directives.html
| Attributes that do not need to be set by %attr may be replaced with a dash
[...]
|  The %defattr sets default %attr for RPM.

Comment 2 R P Herrold 2009-08-05 18:48:54 UTC
I would suggest there is a comma missing before the last dash in the %defattr

Comment 3 Till Maas 2009-08-05 21:27:34 UTC
(In reply to comment #2)
> I would suggest there is a comma missing before the last dash in the %defattr  

Thanks, but the spec does not have the typo.

Comment 4 Jindrich Novy 2009-08-06 12:22:04 UTC
Fixed upstream.