harden macOS networking port

This commit is contained in:
drjones
2026-05-23 22:09:43 -07:00
parent 1f5e63ca1f
commit 35899ba1d1
24 changed files with 581 additions and 742 deletions

View File

@@ -303,6 +303,19 @@ def migrate(raw: dict) -> dict:
def sanitize_settings(s: Settings) -> tuple[Settings, bool]:
"""Clamp invalid values from hand-edited JSON. Returns (settings, changed)."""
changed = False
if sys.platform != "win32":
unsupported = (
"kill_switch_enabled",
"mac_spoof_enabled",
"mac_rotate_on_chain_rotate",
"harden_webrtc_enabled",
"lan_lockdown_enabled",
"telemetry_kill_enabled",
)
for name in unsupported:
if bool(getattr(s, name, False)):
setattr(s, name, False)
changed = True
try:
cl = int(s.chain_length)
if not (1 <= cl <= 8):