From: Dan Smith Subject: [PATCH][XM-TEST] Library tweaks Date: Mon, 07 Nov 2005 11:12:53 -0800 Message-ID: <87r79snufe.fsf@theine.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=lib.patch 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@us.ibm.com --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-=-=--