Bug 75602 - rpmbuild improperly packages .src.rpm files built as a user
Summary: rpmbuild improperly packages .src.rpm files built as a user
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-10 04:10 UTC by Gerald Britton
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-10-10 17:35:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Gerald Britton 2002-10-10 04:10:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20021006

Description of problem:
building an rpm as a non-root user causes the files in the .src.rpm file to be
owned by that user in the cpio archive.  This results in rpms which likely
cannot be rebuilt with --rebuild as the original building user may not exist on
the second build system.  This is a fatal error when building an rpm apparently.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Build an rpm as a non-root user
2. rpm2cpio foo.src.rpm |cpio --list --verbose

	

Actual Results:  files in the .src.rpm are owned by the building user

Expected Results:  files in the .src.rpm should be owned by root

Additional info:

Comment 1 Jeff Johnson 2002-10-10 17:14:14 UTC
You need
	%files
	%defattr(-,root,root)
(at the minimum) in your spec file manifests.


Comment 2 Gerald Britton 2002-10-10 17:35:16 UTC
no no no.. not the binary rpm, the SOURCE rpm contains files which are
improperly owned...

---- cut here ---- minimal specfile:
Name:      testme
Version:   0
Release:   0
Summary:   Test RPM
License:   GPL
Group:     Test
BuildRoot: %_tmppath/%name-%version-root
%description
test
%install
rm -rf $RPM_BUILD_ROOT && mkdir -p $RPM_BUILD_ROOT
touch $RPM_BUILD_ROOT/testme
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root)
/testme

---- cut here ----

blue-smoke% rpmbuild -ba testme.spec
   ... rpm build ...
blue-smoke% rpm -qlvp /devel/rpm/SRPMS/testme-0-0.src.rpm
-rw-r--r--    1 gbrittongbritton          359 Oct 10 13:23 testme.spec
blue-smoke% rpm -qlvp /devel/rpm/RPMS/i386/testme-0-0.i386.rpm
-rw-r--r--    1 root    root                0 Oct 10 13:23 /testme

files in the .src.rpm file are owned by the build user.  If the file is
then transported to another machine without that user, rpmbuild --rebuild
will complain about the ownership of the files in the source rpm.


Comment 3 Jeff Johnson 2002-10-10 20:16:43 UTC
There's a warning, but the right thing happens,
at least when installing as non-root.

root may need to do
	chown root.root /usr/src/redhat/SOURCES/*

There's no way to precompute the ownership of files
in src.rpm's for all possible cases.


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