Skip to content

Commit

Permalink
Additional change to #398: Log traceback to track bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedas committed Aug 23, 2018
1 parent 3fb13ff commit e02945f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/lib/Sympa/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,15 @@ sub update_global_user {
## avoid rehashing passwords that are already hash strings
if ($values->{'password'}) {
if (defined(hash_type($values->{'password'}))) {
$log->syslog('debug',
'password is in %s format, not rehashing',
hash_type($values->{'password'}));
$log->syslog(
'err',
'Bug in logic: Password is in %s format, not rehashing',
hash_type($values->{'password'})
);
} else {
$values->{'password'} =
Sympa::User::password_fingerprint($values->{'password'}, undef);
Sympa::User::password_fingerprint($values->{'password'},
undef);
}
}

Expand Down Expand Up @@ -733,12 +736,15 @@ sub add_global_user {
## avoid rehashing passwords that are already hash strings
if ($values->{'password'}) {
if (defined(hash_type($values->{'password'}))) {
$log->syslog('debug',
'password is in %s format, not rehashing',
hash_type($values->{'password'}));
$log->syslog(
'err',
'Bug in logic. Password is in %s format, not rehashing',
hash_type($values->{'password'})
);
} else {
$values->{'password'} =
Sympa::User::password_fingerprint($values->{'password'}, undef);
Sympa::User::password_fingerprint($values->{'password'},
undef);
}
}

Expand Down

0 comments on commit e02945f

Please sign in to comment.