mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 05:12:11 +03:00
resolveSudoSpawn() drops the `sudo -S` prefix when already root, when sudo is not installed (slim containers) or under OMNIROUTE_NO_SUDO (#6122), so the spawned command is `tee` rather than `sudo` in those environments. The three addDNSEntries assertions hardcoded `sudo` and failed whenever the suite ran as root. Assert the effective invocation (tee -a <hosts file>) instead, still checking the -S password flag when elevation is actually in play. Proof: with OMNIROUTE_NO_SUDO=1 the file went 3 failing -> 8 passing; the unelevated (sudo) path stays 8 passing.