Bug 522505 - --unpriv only works with --chroot
--unpriv only works with --chroot
Status: CLOSED ERRATA
Product: Fedora EPEL
Classification: Fedora
Component: mock (Show other bugs)
el5
All Linux
low Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-10 10:50 EDT by Bill Nottingham
Modified: 2014-03-16 23:20 EDT (History)
4 users (show)

See Also:
Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-25 21:05:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill Nottingham 2009-09-10 10:50:18 EDT
Description of problem:

It would be *really really nice if it worked with --shell.

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

mock-0.9.14-1.el5.noarch

How reproducible:

100%
Comment 1 Bill Nottingham 2010-01-18 14:23:59 EST
Failing that, it would be nice if it threw an error, so it didn't make you *think* it works.
Comment 2 Clark Williams 2010-01-18 15:18:26 EST
I've queued up the following for mock-1.0.3-1:

diff --git a/py/mock.py b/py/mock.py
index 46ffbbb..f4794ac 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -574,7 +574,11 @@ def main(ret):
             chroot._setupDev()
             chroot._mountall()
             cmd = ' '.join(args)
-            status = os.system("PS1='mock-chroot> ' /usr/sbin/chroot %s %s" % (
+            if options.unpriv:
+                arg = '--userspec=%s:%s' % (chroot.chrootuid, chroot.chrootgid)
+            else:
+                arg = ''
+            status = os.system("PS1='mock-chroot> ' /usr/sbin/chroot %s %s %s" 
             ret['exitStatus'] = os.WEXITSTATUS(status)
 
         finally:

Tested with:

$ mock -r fedora-11-x86_64 --unpriv --shell
INFO: mock.py version 1.0.2 starting...
State Changed: init plugins
State Changed: start
State Changed: lock buildroot
mock-chroot> id
uid=101(mockbuild) gid=484(mockbuild) groups=71,484(mockbuild),485,495,496,497
mock-chroot>
Comment 3 Fedora Update System 2010-01-18 18:07:24 EST
mock-1.0.3-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.3-1.fc12
Comment 4 Fedora Update System 2010-01-18 18:08:09 EST
mock-1.0.3-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.3-1.el5
Comment 5 Fedora Update System 2010-01-18 18:08:47 EST
mock-1.0.3-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/mock-1.0.3-1.fc11
Comment 6 Fedora Update System 2010-01-19 14:42:17 EST
mock-1.0.3-1.fc12 has been pushed to the Fedora 12 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: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-0779
Comment 7 Fedora Update System 2010-01-19 14:45:00 EST
mock-1.0.3-1.fc11 has been pushed to the Fedora 11 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: http://admin.fedoraproject.org/updates/F11/FEDORA-2010-0792
Comment 8 Fedora Update System 2010-01-19 17:57:40 EST
mock-1.0.3-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: http://admin.fedoraproject.org/updates/EL-5/FEDORA-EPEL-2010-0089
Comment 9 Fedora Update System 2010-08-03 18:29:03 EDT
mock-1.0.10-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.10-1.el5
Comment 10 Fedora Update System 2010-08-03 18:30:08 EDT
mock-1.0.10-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.10-1.fc12
Comment 11 Fedora Update System 2010-08-04 19:04:39 EDT
mock-1.0.10-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: http://admin.fedoraproject.org/updates/mock-1.0.10-1.el5
Comment 12 Fedora Update System 2010-08-05 19:37:40 EDT
mock-1.0.10-1.fc12 has been pushed to the Fedora 12 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: http://admin.fedoraproject.org/updates/mock-1.0.10-1.fc12
Comment 13 Fedora Update System 2010-08-19 13:33:41 EDT
mock-1.0.11-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.11-1.fc12
Comment 14 Fedora Update System 2010-08-19 13:34:57 EDT
mock-1.0.11-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.11-1.el5
Comment 15 Fedora Update System 2010-08-19 18:00:56 EDT
mock-1.0.11-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: http://admin.fedoraproject.org/updates/mock-1.0.11-1.el5
Comment 16 Fedora Update System 2010-08-25 21:03:49 EDT
mock-1.0.11-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 17 Fedora Update System 2010-09-20 10:43:47 EDT
mock-1.0.12-1.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mock-1.0.12-1.fc12
Comment 18 Fedora Update System 2010-09-20 10:45:19 EDT
mock-1.0.12-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.12-1.el5
Comment 19 Fedora Update System 2010-10-20 11:45:41 EDT
mock-1.0.13-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.13-1.el5
Comment 20 Fedora Update System 2010-10-20 11:47:50 EDT
mock-1.0.13-1.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mock-1.0.13-1.fc12
Comment 21 Fedora Update System 2010-12-14 11:15:51 EST
mock-1.0.14-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.14-1.el5
Comment 22 Fedora Update System 2011-01-18 15:06:07 EST
mock-1.0.15-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5
Comment 23 Fedora Update System 2011-02-19 21:28:16 EST
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 24 Fedora Update System 2011-02-19 21:31:16 EST
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 25 Fedora Update System 2011-02-19 21:34:03 EST
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 26 Fedora Update System 2011-02-19 21:36:52 EST
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 27 Fedora Update System 2011-03-03 03:27:17 EST
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 28 Fedora Update System 2011-03-03 03:35:44 EST
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 29 Fedora Update System 2011-05-13 16:36:12 EDT
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 30 Fedora Update System 2011-05-13 16:40:25 EDT
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 31 Fedora Update System 2011-05-13 16:44:39 EDT
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 32 Fedora Update System 2011-05-13 16:48:57 EDT
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 33 Fedora Update System 2011-05-13 16:53:21 EDT
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 34 Fedora Update System 2011-05-19 00:37:35 EDT
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 35 Fedora Update System 2011-05-24 22:44:47 EDT
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 36 Fedora Update System 2011-05-24 23:18:56 EDT
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 37 Fedora Update System 2011-06-02 15:08:56 EDT
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 38 Fedora Update System 2011-06-02 15:18:46 EDT
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.