Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
3fb13ff3
Unverified
Commit
3fb13ff3
authored
Aug 23, 2018
by
IKEDA Soji
Committed by
GitHub
Aug 23, 2018
Browse files
Merge pull request #398 from mpkut/6.2.34_fix_rehash_password by mpkut
Avoid rehashing user password hashes in {add,update}_global_user()
parents
3e2a5e0e
c0ec8d84
Changes
1
Show whitespace changes
Inline
Side-by-side
src/lib/Sympa/User.pm
View file @
3fb13ff3
...
...
@@ -642,9 +642,17 @@ sub update_global_user {
## use hash fingerprint to store password
## hashes that use salts will randomly generate one
## 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
'}));
}
else
{
$values
->
{'
password
'}
=
Sympa::User::
password_fingerprint
(
$values
->
{'
password
'},
undef
)
if
(
$values
->
{'
password
'});
Sympa::User::
password_fingerprint
(
$values
->
{'
password
'},
undef
);
}
}
## Canonicalize lang if possible.
$values
->
{'
lang
'}
=
Sympa::Language::
canonic_lang
(
$values
->
{'
lang
'})
...
...
@@ -722,9 +730,17 @@ sub add_global_user {
## encrypt password with the configured password hash algorithm
## an salt of 'undef' means generate a new random one
## 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
'}));
}
else
{
$values
->
{'
password
'}
=
Sympa::User::
password_fingerprint
(
$values
->
{'
password
'},
undef
)
if
(
$values
->
{'
password
'});
Sympa::User::
password_fingerprint
(
$values
->
{'
password
'},
undef
);
}
}
## Canonicalize lang if possible
$values
->
{'
lang
'}
=
Sympa::Language::
canonic_lang
(
$values
->
{'
lang
'})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment