[pve-devel] [PATCH 1/2] non-root buildfix

Wolfgang Bumiller w.bumiller at proxmox.com
Wed May 27 09:30:54 CEST 2015


---
 pveum | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/pveum b/pveum
index 55ad1f4..a80b4de 100755
--- 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 at 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 at 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;
-- 
2.1.4





More information about the pve-devel mailing list