From: Andrew Thompson <andrewkt@aktzero.com>
To: xen-devel@lists.xensource.com
Subject: Re: [PATCH] provide real error message when trying to run xm as non root
Date: Tue, 26 Jul 2005 10:52:35 -0400 [thread overview]
Message-ID: <42E64E33.5030507@aktzero.com> (raw)
In-Reply-To: <20050726144156.GA22926@underhill.no-ip.org>
[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]
Sean Dague wrote:
> 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.
+1, Admirable. (non-binding/non-voter/non-commiter)
> Signed-off-by: Sean Dague <sean@dague.net>
>
> Diffstat output:
> main.py | 7 +++++++
> 1 files changed, 7 insertions(+)
>
> diff -r 48aed1403fe3 tools/python/xen/xm/main.py
> --- a/tools/python/xen/xm/main.py Fri Jul 22 16:44:33 2005
> +++ b/tools/python/xen/xm/main.py Tue Jul 26 10:31:24 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
Please allow me to show my possible ignorance...
Is there no better way to test for elevated privileges?
Would it be unreasonable to think xm maintenance tasks could be handed
off to members of a non-root group?
--
Andrew Thompson
http://aktzero.com/
[-- Attachment #2: andrewkt.vcf --]
[-- Type: text/x-vcard, Size: 153 bytes --]
begin:vcard
fn:Andrew Thompson
n:Thompson;Andrew
email;internet:andrewkt@aktzero.com
x-mozilla-html:FALSE
url:http://aktzero.com/
version:2.1
end:vcard
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2005-07-26 14:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 14:41 [PATCH] provide real error message when trying to run xm as non root Sean Dague
2005-07-26 14:52 ` Andrew Thompson [this message]
2005-07-26 15:09 ` Sean Dague
2005-07-26 15:35 ` aq
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42E64E33.5030507@aktzero.com \
--to=andrewkt@aktzero.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.