Repository navigation
Conversation
|
The permissions should then be modified for the required duration and restored, like we do while syncing regular changes. |
Signed-off-by: steadytao <[email protected]>
|
Thank you for the review. I updated the versioner archive path to only temporarily add owner access to version-store directories when we need to create children, then restore the original modes afterwards (including special bits). I also added/adjusted tests covering:
Appreciate the guidance, it helped me land on a much cleaner approach |
themavik
left a comment
There was a problem hiding this comment.
nit: ensureOwnerWritableTemporarily only ORs owner rwx (0o700). On filesystems where group/other bits or ACLs actually gate mkdir/rename, chmod may still fail after this change; probably fine for typical single-user folders but worth keeping in mind for exotic NAS ACLs.
Purpose
Fixes a regression where version-store directories (e.g.
.stversions/a/b) can become read-only (0555), preventing Syncthing from creating nested version paths during later archive operations (#10532).If a parent directory inside the version store loses owner-write permission, subsequent attempts to archive files into deeper paths fail with a permission error. This prevents further versions from being archived for affected folders.
This patch ensures version-store directories always remain owner-writable so nested paths can be created safely.
Changes Made
The fix is intentionally minimal:
Background
Recent permission synchronisation changes caused version-store directories to inherit restrictive permissions from the source folder. In cases where a source directory was read-only (e.g. 0555), the corresponding version-store directory could also become read-only.
Because the version store must create additional nested directories over time, this could leave it permanently unable to archive further versions.
This change ensures version-store directories remain owner-writable while preserving all other permission bits.
Testing
Added a regression test that:
0555.Additionally verified: