mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-09-12 21:28:25 -04:00
Fix bypass of --safe-links when --backup hardlinks a symlink
When CAN_HARDLINK_SYMLINK is defined (Linux, macOS), the backup hardlink fast path at link_or_rename() succeeded for symlinks and 'goto success' skipped the safe_symlinks check. An escaping symlink (pointing outside the transfer tree) was silently preserved in the backup area despite --safe-links. Fix: check safe_symlinks BEFORE the hardlink path. If the symlink target escapes, skip the backup (same as non-hardlink-symlink systems). Regression test: testsuite/ki72-safe-links-backup_test.py
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f