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 | ae4f3b0a81875867702cade7ba2f5920d92ee481 (patch) | |
tree | 996c107ff7eb254ada4e7753fafb8043b464d2c2 /pw | |
parent | e9e9b3528bf75d192d0a273a1d3f7e11a83103f7 (diff) | |
download | pw-darwin-ae4f3b0a81875867702cade7ba2f5920d92ee481.tar.gz pw-darwin-ae4f3b0a81875867702cade7ba2f5920d92ee481.tar.zst pw-darwin-ae4f3b0a81875867702cade7ba2f5920d92ee481.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')
-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) { |