Files
rsync/support
Andrew Tridgell ca9f33f231 rrsync: backport the full restricted-dir hardening
The earlier copy-unsafe-links denial left the rrsync wrapper short of the
3.5.0 restricted-dir hardening, so a daemon-side rrsync still followed a
symlinked --log-file, created device/special files, and had a
realpath-vs-exec TOCTOU.  Replace support/rrsync with the fully-hardened
3.5.0 wrapper (version-agnostic; verified functional with this rsync):
 - safe_open_logfile(): open the log file O_NOFOLLOW + S_ISREG + inode
   re-check so a planted symlink/special is refused;
 - force --no-D in a restricted (non-"/") dir so `rsync -a` strips device/
   special semantics instead of creating them;
 - inode-pin each realpath-validated arg via O_PATH + /proc/self/fd/N
   (where available) so the exec'd rsync can't be race-flipped after the
   check; fall through unpinned where /proc/self/fd is unavailable.

Tests: rrsync-logfile-symlink, rrsync-specials-denied, rrsync-symlink,
rrsync-copy-unsafe-links-denied, rrsync-archive-mode.
2026-06-15 15:24:42 +10:00
..
2022-11-20 09:38:12 -08:00
2022-11-16 00:10:09 -08:00
2021-12-27 17:57:53 -08:00
2022-01-09 14:03:31 -08:00
2005-01-11 18:37:37 +00:00
2023-05-22 08:29:15 -07:00
2020-08-05 21:32:44 -07:00