Bug 75602 - rpmbuild improperly packages .src.rpm files built as a user
rpmbuild improperly packages .src.rpm files built as a user
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-10-10 00:10 EDT by Gerald Britton
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-10-10 13:35:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gerald Britton 2002-10-10 00:10:57 EDT
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:

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 13:14:14 EDT
You need
(at the minimum) in your spec file manifests.
Comment 2 Gerald Britton 2002-10-10 13:35:16 EDT
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
rm -rf $RPM_BUILD_ROOT && mkdir -p $RPM_BUILD_ROOT
touch $RPM_BUILD_ROOT/testme
%defattr (-,root,root)

---- 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 16:16:43 EDT
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.