From 362ddcc7076dfc62c87d9b79a2e70c49e562f71a Mon Sep 17 00:00:00 2001 From: Michael Parks Date: Sun, 17 May 2020 00:41:56 -0600 Subject: [PATCH] Quote PATH when writing agent invocation script If the PATH contains spaces, the agent invocation script will fail parsing. This quotes the variable so that spaces don't break the script. --- libagent/gpg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libagent/gpg/__init__.py b/libagent/gpg/__init__.py index 79f6019..3711bc8 100644 --- a/libagent/gpg/__init__.py +++ b/libagent/gpg/__init__.py @@ -143,7 +143,7 @@ def run_init(device_type, args): # Prepare GPG agent invocation script (to pass the PATH from environment). with open(os.path.join(homedir, 'run-agent.sh'), 'w') as f: f.write(r"""#!/bin/sh -export PATH={0} +export PATH="{0}" {1} \ -vv \ --pin-entry-binary={pin_entry_binary} \