Subject: Re: [PATCH] _virsh (Was: Re: zsh virsh completion)
From: Marko Myllynen <[email-masked]>
To: Oliver Kiddle <[email-masked]>
Cc: [email-masked]
Date: Thu, 21 Jul 2016 19:19:35 +0300
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Hi,

On 2016-07-21 19:12, Oliver Kiddle wrote:
> 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.

FWIW, I doublechecked the situation off-list with the virt-admin author
and currently there are no plans to allow non-root/non-sudo users to use
virt-admin (unlike with, e.g., virsh where it is already easy to
configure to allow full access for non-root users).

Thanks,

-- 
Marko Myllynen