mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-09-23 02:35:04 -04:00
t_stub.c: raise max_alloc default so test helpers can allocate
The t_stub.c shim defined max_alloc = 0 as a placeholder to satisfy the link against util2.o. This was harmless when the test helpers made no allocations, but the secure_relative_open() implementation in 3.4.0+ calls my_strdup() in its per-component O_NOFOLLOW fallback (syscall.c around line 1857), and the 3.4.3 do_*_at() hardening series added more such calls. With max_alloc=0, every allocation in that path trips the 'exceeded --max-alloc=0' check in util2.c's my_alloc(), and t_chmod_secure (which exercises do_chmod_at via secure_relative_open) fails on the very first my_strdup. The failure is invisible on Linux 5.6+ / FreeBSD 13+ / macOS 15+ / recent Cygwin because those platforms take the kernel-enforced openat2(RESOLVE_BENEATH) or openat(O_RESOLVE_BENEATH) branch and never reach the per-component fallback. It also goes unobserved on the SunOS/OpenBSD/NetBSD/CYGWIN* CI runners because the chmod-symlink-race.test script case-skips on those platforms (the legitimate dir-symlink scenario the test exercises can't pass on the per-component fallback). HPE NonStop is the first platform that lacks RESOLVE_BENEATH support AND isn't in the skip list AND has someone actually running the test suite, so it surfaced the latent bug. Raise max_alloc to SIZE_MAX so the helpers can allocate freely. A follow-up patch makes t_chmod_secure adapt at runtime so the skip list can be removed and the per-component fallback gets real CI coverage.
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f