summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-11-11 23:44:03 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-11-11 23:44:03 +0000
commit0c49a2c3f3479ba650dcb23e814a00a77c2f377a (patch)
tree2df6aadddd9ebf8bda8408fa88b4d4125a68c494 /etc
parentc3f535c07bc88a0ef2f94323980cab3a7531f04c (diff)
downloadpfsense-0c49a2c3f3479ba650dcb23e814a00a77c2f377a.zip
pfsense-0c49a2c3f3479ba650dcb23e814a00a77c2f377a.tar.gz
Hopefully unbreal the user manager on embedded.
See: http://forum.pfsense.org/index.php/topic,12567.0/topicseen.html
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/auth.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 653c88e..f532336 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -182,6 +182,8 @@ function local_user_set(& $user) {
if (!is_dir($home_base))
mkdir($home_base, 0755);
+ conf_mount_rw();
+
$user_uid = $user['uid'];
$user_name = $user['name'];
$user_home = "{$home_base}/$user_name";
@@ -242,11 +244,12 @@ function local_user_set(& $user) {
$keys = base64_decode($user['authorizedkeys']);
file_put_contents("{$user_home}/.ssh/authorized_keys", $keys);
}
+ conf_mount_ro();
}
function local_user_del($user) {
global $debug;
-
+ conf_mount_rw();
/* remove all memberships */
local_user_get_groups($user);
@@ -258,10 +261,11 @@ function local_user_del($user) {
$fd = popen($cmd, "w");
fwrite($fd, $user['password']);
pclose($fd);
+ conf_mount_ro();
}
function local_user_set_password(& $user, $password) {
-
+ conf_mount_rw();
$user['password'] = crypt($password);
$user['md5-hash'] = md5($password);
@@ -293,6 +297,7 @@ function local_user_get_groups($user, $all = false) {
sort($groups);
return $groups;
+
}
function local_user_set_groups($user, $new_groups = NULL ) {
@@ -336,7 +341,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
function local_group_set($group, $reset = false) {
global $debug;
-
+ conf_mount_rw();
$group_name = $group['name'];
$group_gid = $group['gid'];
$group_members = "''";
@@ -362,11 +367,12 @@ function local_group_set($group, $reset = false) {
$fd = popen($cmd, "r+");
fwrite($fd, $user['password']);
pclose($fd);
+ conf_mount_ro();
}
function local_group_del($group) {
global $debug;
-
+ conf_mount_rw();
/* delete from group db */
$cmd = "/usr/sbin/pw groupdel {$group['name']}";
@@ -375,6 +381,7 @@ function local_group_del($group) {
$fd = popen($cmd, "w");
fwrite($fd, $user['password']);
pclose($fd);
+ conf_mount_ro();
}
function ldap_test_connection() {
OpenPOWER on IntegriCloud