Bug 804910

Summary: %defattr overrides %attr if directory default permission given
Product: Red Hat Enterprise Linux 6 Reporter: Iliya Peregoudov <iperegudov>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-20 06:46:12 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 Iliya Peregoudov 2012-03-20 06:40:11 UTC
%dir %attr erroneously inherit default directory permissions from %defattr.

Version-Release number of selected component (if applicable):
rpm-build-4.8.0-19.el6.i686

How reproducible:
# test.spec
Name: test
Version: 1.0
Release: 1
Summary: test
Group: Test
License: Test
BuildRoot: /var/tmp/%{name}-%{version}-%{release}
%description
Test
%install
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run
%files
%defattr(644, root, root, 755)
%dir %attr(775, root, test) %{_localstatedir}/run

Steps to Reproduce:
1. rpmbuild -bb test.spec
  
Actual results:
$ rpm -qlvp test-1.0-1.i386.rpm
drwxr-xr-x    2 root    test                0 Mar 20 10:37 /var/run

Expected results (produced on RHEL 5.7 system):
$ rpm -qvlp test-1.0-1.i386.rpm
drwxrwxr-x    2 root    test                0 Mar 20 10:07 /var/run

Additional info:
Also reported in following bug trackers:
https://bugs.launchpad.net/rpm/+bug/633729
https://bugzilla.novell.com/show_bug.cgi?id=629048

Comment 1 Panu Matilainen 2012-03-20 06:46:12 UTC

*** This bug has been marked as a duplicate of bug 730473 ***