Am 13.09.21 um 14:04 schrieb Fabian Ebner:
so that proxmox-ve's apt hook script can detect this.

Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---
  PVE/API2/Nodes.pm | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index e58d9c10..c57ad995 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -843,13 +843,13 @@ my $sslcert;
my $shell_cmd_map = {
      'login' => {
-       cmd => [ '/bin/login', '-f', 'root' ],
+       cmd => [ '/bin/login', '-f', 'root', 'PVE_API_SHELL=1' ],
      },
      'upgrade' => {
-       cmd => [ '/usr/bin/pveupgrade', '--shell' ],
+       cmd => [ '/usr/bin/env', 'PVE_API_SHELL=1', '/usr/bin/pveupgrade', 
'--shell' ],
      },
      'ceph_install' => {
-       cmd => [ '/usr/bin/pveceph', 'install' ],
+       cmd => [ '/usr/bin/env', 'PVE_API_SHELL=1', '/usr/bin/pveceph', 
'install' ],
        allow_args => 1,
      },
  };
@@ -866,11 +866,11 @@ sub get_shell_command  {
                push @$cmd, split("\0", $args);
            }
        } else {
-           $cmd = [ '/bin/login', '-f', 'root' ];
+           $cmd = [ '/bin/login', '-f', 'root', 'PVE_API_SHELL=1' ];
        }
      } else {
        # non-root must always login for now, we do not have a superuser role!
-       $cmd = [ '/bin/login' ];
+       $cmd = [ '/bin/login', 'PVE_API_SHELL=1' ];

Sorry, I think the PVE_API_SHELL=1 gets interpreted as the username in this case. I'll fix that in v2 if we even go with this approach.

      }
      return $cmd;
  }



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to