Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 668278

Summary: createrepo_command generate repodata own by root
Product: [Fedora] Fedora Reporter: Remi Collet <fedora>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: dcantrell, fedora, mebrown, unlinkat, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.1.10-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-03 03:18:07 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 Remi Collet 2011-01-09 17:49:57 UTC
Description of problem:
With configuration:
config_opts['createrepo_on_rpms'] = True
config_opts['createrepo_command'] = '/usr/bin/createrepo -d -q -x *.src.rpm'

All files in "resultdir" are own by the "builder" (log and rpm), except the "repodata" directory.

This is quite annoying, as the "builder" can't clean the folder and regenerate the repodata.

Version-Release number of selected component (if applicable):
mock-1.1.7-1.fc14 (noarch)

How reproducible:
Always

Steps to Reproduce:
1. mock some.src.rpm
  
Actual results:
$ ls -al repodata
total 248
drwxr-sr-x. 2 root   mock  4096  9 janv. 18:47 .
drwxrwsr-x. 3 extras mock  4096  9 janv. 18:47 ..
-rw-r--r--. 1 root   mock 65354  9 janv. 18:47 filelists.sqlite.bz2
-rw-r--r--. 1 root   mock 61448  9 janv. 18:47 filelists.xml.gz
-rw-r--r--. 1 root   mock 10788  9 janv. 18:47 other.sqlite.bz2
-rw-r--r--. 1 root   mock  4059  9 janv. 18:47 other.xml.gz
-rw-r--r--. 1 root   mock 33731  9 janv. 18:47 primary.sqlite.bz2
-rw-r--r--. 1 root   mock 12233  9 janv. 18:47 primary.xml.gz
-rw-r--r--. 1 root   mock  2703  9 janv. 18:47 repomd.xml


Expected results:
$ ls -al repodata
total 248
drwxr-sr-x. 2 extras mock  4096  9 janv. 18:47 .
drwxrwsr-x. 3 extras mock  4096  9 janv. 18:47 ..
-rw-r--r--. 1 extras mock 65354  9 janv. 18:47 filelists.sqlite.bz2
-rw-r--r--. 1 extras mock 61448  9 janv. 18:47 filelists.xml.gz
-rw-r--r--. 1 extras mock 10788  9 janv. 18:47 other.sqlite.bz2
-rw-r--r--. 1 extras mock  4059  9 janv. 18:47 other.xml.gz
-rw-r--r--. 1 extras mock 33731  9 janv. 18:47 primary.sqlite.bz2
-rw-r--r--. 1 extras mock 12233  9 janv. 18:47 primary.xml.gz
-rw-r--r--. 1 extras mock  2703  9 janv. 18:47 repomd.xml

Comment 1 Clark Williams 2011-01-21 19:29:10 UTC
Remi,

See if this fixes your problem:

diff --git a/py/mock.py b/py/mock.py
index cbecc8b..cc7c353 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -477,9 +477,11 @@ def do_rebuild(config_opts, chroot, srpms):
             
         if config_opts["createrepo_on_rpms"]:
             log.info("Running createrepo on binary rpms in resultdir")
+            chroot.uidManager.dropPrivsTemp()
             cmd = config_opts["createrepo_command"].split()
             cmd.append(chroot.resultdir)
             mock.util.do(cmd)
+            chroot.uidManager.restorePrivs()
             
     except (Exception, KeyboardInterrupt):
         elapsed = time.time() - start

Comment 2 Remi Collet 2011-01-22 08:05:58 UTC
Patch tested against mock-1.1.8-1.fc14.noarch

Works as expected.
Thanks

Comment 3 Fedora Update System 2011-02-20 02:25:23 UTC
mock-1.1.9-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc13

Comment 4 Fedora Update System 2011-02-20 02:28:37 UTC
mock-1.0.16-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5

Comment 5 Fedora Update System 2011-02-20 02:31:33 UTC
mock-1.1.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.el6

Comment 6 Fedora Update System 2011-02-20 02:34:24 UTC
mock-1.1.9-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc14

Comment 7 Fedora Update System 2011-02-20 05:54:33 UTC
mock-1.0.16-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5

Comment 8 Fedora Update System 2011-02-20 22:49:53 UTC
mock-1.1.9-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc15

Comment 9 Fedora Update System 2011-03-03 03:17:20 UTC
mock-1.1.9-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2011-03-03 08:23:52 UTC
mock-1.1.9-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2011-03-03 08:32:55 UTC
mock-1.1.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2011-05-13 20:33:03 UTC
mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15

Comment 13 Fedora Update System 2011-05-13 20:37:58 UTC
mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14

Comment 14 Fedora Update System 2011-05-13 20:42:14 UTC
mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5

Comment 15 Fedora Update System 2011-05-13 20:46:29 UTC
mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13

Comment 16 Fedora Update System 2011-05-13 20:50:46 UTC
mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6

Comment 17 Fedora Update System 2011-05-19 04:34:32 UTC
mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2011-05-25 02:41:52 UTC
mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2011-05-25 03:16:16 UTC
mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2011-06-02 19:06:03 UTC
mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Fedora Update System 2011-06-02 19:16:07 UTC
mock-1.1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.