From 60c935001071fb22bd051bfcd1d1e79b16157067 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 12 Jul 2023 20:48:48 +0100 Subject: [PATCH] Windows Pageant: quote the pipe path in OpenSSH config fragment. The pathname of Pageant's named pipe includes the name of the user running it. And Windows usernames are allowed to have spaces in! So the pipe pathname may also have a space, in which case Windows OpenSSH will interpret the spacey pathname as an invalid first half followed by a trailing garbage word. A user reports that quoting the filename makes this work. Since double quotes are an illegal Windows filename character, I think it should therefore do no harm to quote it unconditionally, which is the easiest fix. --- windows/pageant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/pageant.c b/windows/pageant.c index c2380954..22775c82 100644 --- a/windows/pageant.c +++ b/windows/pageant.c @@ -1741,7 +1741,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) MB_ICONERROR | MB_OK); return 1; } - fprintf(fp, "IdentityAgent %s\n", pipename); + fprintf(fp, "IdentityAgent \"%s\"\n", pipename); fclose(fp); }