mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-03 05:16:26 +00:00
use new assemble_vnc_ticket
This commit is contained in:
parent
5e4e479896
commit
57ebda0841
@ -523,10 +523,12 @@ __PACKAGE__->register_method ({
|
||||
|
||||
my $user = $rpcenv->get_user();
|
||||
|
||||
my $ticket = PVE::AccessControl::assemble_ticket($user);
|
||||
|
||||
my $node = $param->{node};
|
||||
|
||||
my $authpath = "/nodes/$node";
|
||||
|
||||
my $ticket = PVE::AccessControl::assemble_vnc_ticket($user, $authpath);
|
||||
|
||||
$sslcert = PVE::Tools::file_get_contents("/etc/pve/pve-root-ca.pem", 8192)
|
||||
if !$sslcert;
|
||||
|
||||
@ -547,10 +549,8 @@ __PACKAGE__->register_method ({
|
||||
|
||||
my $timeout = 10;
|
||||
|
||||
# fixme: do we want to require special auth permissions?
|
||||
# example "-perm Shell"
|
||||
my @cmd = ('/usr/bin/vncterm', '-rfbport', $port,
|
||||
'-timeout', $timeout, '-authpath', "/nodes/$node",
|
||||
'-timeout', $timeout, '-authpath', $authpath,
|
||||
'-perm', 'Sys.Console', '-c', @$remcmd, @$shcmd);
|
||||
|
||||
my $realcmd = sub {
|
||||
|
@ -741,11 +741,14 @@ __PACKAGE__->register_method ({
|
||||
my $rpcenv = PVE::RPCEnvironment::get();
|
||||
|
||||
my $user = $rpcenv->get_user();
|
||||
my $ticket = PVE::AccessControl::assemble_ticket($user);
|
||||
|
||||
my $vmid = $param->{vmid};
|
||||
my $node = $param->{node};
|
||||
|
||||
my $authpath = "/vms/$vmid";
|
||||
|
||||
my $ticket = PVE::AccessControl::assemble_vnc_ticket($user, $authpath);
|
||||
|
||||
$sslcert = PVE::Tools::file_get_contents("/etc/pve/pve-root-ca.pem", 8192)
|
||||
if !$sslcert;
|
||||
|
||||
@ -772,7 +775,7 @@ __PACKAGE__->register_method ({
|
||||
my $timeout = 10;
|
||||
|
||||
my $cmd = ['/usr/bin/vncterm', '-rfbport', $port,
|
||||
'-timeout', $timeout, '-authpath', "/vms/$vmid",
|
||||
'-timeout', $timeout, '-authpath', $authpath,
|
||||
'-perm', 'VM.Console', '-c', @$remcmd, @$shcmd];
|
||||
|
||||
run_command($cmd);
|
||||
|
Loading…
Reference in New Issue
Block a user