Skip to content

Commit 795b52e

Browse files
committed
Compare with AGENT_PIPE_ID
1 parent 36e5db5 commit 795b52e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/win32/win32compat/w32fd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,11 @@ w32_afunix_socket(struct sockaddr_un* addr)
326326
a AF_UNIX socket if ssh forwarding is enabled. If the addr->sun_path is the
327327
the well known named pipe, we open the socket with w32_fileio.
328328
*/
329-
if(strcmp(addr->sun_path, "\\\\.\\pipe\\openssh-ssh-agent") == 0)
329+
int len = wcslen(AGENT_PIPE_ID);
330+
char* pipeid = (char*)malloc(len + 1);
331+
memset(pipeid, 0, len + 1);
332+
333+
if(wcstombs(pipeid, AGENT_PIPE_ID, len + 1) == (size_t) -1 && strcmp(addr->sun_path, pipeid) == 0)
330334
return w32_fileio_socket(SOCK_STREAM, 0);
331335
else
332336
return w32_unix_socket(SOCK_STREAM, 0);

0 commit comments

Comments
 (0)