Skip to content

Commit

Permalink
Fix to try to use more strengthened default hash
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Apr 4, 2023
1 parent 1097096 commit 362fab9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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'})) {
Expand All @@ -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]);
}
Expand Down Expand Up @@ -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]);
}
Expand Down

0 comments on commit 362fab9

Please sign in to comment.