From 9d1aff43fc498ad284bd1187e6ea4c5a1f39d726 Mon Sep 17 00:00:00 2001 From: Mitul16 Date: Wed, 16 Feb 2022 15:50:19 +0530 Subject: [PATCH] fix: Fixes issue #245, incorrect 'shlex.join' usage The issue was being caused by the `args` list containing non-str type objects (e.g. RemotePath(...)) --- pwncat/platform/linux.py | 2 +- pwncat/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pwncat/platform/linux.py b/pwncat/platform/linux.py index d259d9e..52b0f28 100644 --- a/pwncat/platform/linux.py +++ b/pwncat/platform/linux.py @@ -1111,7 +1111,7 @@ class Linux(Platform): ) if isinstance(args, list): - command = shlex.join(args) + command = shlex.join(str(arg) for arg in args) elif isinstance(args, str): command = args else: diff --git a/pwncat/util.py b/pwncat/util.py index a3b8a56..9beb52d 100644 --- a/pwncat/util.py +++ b/pwncat/util.py @@ -146,7 +146,7 @@ def human_readable_delta(seconds): def join(argv: List[str]): - """Join the string much line shlex.join, except assume that each token + """Join the string much like shlex.join, except assume that each token is expecting double quotes. This allows variable references within the tokens."""