From eb63a6869a66d75237270b0a598a61cd93f06738 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Sun, 18 Sep 2022 02:29:53 +0200 Subject: [PATCH] binfmt: fix up unnecessary shell and missing quoting at once --- binfmt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binfmt.py b/binfmt.py index 3161458..0a7c3bd 100644 --- a/binfmt.py +++ b/binfmt.py @@ -68,7 +68,7 @@ def register(arch: Arch): # Register in binfmt_misc logging.info(f"Registering qemu binfmt ({arch})") - run_root_cmd(["sh", "-c", f'echo "{code}" > {register} 2>/dev/null']) + run_root_cmd(f'echo "{code}" > {register} 2>/dev/null') if not is_registered(arch): logging.debug(f'binfmt line: {code}') raise Exception(f'Failed to register qemu-user for {arch} with binfmt_misc, {binfmt}/{info["name"]} not found') @@ -82,4 +82,4 @@ def unregister(arch): if not os.path.exists(binfmt_file): return logging.info(f"Unregistering qemu binfmt ({arch})") - run_root_cmd(["sh", "-c", f"echo -1 > {binfmt_file}"]) + run_root_cmd(f"echo -1 > {binfmt_file}")