]> git.proxmox.com Git - pmg-api.git/commitdiff
vncshell: run /bin/login instead of top
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 10 Mar 2017 06:07:19 +0000 (07:07 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 10 Mar 2017 06:07:19 +0000 (07:07 +0100)
PMG/API2/Nodes.pm

index 953f394908844f083cedf9c19cfdae37b9a86069..41d6f2dadf25e8a93c7eedf9ab40afd8f20416b6 100644 (file)
@@ -184,9 +184,17 @@ __PACKAGE__->register_method ({
        my $family = PVE::Tools::get_host_address_family($node);
        my $port = PVE::Tools::next_vnc_port($family);
 
+       my $shcmd;
+
+       if ($user eq 'root@pam') {
+           $shcmd = [ '/bin/login', '-f', 'root' ];
+       } else {
+           $shcmd = [ '/bin/login' ];
+       }
+
        my $cmd = ['/usr/bin/vncterm', '-rfbport', $port,
                   '-timeout', 10, '-notls', '-listen', 'localhost',
-                  '-c', '/usr/bin/top'];
+                  '-c', @$shcmd];
 
        my $realcmd = sub {
            my $upid = shift;