Skip to content

Use rsync --protect-args in the rsync upload/download example - #1647

Merged
Slach merged 2 commits into
masterfrom
rsync_protect_args
Oct 28, 2026
Merged

Slach merged 2 commits into
masterfrom
rsync_protect_args

Conversation

@Slach

@Slach Slach commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #1639.

Adds -s (--protect-args) to the rsync calls in test/integration/rsync/upload.sh and download.sh, so the remote path and --link-dest reach the remote rsync over the rsync protocol instead of the remote shell command line.

rsync >= 3.2.4 (and distro builds with backported escaping, e.g. Ubuntu 20.04's 3.1.3) already backslash-escape these arguments, so on those versions this changes nothing. It protects against unpatched older rsync, where the remote shell would word-split a path containing spaces. Remote wildcards are still expanded (by rsync itself under -s).

Verified:

  • TestCustomRsync passes locally.
  • Fake-ssh check with a /remote dir*/... path on rsync 3.1.3 (Ubuntu 20.04), 3.2.5 and 3.5.0: upload with --link-dest hard-links unchanged files (link count 2) and download works, with and without -s.

🤖 Generated with Claude Code

Slach and others added 2 commits October 28, 2026 08:48
Without -s the remote path (destination on upload, source on download)
and --link-dest go through the remote shell command line. rsync >= 3.2.4
and distro-patched older builds backslash-escape them, but unpatched
older rsync lets the remote shell word-split paths with spaces. -s sends
the arguments over the rsync protocol instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40634441227

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.04%) to 70.41%

Details

  • Coverage increased (+0.04%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 20 coverage regressions across 7 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

20 previously-covered lines in 7 files lost coverage.

File Lines Losing Coverage Coverage
pkg/backup/backuper.go 4 79.23%
pkg/backup/restore.go 4 72.34%
pkg/clickhouse/clickhouse.go 4 80.96%
pkg/storage/general.go 3 70.52%
pkg/backup/download.go 2 78.4%
pkg/storage/azblob.go 2 64.29%
pkg/backup/list.go 1 70.26%

Coverage Stats

Coverage Status
Relevant Lines: 29517
Covered Lines: 20783
Line Coverage: 70.41%
Coverage Strength: 34556.93 hits per line

💛 - Coveralls

@Slach
Slach merged commit e158f44 into master Oct 28, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants