CLI: rsync short options and short-option clustering unsupported #285

Closed
opened 2026-09-15 19:33:33 +02:00 by TapTap · 0 comments
Owner

Audit finding (post per-attribute split, protocol 2.22.0). FastSync rejects the most common rsync invocations.

Observed (built client):

  • -r -> Unknown option: -r (also -b, -L, -B)
  • -av, -aAX, -rlpt -> Unknown option (no short-option clustering)
  • -s/--secluded-args is OPT_NOOP but cli_handle_table_option consumes the next argv for every non-OPT_FLAG kind, so fastsync -s SRC DST -> missing destination argument (src/client/client_cli.c table entry at the --secluded-args line and the value-consuming branch).

Impact: drop-in replacement is broken for rsync -av, -a, -rlpt, bundled flags. -r is not in OPTION_TABLE at all.

Fix:

  • Add aliases/entries for -r (recursive; FastSync is always recursive, accept as no-op), -b (backup), -L (copy-links), -B (block-size), plus any other rsync shorts missing from OPTION_TABLE.
  • Treat OPT_NOOP like OPT_FLAG for argument consumption.
  • Add a parser pre-pass that expands clustered boolean shorts (-av -> -a -v), matching rsync.
  • Add CLI tests for -av, -aAX, -rlpt, -s SRC DST.
Audit finding (post per-attribute split, protocol 2.22.0). FastSync rejects the most common rsync invocations. Observed (built client): - `-r` -> `Unknown option: -r` (also `-b`, `-L`, `-B`) - `-av`, `-aAX`, `-rlpt` -> `Unknown option` (no short-option clustering) - `-s`/`--secluded-args` is `OPT_NOOP` but `cli_handle_table_option` consumes the next argv for every non-`OPT_FLAG` kind, so `fastsync -s SRC DST` -> `missing destination argument` (`src/client/client_cli.c` table entry at the `--secluded-args` line and the value-consuming branch). Impact: drop-in replacement is broken for `rsync -av`, `-a`, `-rlpt`, bundled flags. `-r` is not in OPTION_TABLE at all. Fix: - Add aliases/entries for `-r` (recursive; FastSync is always recursive, accept as no-op), `-b` (backup), `-L` (copy-links), `-B` (block-size), plus any other rsync shorts missing from OPTION_TABLE. - Treat `OPT_NOOP` like `OPT_FLAG` for argument consumption. - Add a parser pre-pass that expands clustered boolean shorts (`-av` -> `-a -v`), matching rsync. - Add CLI tests for `-av`, `-aAX`, `-rlpt`, `-s SRC DST`.
TapTap added the needs-triage label 2026-09-15 19:33:33 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#285