diff options
author | Michael E Brown <michael_e_brown@dell.com> | 2007-12-07 17:24:51 -0600 |
---|---|---|
committer | Michael E Brown <michael_e_brown@dell.com> | 2007-12-07 17:24:51 -0600 |
commit | 6126530f48eb7253d7e592f20a8600ed4a0cccf5 (patch) | |
tree | 9d9989437d3ae6b8678a5ca4013f089f516b8f66 /py/mock.py | |
parent | 18a799d6c9196ec3dfa9b40f408ae1234a74bda2 (diff) | |
download | mock-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-x | py/mock.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) |