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

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Aug 16 11:03:38 CEST 2010


Author: dietmar
Date: 2010-08-16 09:03:38 +0000 (Mon, 16 Aug 2010)
New Revision: 5002

Modified:
   pve-access-control/trunk/ACL.pm
   pve-access-control/trunk/AccessControl.pm
   pve-access-control/trunk/ChangeLog
   pve-access-control/trunk/Group.pm
   pve-access-control/trunk/Role.pm
   pve-access-control/trunk/User.pm
Log:
	* *.pm: remove $resp parameter everywhere.

	* AccessControl.pm (verify_username): add test for username
	length (at least 3 characters)



Modified: pve-access-control/trunk/ACL.pm
===================================================================
--- pve-access-control/trunk/ACL.pm	2010-08-16 09:02:12 UTC (rev 5001)
+++ pve-access-control/trunk/ACL.pm	2010-08-16 09:03:38 UTC (rev 5002)
@@ -26,7 +26,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
     
 	my $res = [];
 
@@ -53,7 +53,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/AccessControl.pm
===================================================================
--- pve-access-control/trunk/AccessControl.pm	2010-08-16 09:02:12 UTC (rev 5001)
+++ pve-access-control/trunk/AccessControl.pm	2010-08-16 09:03:38 UTC (rev 5002)
@@ -517,6 +517,12 @@
 sub verify_username {
     my ($username, $noerr) = @_;
 
+    $username = '' if !$username;
+    if (length($username) < 3) {
+	die "user name '$username' is too short\n" if !$noerr;
+	return undef;
+    }
+
     $username =~ s/root\@localhost/root/;
 
     # we only allow a limited set of characters (colon is not allowed,

Modified: pve-access-control/trunk/ChangeLog
===================================================================
--- pve-access-control/trunk/ChangeLog	2010-08-16 09:02:12 UTC (rev 5001)
+++ pve-access-control/trunk/ChangeLog	2010-08-16 09:03:38 UTC (rev 5002)
@@ -1,3 +1,10 @@
+2010-08-16  Proxmox Support Team  <support at proxmox.com>
+
+	* *.pm: remove $resp parameter everywhere.
+
+	* AccessControl.pm (verify_username): add test for username
+	length (at least 3 characters)
+
 2010-08-13  Proxmox Support Team  <support at proxmox.com>
 
 	* User.pm: use new 'format' property in schema

Modified: pve-access-control/trunk/Group.pm
===================================================================
--- pve-access-control/trunk/Group.pm	2010-08-16 09:02:12 UTC (rev 5001)
+++ pve-access-control/trunk/Group.pm	2010-08-16 09:03:38 UTC (rev 5002)
@@ -34,7 +34,7 @@
 	links => [ { rel => 'child', href => "{id}" } ],
     },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
     
 	my $res = [];
 
@@ -61,7 +61,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -99,7 +99,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	my $group = $param->{groupid};
 
@@ -127,7 +127,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/Role.pm
===================================================================
--- pve-access-control/trunk/Role.pm	2010-08-16 09:02:12 UTC (rev 5001)
+++ pve-access-control/trunk/Role.pm	2010-08-16 09:03:38 UTC (rev 5002)
@@ -34,7 +34,7 @@
 	links => [ { rel => 'child', href => "{id}" } ],
     },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
     
 	my $res = [];
 
@@ -62,7 +62,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -108,7 +108,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -148,7 +148,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	my $usercfg = read_file("usercfg");
 
@@ -176,7 +176,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {

Modified: pve-access-control/trunk/User.pm
===================================================================
--- pve-access-control/trunk/User.pm	2010-08-16 09:02:12 UTC (rev 5001)
+++ pve-access-control/trunk/User.pm	2010-08-16 09:03:38 UTC (rev 5002)
@@ -35,7 +35,7 @@
 	links => [ { rel => 'child', href => "{id}" } ],
     },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
     
 	my $res = [];
 
@@ -64,7 +64,7 @@
     },
     returns => { type => 'string' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $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, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {
@@ -144,7 +144,7 @@
     },
     returns => {},
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	my ($username, undef, $domain) = 
 	    PVE::AccessControl::verify_username($param->{userid});
@@ -183,7 +183,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 	
 	die "conflicting parameters unlock/lock\n" 
 	    if $param->{unlock} && $param->{lock};
@@ -252,7 +252,7 @@
     },
     returns => { type => 'null' },
     code => sub {
-	my ($conn, $resp, $param) = @_;
+	my ($conn, $param) = @_;
 
 	PVE::AccessControl::lock_user_config(
 	    sub {



More information about the pve-devel mailing list