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

Move agent_named_pipe_name into its own source file.

It's used by server and client, so it seems silly to have it live in
the client code.
This commit is contained in:
Simon Tatham 2022-01-03 11:24:29 +00:00
parent 2a36f968e9
commit d0b609c68a
3 changed files with 18 additions and 11 deletions

View File

@ -1,6 +1,7 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_sources_from_current_dir(utils
utils/agent_named_pipe_name.c
utils/arm_arch_queries.c
utils/cryptoapi.c
utils/defaults.c

View File

@ -123,17 +123,6 @@ static void wm_copydata_agent_query(strbuf *query, void **out, int *outlen)
LocalFree(psd);
}
char *agent_named_pipe_name(void)
{
char *username, *suffix, *pipename;
username = get_username();
suffix = capi_obfuscate_string("Pageant");
pipename = dupprintf("\\\\.\\pipe\\pageant.%s.%s", username, suffix);
sfree(username);
sfree(suffix);
return pipename;
}
Socket *agent_connect(Plug *plug)
{
char *pipename = agent_named_pipe_name();

View File

@ -0,0 +1,17 @@
/*
* Return the full pathname of the named pipe Pageant will listen on.
* Used by both the Pageant server code and client code.
*/
#include "putty.h"
#include "cryptoapi.h"
char *agent_named_pipe_name(void)
{
char *username = get_username();
char *suffix = capi_obfuscate_string("Pageant");
char *pipename = dupprintf("\\\\.\\pipe\\pageant.%s.%s", username, suffix);
sfree(username);
sfree(suffix);
return pipename;
}