mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-02 04:46:41 -05:00
fix: restore the mode when an nfsopenhack open fails
- nfsopenhack adds S_IWUSR|S_IWGRP to a read-only file so the open can succeed, and resets the mode on the new fd. When the open still failed, the write bits stayed on the file. - Put the original mode back before returning EACCES.
This commit is contained in:
parent
92c5f57f6d
commit
fbca508a31
1 changed files with 4 additions and 1 deletions
|
|
@ -142,7 +142,10 @@ _lchmod_and_open_if_not_writable_and_empty(const fs::path &fullpath_,
|
|||
|
||||
rv = fs::open(fullpath_,flags_);
|
||||
if(rv < 0)
|
||||
return -EACCES;
|
||||
{
|
||||
fs::lchmod(fullpath_,st.st_mode);
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
fs::fchmod(rv,st.st_mode);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue