Files
spine/.github/workflows
Thomas Vincent 78f6670597 fix(poller): [1.2.x] validate endpoints timeouts uptimes and script output (#661)
Consecutive SNMP items with the same credentials can target different
hostnames or require different timeouts. Include hostname and timeout in
the batch key so each endpoint gets its own session. External scripts
also read one byte less than the allocated buffer, which makes a full
truncated response indistinguishable from a complete value. Read the
full capacity once and return U for a full buffer or embedded NUL.

Uptimes must be whole unsigned counters. Reject decimal, negative and
overflowing responses and check seconds-to-centiseconds conversion
before multiplication. Invalid values cannot advance reindex state.

Backports the confirmed bugs fixed in #641. Keeps the maintenance
branch’s single-read response contract, timeout handling and nonblocking
child reaping. Changes poller.c and extends the existing maintenance CI
branch filter to stacked fix branches. Release notes are collected in
#664.

Validation: native build and version smoke test passed through mise.
Compiled production hostname comparisons reject the old behavior and
pass with the fix. A probe linked to the maintenance production objects
passed short output, the maximum terminated value, overflow, embedded
NUL and a response whose child keeps stdout open; the last case returned
in under 0.5 seconds. The probe substitutes only semaphore boundaries
because macOS does not support the legacy unnamed semaphore
implementation. No database or live device was contacted. The modified
file passed the flawfinder critical gate.

Additional validation: the compiled maintenance timeout comparison fails
before the fix and passes afterward. Eleven production uptime parser
boundary cases pass under ASan/UBSan. The native build and all five
existing script-output probes still pass.

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-10-14 10:10:38 -04:00
..