|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH][XM-TEST] 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 <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>
|
- [Xen-devel] [PATCH][XM-TEST] Library tweaks,
Dan Smith <=
|
|
|
|
|