Library tweaks
PATCH 1/1 Library tweaks
This patch changes the library to:
1. Set the UID and EUID of the process when trying to switch to a non-root user.
2. Better handle the debug-printing inside the console
Signed-off-by Dan Smith <[email protected]>
tools/xm-test/lib/XmTestLib/Console.py +2 -2
@@ -167,6 +167,8 @@ if self.consoleFd in i: try: str = os.read(self.consoleFd, 1) + if self.debugMe: + sys.stdout.write(str) bytes += 1 except: raise ConsoleError("Failed to read from console (fd=%i)"
@@ -179,8 +181,6 @@ % self.limit) if str == "\n": - if self.debugMe: - print "%s\n" % line if lines > 0: output += line + "\n" if saveHistory:
tools/xm-test/lib/XmTestLib/Test.py +1 -1
@@ -125,7 +125,7 @@ allusers = pwd.getpwall() for u in allusers: if u[0] == "nobody": - os.seteuid(u[2]) + os.setreuid(u[2], u[2]) break if os.geteuid() == 0: FAIL("Could not become a non-root user")
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedQuoted 7 lines · Dan Smith
This patch changes the library to:
1. Set the UID and EUID of the process when trying to switch to a non-root user.
2. Better handle the debug-printing inside the consoleSigned-off-by Dan Smith <[email protected]>
Applied, thank you.
Ewan.