summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-04 00:10:44 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-04 00:10:44 +0000
commit721834135ecc1a81e3f9de0a19b1305974091238 (patch)
tree12b4e41e30f5c18fe3c392d0c81af91b91586613 /etc/inc
parent00431e2faae6d5724ed5f0839344771a3396edc5 (diff)
downloadpfsense-721834135ecc1a81e3f9de0a19b1305974091238.zip
pfsense-721834135ecc1a81e3f9de0a19b1305974091238.tar.gz
* Sync root and admin passwords
* Move sync logic into pfsense-utils:sync_webgui_passwords()
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/pfsense-utils.inc14
1 files changed, 14 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 3987c99..135130f 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1191,6 +1191,20 @@ function reload_interfaces() {
******/
function sync_webgui_passwords() {
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);
+ 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");
mwexec("/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd");
mwexec("/usr/sbin/pwd_mkdb /etc/master.passwd");
conf_mount_ro();
OpenPOWER on IntegriCloud