Files
mcde/lib
lotherkandClaude Sonnet 5.5 5b2f0f4e8e McdeSys: the Wi-Fi input checks are a function the tests can reach (t0081, a)
The checks that keep a typed network name and password out of
wpa_supplicant.conf and rc.conf (netbsd.c, mcde_sys_wifi_join) sat inline in
the NetBSD branch, behind geteuid() != 0: no test of the build could run them.
They are mcde_sys_wifi_config_ok in net.c now (one implementation for the file
that is built on every system), the NetBSD branch calls it, and the new
test_netinput.c runs 46 checks as an ordinary user: name 1..32 bytes (33
refused), passphrase none or 8..63 (7 and 64 refused), a quote, a backslash or
a newline in either (also a whole injected "network={" block), the interface
name (lower case and digits only), plus the two helpers net.c already had
without a test: mcde_sys_net_ifname_ok and mcde_sys_net_prefix (a
non-contiguous netmask, trailing text).

One behaviour change, found by writing the table: an EMPTY interface name
passed the inline check (strspn("") == strlen("")) and would have given
wpa_supplicant_flags="-B -s -i  -D bsd ..."; it is refused now.

Measured: make check 6 of 6.  Mutation check: with the SSID limit raised to 33,
with the empty-name guard removed, with the passphrase minimum 7, and with the
quote check left out of the passphrase, test_netinput fails (1, 1, 1 and 2
cases); the real code passes.  netbsd.c and net.c compile for NetBSD
(x86_64--netbsd-gcc) without a diagnostic.  Not run on NetBSD.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:24:54 +00:00
..