summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-25 13:09:54 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-25 13:09:54 -0400
commitca1cad0f2ddd6056ea0a27212f0289a7b1aa14a9 (patch)
tree1ceedadb301105cfe7323549d78563bf78b6a3b9 /etc/inc
parentd8307a65d12b95fc0ee1d460c7b90f8f732e80c8 (diff)
downloadpfsense-ca1cad0f2ddd6056ea0a27212f0289a7b1aa14a9.zip
pfsense-ca1cad0f2ddd6056ea0a27212f0289a7b1aa14a9.tar.gz
Give admin user special treatment just like root.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/auth.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index dd69a28..1ad61c6 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -261,6 +261,17 @@ function local_user_set(& $user) {
$user_group = "wheel";
}
+ /* admin user special handling */
+ if ($user_uid == 0) {
+ $cmd = "/usr/sbin/pw usermod -q -n admin -s /bin/sh -H 0";
+ if($debug)
+ log_error("Running: {$cmd}");
+ $fd = popen($cmd, "w");
+ fwrite($fd, $user['password']);
+ pclose($fd);
+ $user_group = "wheel";
+ }
+
/* read from pw db */
$fd = popen("/usr/sbin/pw usershow {$user_name} 2>&1", "r");
$pwread = fgets($fd);
OpenPOWER on IntegriCloud