Skip to content

Commit

Permalink
#4355 quote the command to prevent parsing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 13, 2024
1 parent d8d9301 commit bdbf53f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,11 +2493,19 @@ def handshake_complete(*_args) -> None:
i += 1
continue
attach_args.append(arg)
if WIN32 and not os.path.exists(abs_script_file) and not abs_script_file.lower().endswith(".exe"):
abs_script_file += ".exe"
if WIN32:
if not os.path.exists(abs_script_file) and not abs_script_file.lower().endswith(".exe"):
abs_script_file += ".exe"
# see ticket #4355,
# ensure that the script file is parsed correctly,
# even if it has spaces in it
abs_script_file = shlex.quote(abs_script_file)
attach_args[0] = abs_script_file
if is_debug_enabled("client"):
log = Logger("client")
log.info(f"reconnecting to {params} using script file {abs_script_file!r} and args={attach_args}")
log.info(f"reconnecting to {params}")
log.info(f" using script file {abs_script_file!r}")
log.info(f" args={attach_args}")
log.info(f" derived from {script_file!r} and {cmdline!r}")
try:
os.execv(abs_script_file, attach_args)
Expand Down

0 comments on commit bdbf53f

Please sign in to comment.