Rsync parity: symlink handling flags (--links, --copy-links, --safe-links, --copy-unsafe-links) #120

Closed
opened 2026-07-21 16:23:06 +02:00 by TapTap · 0 comments
Owner

FastSync has follow_symlinks in the scanner config but no CLI flags to control symlink behavior. Rsync provides several symlink-related flags that FastSync should support:

Missing flags

  • -l, --links — copy symlinks as symlinks (currently seems to be always on?)
  • -L, --copy-links — transform symlink into referent file/dir
  • --copy-unsafe-links — only copy unsafe symlinks
  • --safe-links — only copy symlinks that point within the source tree

Current code

  • src/client/scanner.c — has follow_symlinks field (boolean, currently not exposed via CLI)
  • src/shared/config.h — no symlink-related config fields exposed
  • src/client/client_cli.c:85-244 — no symlink flags parsed

Suggested implementation

  1. Add --links, --copy-links, --safe-links boolean fields to Config
  2. Parse them in client_cli.c
  3. In scanner.c, use these flags to control follow_symlinks behavior and whether symlinks are transferred as symlinks (not just followed)
  4. Wire through protocol for server-side consistency

Reference

rsync man page: man rsync — the -l, -L, --safe-links, --copy-unsafe-links options

FastSync has `follow_symlinks` in the scanner config but no CLI flags to control symlink behavior. Rsync provides several symlink-related flags that FastSync should support: ## Missing flags - `-l, --links` — copy symlinks as symlinks (currently seems to be always on?) - `-L, --copy-links` — transform symlink into referent file/dir - `--copy-unsafe-links` — only copy unsafe symlinks - `--safe-links` — only copy symlinks that point within the source tree ## Current code - `src/client/scanner.c` — has `follow_symlinks` field (boolean, currently not exposed via CLI) - `src/shared/config.h` — no symlink-related config fields exposed - `src/client/client_cli.c:85-244` — no symlink flags parsed ## Suggested implementation 1. Add `--links`, `--copy-links`, `--safe-links` boolean fields to `Config` 2. Parse them in `client_cli.c` 3. In `scanner.c`, use these flags to control `follow_symlinks` behavior and whether symlinks are transferred as symlinks (not just followed) 4. Wire through protocol for server-side consistency ## Reference rsync man page: `man rsync` — the `-l`, `-L`, `--safe-links`, `--copy-unsafe-links` options
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#120