From 3641833bc0c3a231889ab899c3d8dfdb117847cc Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 2 May 2017 10:37:20 +0200 Subject: [PATCH] PVE/Auth/PVE.pm: encode uft8 password before calling crypt --- PVE/Auth/PVE.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/Auth/PVE.pm b/PVE/Auth/PVE.pm index 6065df0..de39d35 100755 --- a/PVE/Auth/PVE.pm +++ b/PVE/Auth/PVE.pm @@ -2,6 +2,7 @@ package PVE::Auth::PVE; use strict; use warnings; +use Encode; use PVE::Tools; use PVE::Auth::Plugin; @@ -79,8 +80,9 @@ sub authenticate_user { my $shadow_cfg = cfs_read_file($shadowconfigfile); if ($shadow_cfg->{users}->{$username}) { - my $encpw = crypt($password, $shadow_cfg->{users}->{$username}->{shadow}); - die "invalid credentials\n" if ($encpw ne $shadow_cfg->{users}->{$username}->{shadow}); + my $encpw = crypt(Encode::encode('utf8', $password), + $shadow_cfg->{users}->{$username}->{shadow}); + die "invalid credentials\n" if ($encpw ne $shadow_cfg->{users}->{$username}->{shadow}); } else { die "no password set\n"; }