[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] 1. Set the UID and EUID of the process when trying to switch to a



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID f79854882e1f8c29b04c92e96ea9d65b1b8b9473
# Parent  40f3ce3516cb675103de21b22c75af7e34668a63
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 <danms@xxxxxxxxxx>

diff -r 40f3ce3516cb -r f79854882e1f tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py    Tue Nov  8 10:56:55 2005
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Tue Nov  8 11:00:23 2005
@@ -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:
diff -r 40f3ce3516cb -r f79854882e1f tools/xm-test/lib/XmTestLib/Test.py
--- a/tools/xm-test/lib/XmTestLib/Test.py       Tue Nov  8 10:56:55 2005
+++ b/tools/xm-test/lib/XmTestLib/Test.py       Tue Nov  8 11:00:23 2005
@@ -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")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.