Skip to content
Snippets Groups Projects
Commit 17371e0d authored by Simon Tatham's avatar Simon Tatham
Browse files

Fix named_pipe_agent_exists(), which just didn't work.

GetFileType() takes a HANDLE, not a pathname. So passing it the
pathname of the agent named pipe would never have worked at all.

I hadn't noticed, because the only call to that function logical-ORs
its return value with that of wm_copydata_agent_exists(), and the
latter _does_ work.

So if you're running true Pageant, which presents both IPC interfaces,
then there's no problem. But if a Pageant-emulating system wanted to
present only the named-pipe version, then we wouldn't have detected
it. Now we should do.
parent f69cf86a
No related branches found
No related tags found
No related merge requests found
......@@ -153,9 +153,13 @@ Socket *agent_connect(Plug *plug)
static bool named_pipe_agent_exists(void)
{
char *pipename = agent_named_pipe_name();
DWORD type = GetFileType(pipename);
WIN32_FIND_DATA data;
HANDLE ffh = FindFirstFile(pipename, &data);
sfree(pipename);
return type == FILE_TYPE_PIPE;
if (ffh == INVALID_HANDLE_VALUE)
return false;
FindClose(ffh);
return true;
}
bool agent_exists(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment