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:
+1
-1
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user