summaryrefslogtreecommitdiffstats
path: root/py/mock.py
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2007-12-07 17:24:51 -0600
committerMichael E Brown <michael_e_brown@dell.com>2007-12-07 17:24:51 -0600
commit6126530f48eb7253d7e592f20a8600ed4a0cccf5 (patch)
tree9d9989437d3ae6b8678a5ca4013f089f516b8f66 /py/mock.py
parent18a799d6c9196ec3dfa9b40f408ae1234a74bda2 (diff)
downloadmock-6126530f48eb7253d7e592f20a8600ed4a0cccf5.tar.gz
mock-6126530f48eb7253d7e592f20a8600ed4a0cccf5.tar.xz
mock-6126530f48eb7253d7e592f20a8600ed4a0cccf5.zip
add a few uid debugging calls, commented out by default, in case other people want to inspect UID status and environment.
Diffstat (limited to 'py/mock.py')
-rwxr-xr-xpy/mock.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/py/mock.py b/py/mock.py
index f6797b9..f4a9d80 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -346,6 +346,12 @@ def main(ret):
unprivUid = os.getuid()
unprivGid = os.getgid()
+ #DEBUG
+ #import mock.uid
+ #print("UID: %s %s" % (repr(mock.uid.getresuid()), repr(mock.uid.getresgid())))
+ #for k, v in os.environ.items():
+ # print " %s: %s" % (k, v)
+
# sudo
if os.environ.get("SUDO_UID") is not None:
unprivUid = int(os.environ['SUDO_UID'])
@@ -353,6 +359,7 @@ def main(ret):
groups = [ g[2] for g in grp.getgrall() if username in g[3]]
os.setgroups(groups)
unprivGid = int(os.environ['SUDO_GID'])
+ #print "SUDO_UID activated: %s %s" % (unprivUid, unprivGid)
# consolehelper
if os.environ.get("USERHELPER_UID") is not None:
@@ -361,6 +368,7 @@ def main(ret):
groups = [ g[2] for g in grp.getgrall() if username in g[3]]
os.setgroups(groups)
unprivGid = pwd.getpwuid(unprivUid)[3]
+ #print "USERHELPER_UID activated: %s %s" % (unprivUid, unprivGid)
uidManager = mock.uid.uidManager(unprivUid, unprivGid)
uidManager._becomeUser(unprivUid, unprivGid)