aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-07-09 13:10:58 +0100
committerRon Yorston <rmy@pobox.com>2020-07-09 13:10:58 +0100
commit9c0b2f7020d7c30b21a930ef54be632e092e533b (patch)
treeb2187c40bd2fd9f49f73599fb08e52cb7a596de0 /loginutils
parenta8c6e20e332a9e11a9d28cd6770eadb9c9d73cb7 (diff)
parentd21a63f9fca8eb16f79de9b72d4a3484dfaec1fc (diff)
downloadbusybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.gz
busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.bz2
busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/deluser.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index 56bc7eaa6..8e7df737c 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -99,8 +99,14 @@ int deluser_main(int argc, char **argv)
99 pfile = bb_path_passwd_file; 99 pfile = bb_path_passwd_file;
100 if (ENABLE_FEATURE_SHADOWPASSWDS) 100 if (ENABLE_FEATURE_SHADOWPASSWDS)
101 sfile = bb_path_shadow_file; 101 sfile = bb_path_shadow_file;
102 if (opt_delhome) 102 if (opt_delhome) {
103 remove_file(pw->pw_dir, FILEUTILS_RECUR); 103 struct stat st;
104
105 /* Make sure home is an actual directory before
106 * removing it (e.g. users with /dev/null as home) */
107 if (stat(pw->pw_dir, &st) == 0 && S_ISDIR(st.st_mode))
108 remove_file(pw->pw_dir, FILEUTILS_RECUR);
109 }
104 } else { 110 } else {
105 struct group *gr; 111 struct group *gr;
106 do_delgroup: 112 do_delgroup: