Fix bash-completion output to stderr when not root
When trying vzctl's bash completion with an unprivileged user, the
completion outputs "This program can only be run under root." to
stderr.
As a result, the command line becomes unusable: the user must hit ^C
to re-enter the line making sure not to use <TAB>.
-------------8<--------------8<--------------
bosta:~$ sudo vzctl stop This program can only be run under root.
This program can only be run under root.
^C
bosta:~$ sudo vzctl create This program can only be run under root.
101 ^C
bosta:~$ sudo vzctl set 101 --ipdel This program can only be run under root.
all ^C
--------------8<--------------8<--------------
This output comes from the call of vzlist(8) in /etc/bash_completion.d/vzctl.sh.
While vzctl(8) should only be run as root, it should not offer a
"false completion".
http://bugzilla.openvz.org/show_bug.cgi?id=1388
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560303
Signed-off-by: Ignace Mouzannar <mouzannar@gmail.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed