harden macOS networking port
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user