--chmod parity: implies -p, no D/F/X, no append, sanitized #293

Closed
opened 2026-09-15 19:33:34 +02:00 by TapTap · 1 comment
Owner

Audit findings (src/client/client_cli.c, src/shared/chmod.c, src/shared/metadata.c).

  • FastSync --chmod implies --preserve-perms; rsync 3.4.1 does not (it modifies new-file/added defaults only unless -p is on). Verified contrast on an existing dest.
  • The chmod result is then run through the mode sanitizer, so --chmod=go+w is silently dropped (644 vs rsync 666); setuid/setgid/sticky on files are stripped under -p.
  • Missing rsync's D/F selectors and X; repeated --chmod replaces instead of appending.

Fix: decide rsync-parity vs documented divergence; add D/F/X and append semantics if parity is the goal; add tests.

Audit findings (`src/client/client_cli.c`, `src/shared/chmod.c`, `src/shared/metadata.c`). - FastSync `--chmod` implies `--preserve-perms`; rsync 3.4.1 does not (it modifies new-file/added defaults only unless -p is on). Verified contrast on an existing dest. - The chmod result is then run through the mode sanitizer, so `--chmod=go+w` is silently dropped (644 vs rsync 666); setuid/setgid/sticky on files are stripped under `-p`. - Missing rsync's `D`/`F` selectors and `X`; repeated `--chmod` replaces instead of appending. Fix: decide rsync-parity vs documented divergence; add `D`/`F`/`X` and append semantics if parity is the goal; add tests.
TapTap added the needs-triage label 2026-09-15 19:33:34 +02:00
Author
Owner

Fixed. --chmod no longer implies --preserve-perms; the result is not run through a mode sanitizer (--chmod=go+w yields 666); D/F selectors and X are supported and repeated --chmod accumulates. Differential test vs rsync 3.4.1 added. Closing as completed.

Fixed. `--chmod` no longer implies `--preserve-perms`; the result is not run through a mode sanitizer (`--chmod=go+w` yields `666`); `D`/`F` selectors and `X` are supported and repeated `--chmod` accumulates. Differential test vs rsync 3.4.1 added. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#293