From 362fab956512db793dbc2ae89e734c65d6021f4c Mon Sep 17 00:00:00 2001 From: iliajie Date: Tue, 4 Apr 2023 19:42:58 +0300 Subject: [PATCH] Fix to try to use more strengthened default hash --- virtual_feature.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/virtual_feature.pl b/virtual_feature.pl index 026a0cf..3b37c25 100755 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -107,7 +107,9 @@ sub mailbox_save 'enabled' => 1 }; if ($user->{'pass_crypt'}) { # Use stored hashed password - $suser->{'pass'} = $user->{'pass_crypt'}; + $suser->{'pass'} = $user->{'pass_unix'} || + $user->{'pass_md5'} || + $user->{'pass_crypt'}; } elsif ($user->{'passmode'} == 3 || defined($user->{'plainpass'})) { @@ -129,7 +131,9 @@ sub mailbox_save $suser->{'user'} = $user->{'user'}; } if ($user->{'pass'} ne $old->{'pass'}) { - $suser->{'pass'} = $user->{'pass_crypt'} || + $suser->{'pass'} = $user->{'pass_unix'} || + $user->{'pass_md5'} || + $user->{'pass_crypt'} || &htaccess_htpasswd::encrypt_password( $user->{'plainpass'}, undef, $d->[2]); } @@ -160,7 +164,9 @@ sub mailbox_modify $suser->{'user'} = $user->{'user'}; } if ($user->{'pass'} ne $old->{'pass'}) { - $suser->{'pass'} = $user->{'pass_crypt'} || + $suser->{'pass'} = $user->{'pass_unix'} || + $user->{'pass_md5'} || + $user->{'pass_crypt'} || &htaccess_htpasswd::encrypt_password( $user->{'plainpass'}, undef, $d->[2]); }