1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Windows Pageant: switch path separator in OpenSSH config.

A user reports, _just_ in time to make the 0.79 release, that changes
in the Windows port of OpenSSH from 8.9.x have made it unhappy with
the use of \ as a path separator in the 'IdentityAgent' config
directive. Switch to /, which is also accepted by earlier versions, so
it should work everywhere.
This commit is contained in:
Simon Tatham 2023-08-26 08:34:53 +01:00
parent 27f0140e5c
commit f9d09f41d1

View File

@ -1741,7 +1741,17 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
MB_ICONERROR | MB_OK);
return 1;
}
fprintf(fp, "IdentityAgent \"%s\"\n", pipename);
fputs("IdentityAgent \"", fp);
/* Some versions of Windows OpenSSH prefer / to \ as the path
* separator; others don't mind, but as far as we know, no
* version _objects_ to /, so we use it unconditionally. */
for (const char *p = pipename; *p; p++) {
char c = *p;
if (c == '\\')
c = '/';
fputc(c, fp);
}
fputs("\"\n", fp);
fclose(fp);
}