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>
## What
Adds `.github/instructions/instructions.md` (did not exist on this
branch) with a *Script and process execution design principles (do not
regress)* section codifying three invariants for script and PHP Script
Server execution:
1. One read attempt per command, no looping to EOF.
2. Never block the polling thread in `waitpid()` — single non-blocking
WNOHANG attempt, then hand off to an async sweep.
3. Script timeouts must go through `nft_popen()`/`nft_pchild()`
(pid-tracked), not a native `popen()`/`pclose()` fallback.
## Why
While investigating a reported poller slowdown, this branch's
`nft_pclose()` was found to do an unbounded blocking `waitpid()` on the
polling hot path. Writing these invariants down so future AI-assisted
changes to this branch don't reintroduce that or the related issues
found on develop (#614). Tracked in #632.
## What was tested
Docs-only change; no build/test impact.
Signed-off-by: TheWitness <thewitness@cacti.net>
The 1.2.x branch has no workflows, so PRs targeting it (e.g. #544's
crash/memory-safety fixes) get no build or analysis coverage. `ci.yml`
only exists on develop and only triggers there.
This ports develop's `ci.yml` to 1.2.x unchanged except the branch
filters: gcc + clang build matrix and flawfinder (critical-level gate).
Actions stay SHA-pinned.
Adding this lets #544 and future 1.2.x PRs build under both compilers
before merge.
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>