Skip to content

Commit

Permalink
[Filestore] issue-2784: ignore user O_NOFOLLOW flag when opening file…
Browse files Browse the repository at this point in the history
  • Loading branch information
budevg authored Jan 2, 2025
1 parent c9c878e commit 0992384
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cloud/filestore/libs/service_local/lowlevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ TFileHandle Open(const TFileHandle& handle, int flags, int mode)
char path[64] = {0};
sprintf(path, "/proc/self/fd/%i", Fd(handle));

// Clear `O_NOFOLLOW` if it's set to follow `/proc/self/fd` symlink.
flags &= ~O_NOFOLLOW;

int fd = open(path, flags, mode);
Y_ENSURE_EX(fd != -1, TServiceError(GetSystemErrorCode())
<< "failed to open: " << LastSystemErrorText());
Expand Down

0 comments on commit 0992384

Please sign in to comment.