Bug 160627

Summary: rpm --root not working with sudo
Product: [Fedora] Fedora Reporter: Steven Shiau <steven>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: herrold, n3npq
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-27 02:07:47 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 Steven Shiau 2005-06-16 07:23:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-TW; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Description of problem:
When I run 
sudo rpm -Uvh --root /tftpboot/node_root ...
It fails.
However, if I su as root, then run
rpm -Uvh --root /tftpboot/node_root
It works.

Version-Release number of selected component (if applicable):
rpm-4.4.1-21, sudo-1.6.8p8-1

How reproducible:
Always

Steps to Reproduce:
1. as root
2. mkdir -p /tftpboot/node_root/var/lib/rpm/
3. rsync -a /var/lib/rpm/* /tftpboot/node_root/var/lib/rpm/
4. sudo rpm -Uvh -v -v -v -v -v --root /tftpboot/node_root/ --force --nodeps --noscripts http://free.nchc.org.tw//fedora/linux/core/4/i386/os/Fedora/RPMS/kernel-2.6.11-1.1369_FC4.i586.rpm

  

Actual Results:  The resulet is
---
Retrieving http://free.nchc.org.tw//fedora/linux/core/4/i386/os/Fedora/RPMS/kernel-2.6.11-1.1369_FC4.i586.rpm
error: skipping http://free.nchc.org.tw//fedora/linux/core/4/i386/os/Fedora/RPMS/kernel-2.6.11-1.1369_FC4.i586.rpm - transfer failed - Unknown or unexpected error



Expected Results:  Install the kernel-2.6.11-1.1369_FC4.i586.rpm in /tftpboot/node_root successfully with sudo.


Additional info:

By adding more "-v", i.e.
sudo rpm -Uvh -v -v -v -v -v --root /tftpboot/node_root/ --force --nodeps --noscripts http://free.nchc.org.tw//fedora/linux/core/4/i386/os/Fedora/RPMS/kernel-2.6.11-1.1369_FC4.i586.rpm

The results show
---
Retrieving http://free.nchc.org.tw//fedora/linux/core/4/i386/os/Fedora/RPMS/kernel-2.6.11-1.1369_FC4.i586.rpm
D:  ... as /tftpboot/node_root/home/steven/rpmbuild/tmp/rpm-xfer.5dIm3z
D: failed to create /tftpboot/node_root/home/steven/rpmbuild/tmp/rpm-xfer.5dIm3z: No such file or directory
error: skipping http://free.nchc.org.tw//fedora/linux/core/4/i386/os/Fedora/RPMS/kernel-2.6.11-1.1369_FC4.i586.rpm - transfer failed - Unknown or unexpected error
D: May free Score board((nil))
---
So I think rpm should can use another temp directory if it can not find the one it want.

Comment 1 Paul Nasrat 2005-06-20 12:34:49 UTC
*** Bug 160628 has been marked as a duplicate of this bug. ***

Comment 2 Jeff Johnson 2005-08-27 02:07:47 UTC
You appear to have %_tmppath configured to /home/steven/rpmbuild/tmp/.

rpm is doing exactly what you specified, using "another temp directory" is not the right solution.

Either configure some other path or insure that the directory exists within the chroot path.