Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sympa
sympa
Commits
c0ec8d84
Commit
c0ec8d84
authored
Aug 20, 2018
by
Mic Kaczmarczik
Browse files
Avoid rehashing user passwords in {add,update}_global_user()
parent
c33f7f04
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/User.pm
View file @
c0ec8d84
...
...
@@ -642,9 +642,17 @@ sub update_global_user {
## use hash fingerprint to store password
## hashes that use salts will randomly generate one
$values
->
{'
password
'}
=
Sympa::User::
password_fingerprint
(
$values
->
{'
password
'},
undef
)
if
(
$values
->
{'
password
'});
## 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
);
}
}
## 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
$values
->
{'
password
'}
=
Sympa::User::
password_fingerprint
(
$values
->
{'
password
'},
undef
)
if
(
$values
->
{'
password
'});
## 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
);
}
}
## 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