diff options
author | jim-p <jimp@pfsense.org> | 2010-07-12 12:40:25 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-07-12 12:40:25 -0400 |
commit | a39675ecae28aa0e772eaae4ddb59dc3799b694e (patch) | |
tree | 6897747093edfeafc08a84599f1e2244ebb31c56 /etc/inc/auth.inc | |
parent | a803793fe5086d6bfb80d42035b6f99ed4ef01f7 (diff) | |
download | pfsense-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.inc | 6 |
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}"); |