diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-07-23 10:19:10 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-07-23 10:19:10 +0000 |
commit | a74ddb4e401b4f5e6d09759cc67ab639ce8e98b9 (patch) | |
tree | 2d9bd9046e6d6ec1f968d8099aa3b66534f5d8b8 /pw/rm_r.c | |
parent | 80285e3e194993731e573e5ffa1eba819e283ddd (diff) | |
download | pw-darwin-a74ddb4e401b4f5e6d09759cc67ab639ce8e98b9.tar.gz pw-darwin-a74ddb4e401b4f5e6d09759cc67ab639ce8e98b9.tar.zst pw-darwin-a74ddb4e401b4f5e6d09759cc67ab639ce8e98b9.zip |
Do not try to delete the home of the user if is is not a directory for example
"/dev/null"
PR: 211195
Submitted by: rday <ryan@ryanday.net>
Reported by: eniorm <eniorm@gmail.com>
MFC after: 1 day
Diffstat (limited to 'pw/rm_r.c')
-rw-r--r-- | pw/rm_r.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) { |