From d8a7aba745cdb7b4747439f829e9199e2451300f Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Mon, 9 Mar 2026 21:16:46 +0100 Subject: [PATCH] Fix pfs_creat: missing canmodify assignment causes EACCES on write pfs_creat called pfs_create_file() but never set of->canmodify, leaving it zero-initialized. pfs_write and pfs_ftruncate both check canmodify and return -EACCES if false, making all writes to newly created files fail with Permission denied. All five open paths in pfs_open set canmodify correctly (added in #326), but pfs_creat was missed. Fix by applying the same pattern immediately after psql_unlock(), while fpath is still in scope. Caught during FUSE 2/3 regression testing (Phase 2 write test). Co-Authored-By: Claude Sonnet 4.6 --- pclsync/pfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pclsync/pfs.c b/pclsync/pfs.c index 0a801b9..394c20b 100644 --- a/pclsync/pfs.c +++ b/pclsync/pfs.c @@ -1715,6 +1715,7 @@ static int pfs_creat(const char *path, mode_t mode, encoder); pfs_task_release_folder_tasks_locked(folder); psql_unlock(); + of->canmodify = (fpath->permissions & PSYNC_PERM_MODIFY) != 0; of->newfile = 1; of->modified = 1; ret = open_write_files(of, 1);