summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-09-21 22:07:28 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-09-21 22:07:28 +0000
commit0d174c5f27b2fa8437021d47f576178083020343 (patch)
tree702a3212a4b266d0f55bbfeaa4208e7a7cd97998 /etc/inc/system.inc
parentbf091a775dbafa6b6360e6c0de6a7515ce4d16fe (diff)
downloadpfsense-0d174c5f27b2fa8437021d47f576178083020343.zip
pfsense-0d174c5f27b2fa8437021d47f576178083020343.tar.gz
Sync admin account unconditionally.
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc21
1 files changed, 16 insertions, 5 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 29f460e..5eca8f8 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -647,20 +647,31 @@ EOD;
function system_password_configure() {
global $config, $g;
+ conf_mount_rw();
+
$fd = fopen("{$g['varrun_path']}/htpasswd", "w");
if (!$fd) {
printf("Error: cannot open htpasswd in system_password_configure().\n");
return 1;
}
- if ($config['system']['username'])
+ /* set admin account */
+ $username = "admin";
+ fwrite($fd, $username . ":" . $config['system']['password'] . "\n");
+
+ /* set defined user account */
+ if($username <> "admin") {
$username = $config['system']['username'];
- else
- $username = "admin";
+ fwrite($fd, $username . ":" . $config['system']['password'] . "\n");
+ }
- fwrite($fd, $username . ":" . $config['system']['password'] . "\n");
fclose($fd);
- chmod("{$g['varrun_path']}/htpasswd", 0600);
+ chmod("{$g['varrun_path']}/htpasswd", 0600);
+
+ /* sync passwords */
+ sync_webgui_passwords();
+
+ /* !NOTE! conf_mount_ro is done by sync_webgui_passwords() */
return 0;
}
OpenPOWER on IntegriCloud