From 3bf1718b305b4fcbf80dd2c2a33d3481f23c975e Mon Sep 17 00:00:00 2001 From: iliajie Date: Wed, 1 Feb 2023 23:45:10 +0200 Subject: [PATCH] Fix to use system default hashing format for `htpasswd` file https://forum.virtualmin.com/t/how-to-change-awstats-user-password/118998/ --- htpasswd-file/htpasswd-file-lib.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htpasswd-file/htpasswd-file-lib.pl b/htpasswd-file/htpasswd-file-lib.pl index 6cc9ae269..6be9d5eec 100755 --- a/htpasswd-file/htpasswd-file-lib.pl +++ b/htpasswd-file/htpasswd-file-lib.pl @@ -158,10 +158,10 @@ else { } } else { - # Use built-in encryption code - my $salt = $old || - chr(int(rand(26))+65).chr(int(rand(26))+65); - return &unix_crypt($str, $salt); + # Use built-in encryption code and use system default + my $salt = $old; + &foreign_require('useradmin'); + return &useradmin::encrypt_password($str, $salt, 1); } } }