mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-09-12 21:28:25 -04:00
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.
This commit is contained in:
1 parent
07a7a19790
commit
8a3a3e4de1
1 file changed
+11
-6
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user