summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/rm_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pw/rm_r.c')
-rw-r--r--usr.sbin/pw/rm_r.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/pw/rm_r.c b/usr.sbin/pw/rm_r.c
index 172c7b0..45fc5d1 100644
--- a/usr.sbin/pw/rm_r.c
+++ b/usr.sbin/pw/rm_r.c
@@ -50,6 +50,9 @@ rm_r(int rootfd, const char *path, uid_t uid)
path++;
dirfd = openat(rootfd, path, O_DIRECTORY);
+ if (dirfd == -1) {
+ return;
+ }
d = fdopendir(dirfd);
while ((e = readdir(d)) != NULL) {
OpenPOWER on IntegriCloud