WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][XM-TEST] Library tweaks

To: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][XM-TEST] Library tweaks
From: Dan Smith <danms@xxxxxxxxxx>
Date: Mon, 07 Nov 2005 11:12:53 -0800
Delivery-date: Mon, 07 Nov 2005 19:13:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)
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 <danms@xxxxxxxxxx>
diff -r a05e55c919c1 tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py    Mon Nov  7 14:06:27 2005
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Mon Nov  7 10:14:44 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 a05e55c919c1 tools/xm-test/lib/XmTestLib/Test.py
--- a/tools/xm-test/lib/XmTestLib/Test.py       Mon Nov  7 14:06:27 2005
+++ b/tools/xm-test/lib/XmTestLib/Test.py       Mon Nov  7 10:14:44 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")
-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@xxxxxxxxxx
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>