From d3be5b8fc8aa64135e292509875aa28fa618f8d8 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 12 Nov 2020 22:23:56 -0800 Subject: [PATCH] Use correct function to validate a password https://github.com/webmin/webmin/issues/1324 --- password_change.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/password_change.cgi b/password_change.cgi index 0f94a16b9..f84f77905 100755 --- a/password_change.cgi +++ b/password_change.cgi @@ -38,8 +38,8 @@ if (!$in{'pam'} && !$wuser) { if ($wuser) { # Update Webmin user's password - $enc = &acl::encrypt_password($in{'old'}, $wuser->{'pass'}); - $enc eq $wuser->{'pass'} || &pass_error($text{'password_eold'}); + $ok = &acl::validate_password($in{'old'}, $wuser->{'pass'}); + $ok || &pass_error($text{'password_eold'}); $perr = &acl::check_password_restrictions($in{'user'}, $in{'new1'}); $perr && &pass_error(&text('password_enewpass', $perr)); $wuser->{'pass'} = &acl::encrypt_password($in{'new1'});