diff options
author | Clark Williams <williams@redhat.com> | 2010-01-18 14:03:18 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2010-01-18 14:03:18 -0600 |
commit | c1168d3fee69207c71201270ce3dac734ceb23a2 (patch) | |
tree | 66f434efc7c7870462c230da6049789acbacdc1c | |
parent | a0dde91ac38d1fa2d050668e09bb0b9c46e3df77 (diff) | |
download | mock-c1168d3fee69207c71201270ce3dac734ceb23a2.tar.gz mock-c1168d3fee69207c71201270ce3dac734ceb23a2.tar.xz mock-c1168d3fee69207c71201270ce3dac734ceb23a2.zip |
add --unpriv logic to --shell
Add logic to run with unprivleged uid:gid in interactive
chroot shell. (BZ# 522505)
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | mock.spec.in | 4 | ||||
-rwxr-xr-x | py/mock.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mock.spec.in b/mock.spec.in index 2e31dac..8b91b40 100644 --- a/mock.spec.in +++ b/mock.spec.in @@ -97,11 +97,15 @@ fi %attr(02775, root, mock) %dir /var/cache/mock %changelog +* Mon Jan 18 2010 Clark Williams <williams@redhat.com>- 1.0.3-1 +- add logic for handling --unpriv with --shell (BZ# 522505) + * Wed Dec 23 2009 Clark Williams <williams@redhat.com>- 1.0.2-1 - added IPv6 localhost entry for default /etc/hosts (BZ# 545435) - removed output of gethostname() in IPv4 localhost entry as this caused koji problems and cause 'localhost' to be put into generated rpms, rather than the output of hostname +- add code to setup /dev/pts differently on EL* than on FC* hosts * Wed Nov 25 2009 Clark Williams <williams@redhat.com>- 1.0.1-1 - Patch from Paul Howarth to fix intermittent problems generating @@ -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: |