Skip to content

Commit af8d1dd

Browse files
authored
Merge pull request #450 from kimocoder/claude/setup-wifite2-yGF8L
Fix Process.call() passing string commands to Popen without splitting
2 parents e112373 + 8d1d034 commit af8d1dd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

wifite/util/interface_manager.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,9 +1136,12 @@ def select_ap_interface(preferred=None) -> Optional[str]:
11361136

11371137
def __del__(self):
11381138
"""Cleanup on deletion."""
1139-
import contextlib
1140-
with contextlib.suppress(Exception):
1141-
self.cleanup_all()
1139+
try:
1140+
import contextlib
1141+
with contextlib.suppress(Exception):
1142+
self.cleanup_all()
1143+
except ImportError:
1144+
pass
11421145

11431146
# ========================================================================
11441147
# Interface Detection and Capability Checking (Task 2)

wifite/util/process.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ def devnull():
108108
def call(command, cwd=None, shell=False):
109109
""" Calls a command (either string or list of args). Returns (stdout, stderr) """
110110
if isinstance(command, str) and not shell:
111-
# Only enable shell mode if explicitly requested
111+
# Split string commands into list of args for Popen when not using shell mode
112112
if Configuration.verbose > 1:
113113
Color.pe(f'\n {{C}}[?]{{W}} Executing: {{B}}{command}{{W}}')
114+
command = command.split()
114115
elif shell:
115116
if Configuration.verbose > 1:
116117
Color.pe(f'\n {{C}}[?] {{W}} Executing (Shell): {{B}}{command}{{W}}')

0 commit comments

Comments
 (0)