Commit 974896bf authored by Hardik Zinzuvadiya's avatar Hardik Zinzuvadiya
Browse files

Phase 13 (cont): Final os.system cleanup

- anonsurf.py: os.system("sudo anonsurf stop") → subprocess.run list form
- tool_manager.py: os.system(f"{priv}{cmd}") → subprocess.run(shell=True)
  (shell=True justified: cmd is from hardcoded PACKAGE_UPDATE_CMDS dict, not user input)
parent d1bcca56
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -24,8 +24,9 @@ class AnonymouslySurf(HackingTool):
        super().__init__([("Stop", self.stop)])

    def stop(self):
        import subprocess
        console.print("[bold magenta]Stopping Anonsurf...[/bold magenta]")
        os.system("sudo anonsurf stop")
        subprocess.run(["sudo", "anonsurf", "stop"])


class Multitor(HackingTool):
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@ class UpdateTool(HackingTool):
        cmd = PACKAGE_UPDATE_CMDS.get(mgr)
        if cmd:
            priv = "" if CURRENT_OS.system == "macos" else "sudo "
            os.system(f"{priv}{cmd}")
            # shell=True needed — cmd contains && chains; strings are hardcoded, not user input
            subprocess.run(f"{priv}{cmd}", shell=True, check=False)
        else:
            console.print("[warning]Unknown package manager — update manually.[/warning]")