mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-07-27 04:44:57 +00:00
fix bug #151: corretly parse username inside ticket
This commit is contained in:
parent
1cf154b72f
commit
533219a122
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user