From 2341a27f63e662353ba723fc7b9f0e66777200b5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Mar 2022 23:05:42 +0530 Subject: [PATCH] ... --- kittens/ssh/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index 230d76533..23d94c85b 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -406,19 +406,19 @@ def get_remote_command( # login shell with -c. If the user has a non POSIX login shell it might # have different escaping semantics and syntax, so the command it should # execute has to be as simple as possible, basically of the form - # interpreter -c wrapper_cmd escaped_bootstrap_script - # The wrapper_cmd is responsible for unescaping the bootstrap script and + # interpreter -c unwrap_script escaped_bootstrap_script + # The unwrap_script is responsible for unescaping the bootstrap script and # executing it. if is_python: es = standard_b64encode(sh_script.encode('utf-8')).decode('ascii') - wrapper_cmd = '''"import base64, sys; eval(compile(base64.standard_b64decode(sys.argv[-1]), 'bootstrap.py', 'exec'))"''' + unwrap_script = '''"import base64, sys; eval(compile(base64.standard_b64decode(sys.argv[-1]), 'bootstrap.py', 'exec'))"''' else: # We cant rely on base64 being available on the remote system, so instead # we quote the bootstrap script by replacing ' and \ with \v and \f and # surrounding with ' es = "'" + sh_script.replace("'", '\v').replace('\\', '\f') + "'" - wrapper_cmd = r"""'eval "$(echo "$0" | tr \\\v\\\f \\\047\\\134)"' """ - return [interpreter, '-c', wrapper_cmd, es] + unwrap_script = r"""'eval "$(echo "$0" | tr \\\v\\\f \\\047\\\134)"' """ + return [interpreter, '-c', unwrap_script, es] def main(args: List[str]) -> NoReturn: