diff options
author | Clark Williams <williams@redhat.com> | 2009-07-08 14:36:44 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2009-07-08 14:36:44 -0500 |
commit | cbe5e0fb94228bca7d1686160f3f43d77780ea95 (patch) | |
tree | 9a860a49e52f4d209bdf979406953bf4fc485fb8 /py/mock/backend.py | |
parent | dd53959146bc22d497c82ec416540af5c8427ec4 (diff) | |
download | mock-cbe5e0fb94228bca7d1686160f3f43d77780ea95.tar.gz mock-cbe5e0fb94228bca7d1686160f3f43d77780ea95.tar.xz mock-cbe5e0fb94228bca7d1686160f3f43d77780ea95.zip |
reworked /dev/pts mount command to lookup 'tty' group id and
to use the 'newinstance' mount option if the kernel version
is >= 2.6.29
Signed-off-by: Clark Williams <williams@redhat.com>
Diffstat (limited to 'py/mock/backend.py')
-rw-r--r-- | py/mock/backend.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py index a453012..04e1b1a 100644 --- a/py/mock/backend.py +++ b/py/mock/backend.py @@ -14,6 +14,7 @@ import os import shutil import stat import uuid +import grp # our imports import mock.util @@ -328,8 +329,12 @@ class Root(object): if devUnmtCmd not in self.umountCmds: self.umountCmds.append(devUnmtCmd) + mountopt = 'gid=%d,mode=620' % grp.getgrnam('tty').gr_gid + if os.uname()[2] >= '2.6.29': + mountopt +== ',newinstance' + for devMntCmd in ( - 'mount -n -t devpts -o gid=5,mode=620 mock_chroot_devpts %s' % self.makeChrootPath('/dev/pts'), + 'mount -n -t devpts -o %s mock_chroot_devpts %s' % (mountopt, self.makeChrootPath('/dev/pts')), 'mount -n -t tmpfs mock_chroot_shmfs %s' % self.makeChrootPath('/dev/shm') ): if devMntCmd not in self.mountCmds: self.mountCmds.append(devMntCmd) |