[pve-devel] r5046 - pve-access-control/trunk

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Aug 24 13:13:47 CEST 2010


Author: dietmar
Date: 2010-08-24 11:13:47 +0000 (Tue, 24 Aug 2010)
New Revision: 5046

Modified:
   pve-access-control/trunk/ACL.pm
   pve-access-control/trunk/ChangeLog
   pve-access-control/trunk/Group.pm
   pve-access-control/trunk/Role.pm
   pve-access-control/trunk/User.pm
   pve-access-control/trunk/pveum
Log:
	* pveum: use new PVE::RPCEnvironment

	* *.pm: remove $conn parameter everywhere



Modified: pve-access-control/trunk/ACL.pm
===================================================================
--- pve-access-control/trunk/ACL.pm	2010-08-24 11:13:11 UTC (rev 5045)
+++ pve-access-control/trunk/ACL.pm	2010-08-24 11:13:47 UTC (rev 5046)
@@ -26,7 +26,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
     
 	my $res = [];
 
@@ -53,7 +53,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/ChangeLog
===================================================================
--- pve-access-control/trunk/ChangeLog	2010-08-24 11:13:11 UTC (rev 5045)
+++ pve-access-control/trunk/ChangeLog	2010-08-24 11:13:47 UTC (rev 5046)
@@ -1,3 +1,9 @@
+2010-08-24  Proxmox Support Team  <support at proxmox.com>
+
+	* pveum: use new PVE::RPCEnvironment
+
+	* *.pm: remove $conn parameter everywhere
+
 2010-08-16  Proxmox Support Team  <support at proxmox.com>
 
 	* AccessControl.pm (lock_user_config): add call to die, remove

Modified: pve-access-control/trunk/Group.pm
===================================================================
--- pve-access-control/trunk/Group.pm	2010-08-24 11:13:11 UTC (rev 5045)
+++ pve-access-control/trunk/Group.pm	2010-08-24 11:13:47 UTC (rev 5046)
@@ -34,7 +34,7 @@
 	links => [ { rel => 'child', href => "{id}" } ],
     },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
     
 	my $res = [];
 
@@ -61,7 +61,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -95,7 +95,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	my $group = $param->{groupid};
 
@@ -123,7 +123,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/Role.pm
===================================================================
--- pve-access-control/trunk/Role.pm	2010-08-24 11:13:11 UTC (rev 5045)
+++ pve-access-control/trunk/Role.pm	2010-08-24 11:13:47 UTC (rev 5046)
@@ -34,7 +34,7 @@
 	links => [ { rel => 'child', href => "{id}" } ],
     },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
     
 	my $res = [];
 
@@ -62,7 +62,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -104,7 +104,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -140,7 +140,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	my $usercfg = read_file("usercfg");
 
@@ -168,7 +168,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/User.pm
===================================================================
--- pve-access-control/trunk/User.pm	2010-08-24 11:13:11 UTC (rev 5045)
+++ pve-access-control/trunk/User.pm	2010-08-24 11:13:47 UTC (rev 5046)
@@ -35,7 +35,7 @@
 	links => [ { rel => 'child', href => "{id}" } ],
     },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
     
 	my $res = [];
 
@@ -64,7 +64,7 @@
     },
     returns => { type => 'string' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
     
 	my $user = PVE::AccessControl::authenticate_user($param->{userid}, $param->{password});
 	my $ticket = PVE::AccessControl::assemble_ticket($user);
@@ -88,7 +88,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -140,7 +140,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	my ($username, undef, $domain) = 
 	    PVE::AccessControl::verify_username($param->{userid});
@@ -179,7 +179,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 	
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -244,7 +244,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $param) = @_;
+	my ($param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/pveum
===================================================================
--- pve-access-control/trunk/pveum	2010-08-24 11:13:11 UTC (rev 5045)
+++ pve-access-control/trunk/pveum	2010-08-24 11:13:47 UTC (rev 5046)
@@ -7,6 +7,7 @@
 use File::Path qw(make_path remove_tree);
 use Term::ReadLine;
 use PVE::INotify;
+use PVE::RPCEnvironment;
 use PVE::API2::User;
 use PVE::API2::Group;
 use PVE::API2::Role;
@@ -22,6 +23,12 @@
 
 die "please run as root\n" if $> != 0;
 
+my $rpcenv = PVE::RPCEnvironment->init('cli');
+
+$rpcenv->set_language($ENV{LANG});
+
+$rpcenv->set_user('root'); 
+
 # autmatically generate the private key if it does not already exists
 my $authdir = PVE::AccessControl::auth_data_dir();
 if (! -f "$authdir/authkey.key") {




More information about the pve-devel mailing list