]> git.proxmox.com Git - pve-access-control.git/commitdiff
fix bug #151: corretly parse username inside ticket
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Apr 2012 08:21:15 +0000 (10:21 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Apr 2012 08:21:15 +0000 (10:21 +0200)
PVE/AccessControl.pm
changelog.Debian

index d3feb24da841baa4022d41939a97bf4273fb1947..2b7974dd6245fd44d92a9d3902c0f9cfe07c4bea 100644 (file)
@@ -156,14 +156,15 @@ sub verify_ticket {
 
        my $rsa_pub = get_pubkey();
        if ($rsa_pub->verify($plain, decode_base64($sig))) {
-           if ($plain =~ m/^PVE:(([A-Za-z0-9\.\-_]+)(\@([A-Za-z0-9\.\-_]+))?):([A-Z0-9]{8})$/) {
+           if ($plain =~ m/^PVE:(\S+):([A-Z0-9]{8})$/) {
                my $username = $1;
-               my $timestamp = $5;
+               my $timestamp = $2;
                my $ttime = hex($timestamp);
 
                my $age = time() - $ttime;
 
-               if (($age > -300) && ($age < $ticket_lifetime)) {
+               if (verify_username($username, 1) &&
+                   ($age > -300) && ($age < $ticket_lifetime)) {
                    return wantarray ? ($username, $age) : $username;
                }
            }
index 26dff079182ed037c5b422cd922074f04babc87e..492266e103d6a185615d5f90eee1e380aacc1bcf 100644 (file)
@@ -1,6 +1,8 @@
 libpve-access-control (1.0-18) unstable; urgency=low
 
-  * allow user to change his own password
+  * fix bug #151: corretly parse username inside ticket
+  
+  * fix bug #152: allow user to change his own password
 
  -- Proxmox Support Team <support@proxmox.com>  Wed, 11 Apr 2012 09:40:15 +0200