fix(receiver): defer --dirs directory mode to avoid EACCES on children
file_save_directory_to_disk() applied the exact source mode (fchmod) inline for explicit --dirs/STATUS_MKDIR entries. A restrictive source mode (e.g. 0555) then made the directory read-only before its children were written, so a non-root receiver failed each child with EACCES. The recursive -a path never hit this because it defers directory metadata. Remove the inline fchmod and let the existing deferred dir_metadata_list_apply() stamp the exact mode at end of transfer, as the recursive path does. Keep the inline ownership and xattrs (a direct file_save_to_disk_full() caller has no deferred pass) and document the resulting intentional ordering. Capture errno before output_escape() in the inline timestamp diagnostic so strerror() reports the real error, and add the missing trailing newline to tests/test_xattr.c.
This commit is contained in:
+1
-1
@@ -603,4 +603,4 @@ void test_xattr() {
|
||||
test_fake_super_no_real_chown();
|
||||
test_fake_super_storage_resolution();
|
||||
test_file_save_directory_applies_xattrs();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user