Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _virsh (Was: Re: zsh virsh completion)
- X-seq: zsh-workers 38905
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Marko Myllynen <myllynen@xxxxxxxxxx>
- Subject: Re: [PATCH] _virsh (Was: Re: zsh virsh completion)
- Date: Thu, 21 Jul 2016 18:12:49 +0200
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1469117573; bh=0fKf+6bDCFMb8KC4BHlqMFJaszlEMFjmuYDCfUrtWwc=; h=cc:In-reply-to:From:References:To:Subject:Date:From:Subject; b=ebEw1FaRZ7fVAeidQPt+fPFCUJhHdN3Qf2juSDegndObfsyMiG2AGTI/uWdntpSQmIuO/+5I4qobhRep8lB6wG3JLdvBi0Wzpq8ziD4YZyaXwolIlasmJFPUaVOkp5NYZiDFx9OqAJVdUC7MnfI/V8uvQmuGAn/L6dYn8zVGdCLzo/LFnRQU7KCD/6uLxIQUWVeT7d32J0vcpPmanDloNj5lEC7DfrdREg8AICm0oNL65fMFltQdEmzH+2txRmoRJKQyvGhp/1e9IjzcKZi9ctpuav4CNRC+sGrNqYps48RNM+ASApahSioQZmIX++ts3irahSYLOY2V6SdjDX3B7A==
- In-reply-to: <699166a0-b0f0-452c-2561-b7e3cc952062@redhat.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <8eb6dce0-50d7-5ab2-503a-194c1de2e45d@redhat.com> <20160713045957.GA3893@tarsus.local2> <9968da53-c1fd-fa2a-f30c-c74f884d2478@redhat.com> <20160720065832.GA28939@tarsus.local2> <699166a0-b0f0-452c-2561-b7e3cc952062@redhat.com>
Marko Myllynen wrote:
> + _values servers ${=${(S)${${(f)$(sudo virt-admin srv-list)}##*--- }//[0-9]* }} && return 0
> + _values servers ${=${${(f):-"$(sudo virt-admin srv-clients-list --server $srv)"}/ [a-z]*}//[^0-9]} && return 0
I have pushed the change but I've just noticed these two lines. I'm not
sure it is a good idea to be running sudo within completion functions.
That can trigger logging and is often denied when you're already root.
And there may be alternatives like doas.
There's also another instance of this in Mandriva/Command/_rebootin.
Anyone, have any thoughts on how this should be handled? I'm inclined
to think that users should have to specifically set a gain-root
style to enable this. Or perhaps it could only trigger if you
complete after sudo virt-admin.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author