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'});