mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
only generate salt and crypted_pw once
This commit is contained in:
parent
c2acdb73d8
commit
f53c7cd0ab
@ -1193,16 +1193,14 @@ function sync_webgui_passwords() {
|
||||
global $config;
|
||||
conf_mount_rw();
|
||||
$config['system']['password'] = crypt($_POST['password']);
|
||||
/* sync root */
|
||||
$fd = popen("/usr/sbin/pw usermod -n root -H 0", "w");
|
||||
$salt = md5(time());
|
||||
$crypted_pw = crypt($_POST['password'],$salt);
|
||||
/* sync root */
|
||||
$fd = popen("/usr/sbin/pw usermod -n root -H 0", "w");
|
||||
fwrite($fd, $crypted_pw);
|
||||
pclose($fd);
|
||||
/* sync admin */
|
||||
$fd = popen("/usr/sbin/pw usermod -n admin -H 0", "w");
|
||||
$salt = md5(time());
|
||||
$crypted_pw = crypt($_POST['password'],$salt);
|
||||
fwrite($fd, $crypted_pw);
|
||||
pclose($fd);
|
||||
update_changedesc("password changed via webConfigurator");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user