summaryrefslogtreecommitdiffstats
path: root/etc/inc/auth.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-07-12 12:40:25 -0400
committerjim-p <jimp@pfsense.org>2010-07-12 12:40:25 -0400
commita39675ecae28aa0e772eaae4ddb59dc3799b694e (patch)
tree6897747093edfeafc08a84599f1e2244ebb31c56 /etc/inc/auth.inc
parenta803793fe5086d6bfb80d42035b6f99ed4ef01f7 (diff)
downloadpfsense-a39675ecae28aa0e772eaae4ddb59dc3799b694e.zip
pfsense-a39675ecae28aa0e772eaae4ddb59dc3799b694e.tar.gz
Remove home directory when deleting a user.
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r--etc/inc/auth.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 504b241..fed2a67 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -359,8 +359,12 @@ function local_user_del($user) {
/* remove all memberships */
local_user_set_groups($user);
+ /* Don't remove /root */
+ if ($user['uid'] != 0)
+ $rmhome = "-r";
+
/* delete from pw db */
- $cmd = "/usr/sbin/pw userdel {$user['name']}";
+ $cmd = "/usr/sbin/pw userdel {$user['name']} {$rmhome}";
if($debug)
log_error("Running: {$cmd}");
OpenPOWER on IntegriCloud