Bug 668278 - createrepo_command generate repodata own by root
Summary: createrepo_command generate repodata own by root
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 14
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-09 17:49 UTC by Remi Collet
Modified: 2013-01-10 06:24 UTC (History)
5 users (show)

Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-03 03:18:07 UTC


Attachments (Terms of Use)

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.


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