Skip to contentSkip to conversation

Library tweaks

PATCH Applied Dan Smith 2 participants 2 messages Nov 7, 2005 – Nov 8, 2005

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

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

tools/xm-test/lib/XmTestLib/Console.py +2 -2
diff -r a05e55c919c1 tools/xm-test/lib/XmTestLib/Console.py
@@ -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
diff -r a05e55c919c1 tools/xm-test/lib/XmTestLib/Test.py
@@ -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

Applied
#1 lore raw
Quoted 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 console

Applied, thank you.

Ewan.