summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorMatthew Grooms <mgrooms@pfsense.org>2008-08-01 23:20:28 +0000
committerMatthew Grooms <mgrooms@pfsense.org>2008-08-01 23:20:28 +0000
commit613cf46cdfe979c939307eefd9230b4d995c718f (patch)
tree34bee0eaa5bb90cd631d7b581f103a4a3ece9b44 /etc
parent97b8e3fc89e25a3bebe0884fc01f37b38da9fe2c (diff)
downloadpfsense-613cf46cdfe979c939307eefd9230b4d995c718f.zip
pfsense-613cf46cdfe979c939307eefd9230b4d995c718f.tar.gz
When performing a user configuration upgrade, make sure the all group gets
created before syncing accounts to the system.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/auth.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index c057d30..c46a097 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -93,6 +93,15 @@ function & getGroupEntry($name) {
return $config['system']['group'][$groupindex[$name]];
}
+function & getGroupEntryByGID($gid) {
+ global $config;
+ foreach ($config['system']['group'] as & $group)
+ if ($group['gid'] == $gid)
+ return $group;
+
+ return false;
+}
+
function sync_local_accounts() {
global $config;
@@ -129,6 +138,10 @@ function sync_local_accounts() {
pclose($fd);
}
+ /* make sure the all group exists */
+ $allgrp = getGroupEntryByGID(1998);
+ set_local_group($allgrp);
+
/* sync all local users */
if (is_array($config['system']['user']))
foreach ($config['system']['user'] as $user)
OpenPOWER on IntegriCloud