5
0
mirror of git://git.proxmox.com/git/pve-access-control.git synced 2025-01-22 22:03:46 +03:00

user check: fix expiration/enable order

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Oguz Bektas 2022-05-31 12:58:52 +02:00 committed by Thomas Lamprecht
parent 79ae250ff9
commit d0cce79f8b

View File

@ -653,15 +653,15 @@ sub check_user_enabled {
my $data = check_user_exist($usercfg, $username, $noerr);
return undef if !$data;
return 1 if $data->{enable};
die "user '$username' is disabled\n" if !$noerr;
my $ctime = time();
my $expire = $usercfg->{users}->{$username}->{expire};
die "account expired\n" if $expire && ($expire < $ctime);
return 1 if $data->{enable};
die "user '$username' is disabled\n" if !$noerr;
return undef;
}