fix: HTTP/1.0 for nc uploads, LC_ALL=C for binary grep, clearer BusyBox warning#37
Merged
Neo23x0 merged 3 commits intoNextronSystems:script-robustnessfrom Mar 17, 2026
Conversation
Detection tests: - Fix retry-on-late-server test timing: reduce stub start delay from 1s to 0.3s so all collectors (including PS2/PS3) have time to connect on their second begin-marker attempt at t=2s. New operational test suite (run_operational_tests.sh): - Collection markers: begin/end with matching scan_id and stats - Interrupted marker: SIGINT sends interrupted/end marker - Dry-run mode: no uploads, file listed in output (bash/python/perl) - Source identifier: --source sets source field in markers - Sync mode: --sync uses /api/check (bash/python/perl) - Multiple directories: scanning multiple dirs (bash/python) - 503 back-pressure: Retry-After handling across all collectors - Progress reporting: --progress flag works without crash - Syslog logging: --syslog works (bash only) - wget fallback: tested when curl/wget can be isolated Results: 35 passed, 0 failed, 20 skipped (skips are N/A features)
Previously, repeated --dir flags would overwrite each other due to GetOptions binding to a scalar. Changed to array binding so multiple directories are accumulated and all scanned sequentially. Usage: --dir /path1 --dir /path2 --dir /path3 Matches bash collector behavior (--dir is repeatable).
…ox warning - nc upload: HTTP/1.1 → HTTP/1.0 to avoid chunked transfer-encoding that breaks raw response parsing with sed/grep - boundary check: prefix grep -qF with LC_ALL=C to handle binary files reliably across GNU grep implementations - BusyBox wget: expanded warning to explicitly state binary files will be silently corrupted and recommend installing curl/GNU wget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes identified during code review:
#1 — HTTP/1.0 for nc uploads (ash script)
Changed
HTTP/1.1→HTTP/1.0in the raw netcat POST. With HTTP/1.1, the server may returnTransfer-Encoding: chunked, which the raw sed/grep response parser cannot decode. HTTP/1.0 guarantees a simple response.#2 —
LC_ALL=Con binary grep (both bash and ash scripts)Prefixed
grep -qFboundary collision checks withLC_ALL=Cso GNU grep handles binary file content reliably regardless of locale settings.#3 — Expanded BusyBox wget warning (ash script)
Replaced the single-line warning with three explicit lines: what happens (truncation at first NUL byte), what's affected (EXE, DLL, ZIP, etc.), and what to do about it (install curl or full GNU wget).