From: Wolfgang Bumiller Date: Wed, 27 May 2015 07:30:54 +0000 (+0200) Subject: non-root buildfix X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=commitdiff_plain;h=a8a4cd644524260e314ef7906aaf3c0fb1143152 non-root buildfix --- 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@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;