Skip to content

Commit

Permalink
Disallow usage of semicolons in run_in_new_terminal.
Browse files Browse the repository at this point in the history
Fixes #690
Fixes #635
  • Loading branch information
zachriggle committed Aug 24, 2016
1 parent 452605e commit ea94ee4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pwnlib/util/misc.py
Expand Up @@ -189,7 +189,6 @@ def run_in_new_terminal(command, terminal = None, args = None):
Returns:
None
"""

if not terminal:
Expand All @@ -214,8 +213,12 @@ def run_in_new_terminal(command, terminal = None, args = None):
argv = [terminal_path] + args

if isinstance(command, str):
if ';' in command:
log.error("Cannot use commands with semicolon. Create a script and invoke that directly.")
argv += [command]
elif isinstance(command, (list, tuple)):
if any(';' in c for c in command):
log.error("Cannot use commands with semicolon. Create a script and invoke that directly.")
argv += list(command)

log.debug("Launching a new terminal: %r" % argv)
Expand Down

0 comments on commit ea94ee4

Please sign in to comment.