From fbca508a3175762395c28c9218c5b2f19423561f Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sat, 21 Nov 2026 14:35:16 -0500 Subject: [PATCH] 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. --- src/fuse_open.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fuse_open.cpp b/src/fuse_open.cpp index 1d247079..1ee8af02 100644 --- a/src/fuse_open.cpp +++ b/src/fuse_open.cpp @@ -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);