mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-08-12 10:02:32 +00:00
PVE/Auth/PVE.pm: encode uft8 password before calling crypt
This commit is contained in:
parent
d146e52028
commit
3641833bc0
@ -2,6 +2,7 @@ package PVE::Auth::PVE;
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Encode;
|
||||||
|
|
||||||
use PVE::Tools;
|
use PVE::Tools;
|
||||||
use PVE::Auth::Plugin;
|
use PVE::Auth::Plugin;
|
||||||
@ -79,8 +80,9 @@ sub authenticate_user {
|
|||||||
my $shadow_cfg = cfs_read_file($shadowconfigfile);
|
my $shadow_cfg = cfs_read_file($shadowconfigfile);
|
||||||
|
|
||||||
if ($shadow_cfg->{users}->{$username}) {
|
if ($shadow_cfg->{users}->{$username}) {
|
||||||
my $encpw = crypt($password, $shadow_cfg->{users}->{$username}->{shadow});
|
my $encpw = crypt(Encode::encode('utf8', $password),
|
||||||
die "invalid credentials\n" if ($encpw ne $shadow_cfg->{users}->{$username}->{shadow});
|
$shadow_cfg->{users}->{$username}->{shadow});
|
||||||
|
die "invalid credentials\n" if ($encpw ne $shadow_cfg->{users}->{$username}->{shadow});
|
||||||
} else {
|
} else {
|
||||||
die "no password set\n";
|
die "no password set\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user