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

[Xen-changelog] This patch prevents you from getting a screen full of stack trace when



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 9b436c6bf2bd6fdce9333cb386a8fb7ebd38881a
# Parent  6c24d2b4f3eaf85e64879b03f159a2edce4e3719
This patch prevents you from getting a screen full of stack trace when
trying to run commands like xm list as a normal user, and instead provides a
helpful error message.

Signed-off-by: Sean Dague <sean@xxxxxxxxx>

diff -r 6c24d2b4f3ea -r 9b436c6bf2bd tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Jul 26 15:16:12 2005
+++ b/tools/python/xen/xm/main.py       Tue Jul 26 15:16:39 2005
@@ -11,6 +11,13 @@
 
 from xen.xend import PrettyPrint
 from xen.xend import sxp
+# this is a nasty place to stick this in, but required because
+# log file access is set up via a 5 deep import chain.  This
+# ensures the user sees a useful message instead of a stack trace
+if os.getuid() != 0:
+    print "xm requires root access to execute, please try again as root"
+    sys.exit(1)
+
 from xen.xend.XendClient import XendError, server
 from xen.xend.XendClient import main as xend_client_main
 from xen.xm import create, destroy, migrate, shutdown, sysrq

_______________________________________________
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®.