From 8a3a3e4de1c32cde54ecaffc1e87291ce621cc74 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 Jun 2026 10:33:11 +1000 Subject: [PATCH] testsuite: drop the symlink-escape oracle when it runs but crashes (Solaris) The da7c4208 oracle-exec guard only caught OSError (can't-exec / ENOEXEC, on the BSDs and macOS). Solaris execs the Linux x86-64 old_versions/rsync_3.2.7 binary without ENOEXEC but it SIGSEGVs, so subprocess.run('--version') returned -11 without raising and ORACLE_BIN stayed set -- the oracle daemon launch then died ("rsyncd exited before listening on port 12910, status=-11") and failed the test. Require the probe to exit cleanly (returncode == 0); a non-zero/signal exit, a hang (TimeoutExpired), or a can't-exec (OSError) all degrade to the static contract. --- testsuite/daemon-symlink-escape-matrix_test.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/testsuite/daemon-symlink-escape-matrix_test.py b/testsuite/daemon-symlink-escape-matrix_test.py index 75d94677..2865c518 100644 --- a/testsuite/daemon-symlink-escape-matrix_test.py +++ b/testsuite/daemon-symlink-escape-matrix_test.py @@ -78,14 +78,19 @@ if RSYNC_PEER != RSYNC: elif (_repo / 'old_versions' / 'rsync_3.2.7').is_file(): ORACLE_BIN = str(_repo / 'old_versions' / 'rsync_3.2.7') -# The in-tree oracle is a Linux x86-64 static binary, so on a non-Linux runner -# (BSD/macOS/Solaris) it is present but cannot exec. Probe it and degrade to the -# static contract on any exec failure rather than crashing with ENOEXEC. +# The in-tree oracle is a Linux x86-64 static binary, so on a non-Linux runner it +# is present but not usable: a BSD/macOS host refuses to exec it (ENOEXEC), while +# Solaris execs it but it crashes (SIGSEGV). Probe it with `--version` and degrade +# to the static contract unless it ran cleanly (rc == 0) -- catching can't-exec +# (OSError), a hang (TimeoutExpired), and a non-zero/signal exit alike -- rather +# than later crashing the oracle daemon launch. if ORACLE_BIN: try: - subprocess.run([ORACLE_BIN, '--version'], - stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=15) - except OSError: + _probe = subprocess.run([ORACLE_BIN, '--version'], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=15) + if _probe.returncode != 0: + ORACLE_BIN = None + except (OSError, subprocess.TimeoutExpired): ORACLE_BIN = None TYPES = ('rel-within', 'rel-outside', 'rel-transits', 'abs-outside', 'abs-inside')