From 24b055b1b826f94c67600818eab261335ad78683 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 4 Oct 2022 15:44:29 +0100 Subject: [PATCH] Ensure key_path is quoted in GIT_SSH_COMMAND in case of spaces in pathname --- .../runtime/lib/storage/localfilesystem/projects/git/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js index f9d809231..111365307 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/index.js @@ -106,7 +106,7 @@ function runGitCommandWithSSHCommand(args,cwd,auth,emit) { commandEnv.GIT_SSH = path.join(__dirname,"node-red-ssh.sh"); commandEnv.NODE_RED_KEY_FILE=auth.key_path; // GIT_SSH_COMMAND - added in git 2.3.0 - commandEnv.GIT_SSH_COMMAND = "ssh -i " + auth.key_path + " -F /dev/null"; + commandEnv.GIT_SSH_COMMAND = "ssh -i \"" + auth.key_path + "\" -F /dev/null"; // console.log('commandEnv:', commandEnv); return runGitCommand(args,cwd,commandEnv,emit).then( result => { rs.close();