fs-util: Strip O_NOFOLLOW in xopenat() when calling fd_reopen()

We definitely want to follow symlinks when calling fd_reopen() so
let's strip O_NOFOLLOW when we call it from xopenat().
This commit is contained in:
Daan De Meyer
2023-03-30 09:04:14 +02:00
parent 16859751ca
commit fedceeba2e
+1 -1
View File
@@ -1106,7 +1106,7 @@ int xopenat(int dir_fd, const char *path, int flags, mode_t mode) {
if (isempty(path)) {
assert(!FLAGS_SET(flags, O_CREAT|O_EXCL));
return fd_reopen(dir_fd, flags);
return fd_reopen(dir_fd, flags & ~O_NOFOLLOW);
}
if (FLAGS_SET(flags, O_DIRECTORY|O_CREAT)) {