Skip to content

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
Colossus14:script-robustness
Mar 17, 2026
Merged

fix: HTTP/1.0 for nc uploads, LC_ALL=C for binary grep, clearer BusyBox warning#37
Neo23x0 merged 3 commits intoNextronSystems:script-robustnessfrom
Colossus14:script-robustness

Conversation

@Colossus14
Copy link
Copy Markdown

Three fixes identified during code review:

#1 — HTTP/1.0 for nc uploads (ash script)
Changed HTTP/1.1HTTP/1.0 in the raw netcat POST. With HTTP/1.1, the server may return Transfer-Encoding: chunked, which the raw sed/grep response parser cannot decode. HTTP/1.0 guarantees a simple response.

#2LC_ALL=C on binary grep (both bash and ash scripts)
Prefixed grep -qF boundary collision checks with LC_ALL=C so 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).

Colossus14 and others added 3 commits March 15, 2026 14:05
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
@Neo23x0 Neo23x0 merged commit 07cd214 into NextronSystems:script-robustness Mar 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants