summaryrefslogtreecommitdiffstats
path: root/py/mock.py
diff options
context:
space:
mode:
Diffstat (limited to 'py/mock.py')
-rwxr-xr-xpy/mock.py6
1 files changed, 5 insertions, 1 deletions
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" % (chroot.makeChrootPath(), cmd))
+ 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" % (arg, chroot.makeChrootPath(), cmd))
ret['exitStatus'] = os.WEXITSTATUS(status)
finally: