From: Thomas Lamprecht Date: Thu, 23 May 2019 10:52:18 +0000 (+0200) Subject: assemble_spice_ticket: ensure variable in interpolated string are correct X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=ffbc3c08b8522f36beebdce3c0c3fba0bab743f1 assemble_spice_ticket: ensure variable in interpolated string are correct In older perl the following two where the same: "$foo::$bar" == "${foo}::${bar}" But in perl 5, version 28 it's not anymore, "$foo::$bar" would be equivalent to "${foo::}${bar}", the double colons are now not used as variable name boundary, so mark that explicitly in the affected case and surrounding ones preventively This fixes authentication with spice* related stuff again. Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/Ticket.pm b/src/PVE/Ticket.pm index e9f8e3f..5935ba5 100644 --- a/src/PVE/Ticket.pm +++ b/src/PVE/Ticket.pm @@ -125,14 +125,14 @@ sub assemble_spice_ticket { # Note: data needs to be lower case only, because virt-viewer needs that # Note: RSA signature are too long (>=256 charaters) and make problems with remote-viewer - my $plain = "pvespiceproxy:$timestamp:$vmid:" . lc($node); + my $plain = "pvespiceproxy:${timestamp}:${vmid}:" . lc($node); # produces 40 characters my $sig = unpack("H*", Digest::SHA::sha1($plain, $secret)); #my $sig = unpack("H*", $rsa_priv->sign($plain)); # this produce too long strings (512) - my $proxyticket = "$plain::$sig"; + my $proxyticket = "${plain}::${sig}"; return ($ticket, $proxyticket); }