qm: assume correct VNC setup in 'vncproxy', disallow passwordless

The QMP 'change' command is no longer available since QEMU 6.0, so this
cannot work - instead of replacing it, we can just remove it however.

The 'if' branch would only set the VNC socket path anew and enable
password mode, which is always set and enabled on startup already.
The 'else' branch was intended for certificate login (?), which
according to the FIXME comment is long gone anyway - simply forbid
'vncproxy' without the PVE ticket environment variable set.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2021-05-27 12:27:51 +02:00 committed by Thomas Lamprecht
parent 378ad769dd
commit 2dc0eb61e8

View File

@ -217,12 +217,10 @@ __PACKAGE__->register_method ({
my $vnc_socket = PVE::QemuServer::Helpers::vnc_socket($vmid);
if (my $ticket = $ENV{LC_PVE_TICKET}) { # NOTE: ssh on debian only pass LC_* variables
mon_cmd($vmid, "change", device => 'vnc', target => "unix:$vnc_socket,password");
mon_cmd($vmid, "set_password", protocol => 'vnc', password => $ticket);
mon_cmd($vmid, "expire_password", protocol => 'vnc', time => "+30");
} else {
# FIXME: remove or allow to add tls-creds object, as x509 vnc param is removed with qemu 4??
mon_cmd($vmid, "change", device => 'vnc', target => "unix:$vnc_socket,password");
die "LC_PVE_TICKET not set, VNC proxy without password is forbidden\n";
}
run_vnc_proxy($vnc_socket);