Bug 185598 - Won't build as non-root user
Summary: Won't build as non-root user
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dhcpv6
Version: 4.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Jason Vas Dias
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-16 00:57 UTC by John Morris
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-16 22:27:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Small .spec patch to make configure writable (262 bytes, patch)
2006-03-16 00:57 UTC, John Morris
no flags Details | Diff

Description John Morris 2006-03-16 00:57:03 UTC
Created attachment 126185 [details]
Small .spec patch to make configure writable

Comment 1 John Morris 2006-03-16 00:57:03 UTC
Description of problem:

Attempts to build as a non-root user fail with a permissions error.

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

dhcpv6-0.10-14_EL4

How reproducible:

Always

Steps to Reproduce:
1. rpmbuild --rebuild dhcpv6-0.10-14_EL4.src.rpm
  
Actual results:

+ export 'LDFLAGS=-pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack'
+ LDFLAGS='-pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack'
+ autoconf
autom4te: cannot open configure: Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.502 (%build)
 
 
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.502 (%build)

configure needs to be writable, fixable from within the .spec with patch below

Comment 2 Jason Vas Dias 2006-03-16 22:27:38 UTC
Hmm, very strange - this does not happen for me - how were you building dhcpv6 ?

If you had used rpmbuild to build the package, then rpmbuild would do:
  + /bin/chmod -Rf a+rX,u+w,g-w,o-w .

But if you are rebuilding as a non-root user, rpmbuild would need to be told
to install things in different directories - 
/usr/src/redhat/{SOURCES,BUILD,RPMS,SRPMS,SPECS}
where rpmbuild installs files and does builds is typically not writable by
non-root users by default.

I tested this as a non-root user, and did:
$ mkdir /tmp/dhcpv6-test
$ cd /tmp/dhcpv6-test
$ rpm -ivh --define '_sourcedir /tmp/dhcpv6-test' \
           --define '_specdir /tmp/dhcpv6-test' \
           /tmp/dhcpv6-0.10-14_EL4.src.rpm
$ rpmbuild --define '_sourcedir /tmp/dhcpv6-test' \
           --define '_specdir /tmp/dhcpv6-test' \
           --define '_builddir /tmp/dhcpv6-test' \
           --define '_srcrpmdir /tmp/dhcpv6-test' \
           --define '_rpmdir /tmp/dhcpv6-test' \
           -ba dhcpv6.spec
This worked fine. I also tried:
$ rpmbuild --rebuild \
           --define '_sourcedir /tmp/dhcpv6-test' \
           --define '_specdir /tmp/dhcpv6-test' \
           --define '_builddir /tmp/dhcpv6-test' \
           --define '_srcrpmdir /tmp/dhcpv6-test' \
           --define '_rpmdir /tmp/dhcpv6-test' \
           /tmp/dhcpv6-0.10-14_EL4.src.rpm
This also worked fine.

rpmbuild should be changing all permissions correctly:
$ rpm --showrc | grep fixperms
-14: _fixperms  %{__chmod} -Rf a+rX,u+w,g-w,o-w

Did you not use rpmbuild to build the RPM ? If not, then do:
  # chmod -Rf a+rX,u+w,g-w,o-w .
before building in the current directory.

We can only ensure that all our packages build OK as a 
non-root user if built by rpmbuild - we cannot implement support
for every conceivable method of rebuilding a package without rpmbuild, 
or for building into /usr/src/redhat/* as a non-root userid if those
directories are not modifiable by a non-root user.


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