ia64/xen-unstable

changeset 7686:f79854882e1f

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@us.ibm.com>
author emellor@leeni.uk.xensource.com
date Tue Nov 08 12:00:23 2005 +0100 (2005-11-08)
parents 40f3ce3516cb
children dfbdf1d264ef
files tools/xm-test/lib/XmTestLib/Console.py tools/xm-test/lib/XmTestLib/Test.py
line diff
     1.1 --- a/tools/xm-test/lib/XmTestLib/Console.py	Tue Nov 08 11:56:55 2005 +0100
     1.2 +++ b/tools/xm-test/lib/XmTestLib/Console.py	Tue Nov 08 12:00:23 2005 +0100
     1.3 @@ -167,6 +167,8 @@ class XmConsole:
     1.4              if self.consoleFd in i:
     1.5                  try:
     1.6                      str = os.read(self.consoleFd, 1)
     1.7 +                    if self.debugMe:
     1.8 +                        sys.stdout.write(str)
     1.9                      bytes += 1
    1.10                  except:
    1.11                      raise ConsoleError("Failed to read from console (fd=%i)"
    1.12 @@ -179,8 +181,6 @@ class XmConsole:
    1.13                                     % self.limit)
    1.14  
    1.15              if str == "\n":
    1.16 -                if self.debugMe:
    1.17 -                    print "%s\n" % line
    1.18                  if lines > 0:
    1.19                      output += line + "\n"
    1.20                      if saveHistory:
     2.1 --- a/tools/xm-test/lib/XmTestLib/Test.py	Tue Nov 08 11:56:55 2005 +0100
     2.2 +++ b/tools/xm-test/lib/XmTestLib/Test.py	Tue Nov 08 12:00:23 2005 +0100
     2.3 @@ -125,7 +125,7 @@ def becomeNonRoot():
     2.4          allusers = pwd.getpwall()
     2.5          for u in allusers:
     2.6              if u[0] == "nobody":
     2.7 -                os.seteuid(u[2])
     2.8 +                os.setreuid(u[2], u[2])
     2.9                  break
    2.10          if os.geteuid() == 0:
    2.11              FAIL("Could not become a non-root user")