From ca46f37f9b37d9f17b6d67103bdccab8aa827b15 Mon Sep 17 00:00:00 2001 From: lcian Date: Tue, 1 Oct 2024 20:58:45 +0200 Subject: [PATCH] fix: python2.7 compatibility --- pwnlib/commandline/template.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pwnlib/commandline/template.py b/pwnlib/commandline/template.py index fea680e55..b8fcd7120 100644 --- a/pwnlib/commandline/template.py +++ b/pwnlib/commandline/template.py @@ -53,11 +53,10 @@ def get_docker_image_libraries(): ldd_output = subprocess.check_output([ "docker", "run", - "--rm", - *(["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]), - image_sha, - *ldd_command, - ], + "--rm" + ] + (["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]) + [ + image_sha, + ] + ldd_command, shell=False ).decode() @@ -83,10 +82,9 @@ def get_docker_image_libraries(): "docker", "run", "--rm", - *(["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]), - image_sha, - *cat_command, - ], + ] + (["--privileged"] if is_jailed else ["--entrypoint", "/bin/sh"]) + [ + image_sha + ] + cat_command, shell=False ) open(basename, "wb").write(contents)