]> git.proxmox.com Git - pve-access-control.git/blobdiff - pveum
non-root buildfix
[pve-access-control.git] / pveum
diff --git a/pveum b/pveum
index 55ad1f4f67124f623fd2034f929e286f7f5d37e2..a80b4defb9ec83be530b96f7830cf379e47f77ba 100755 (executable)
--- a/pveum
+++ b/pveum
@@ -29,19 +29,6 @@ initlog('pveum');
 
 #fixme: logging?
 
-die "please run as root\n" if $> != 0;
-
-PVE::INotify::inotify_init();
-
-my $rpcenv = PVE::RPCEnvironment->init('cli');
-
-$rpcenv->init_request();
-$rpcenv->set_language($ENV{LANG});
-$rpcenv->set_user('root@pam'); 
-
-# autmatically generate the private key if it does not already exists
-PVE::Cluster::gen_auth_key();
-
 my $read_password = sub {
 
     # return $ENV{PVE_PW_TICKET} if defined($ENV{PVE_PW_TICKET});
@@ -82,6 +69,21 @@ my $cmddef = {
 
 my $cmd = shift;
 
+if ($cmd ne 'verifyapi' && $cmd ne 'printmanpod') {
+    die "please run as root\n" if $> != 0;
+
+    PVE::INotify::inotify_init();
+
+    my $rpcenv = PVE::RPCEnvironment->init('cli');
+
+    $rpcenv->init_request();
+    $rpcenv->set_language($ENV{LANG});
+    $rpcenv->set_user('root@pam'); 
+
+# autmatically generate the private key if it does not already exists
+    PVE::Cluster::gen_auth_key();
+}
+
 PVE::CLIHandler::handle_cmd($cmddef, "pveum", $cmd, \@ARGV, $read_password, $0);
 
 exit 0;