Skip to content

Commit

Permalink
Compare with AGENT_PIPE_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
bilby91 committed Apr 19, 2023
1 parent 36e5db5 commit fd096f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/win32/win32compat/w32fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ w32_afunix_socket(struct sockaddr_un* addr)
a AF_UNIX socket if ssh forwarding is enabled. If the addr->sun_path is the
the well known named pipe, we open the socket with w32_fileio.
*/
if(strcmp(addr->sun_path, "\\\\.\\pipe\\openssh-ssh-agent") == 0)
int len = wcslen(AGENT_PIPE_ID);
char* pipeid = (char*)malloc(len + 1);
memset(pipeid, 0, len + 1);

if(wcstombs(pipeid, AGENT_PIPE_ID, len + 1) != (size_t) -1 && strcmp(addr->sun_path, pipeid) == 0)
return w32_fileio_socket(SOCK_STREAM, 0);
else
return w32_unix_socket(SOCK_STREAM, 0);
Expand Down

0 comments on commit fd096f5

Please sign in to comment.