]> git.ipfire.org Git - thirdparty/rsync.git/commit
fleettest: tighten --cleanup sweep scope and rm hardening
authorAndrew Tridgell <andrew@tridgell.net>
Thu, 4 Jun 2026 21:48:03 +0000 (07:48 +1000)
committerAndrew Tridgell <andrew@tridgell.net>
Thu, 4 Jun 2026 22:48:17 +0000 (08:48 +1000)
commitea866650be3a0df1655d43bedaee3990f53885c0
treeea3ad912a4bbeb97dadf4a47093eb3db567c0638
parentc7c01099445c48bbfd8e0a81b3fb5419d2ab7f34
fleettest: tighten --cleanup sweep scope and rm hardening

Address review findings on the cleanup paths:

- --cleanup no longer removes a bare <builddir>, only the suffixed
  <builddir>-* run dirs it created. This keeps the sweep within its
  documented scope and avoids clobbering an unrelated tree.

- Add _unsafe_builddir(): reject empty/root/$HOME and any absolute path
  directly under / (e.g. a misconfigured builddir of "/tmp") before
  building a destructive command, in both cleanup paths.

- Use `rm -rf --` so a path with a leading dash can't be read as options.

- Soften the docs: run-dir removal on Ctrl-C/kill is best-effort (a
  signal arriving mid-push can still leave a remnant for --cleanup).
testsuite/README.md
testsuite/fleettest.py