From 6e5d70b648c007dbfeb015db91e49640e44a0c9f Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 1 Aug 2022 12:31:29 +0900 Subject: [PATCH] Add call to GetNamedPipeClientProcessId for newer Windows. Signed-off-by: NIIBE Yutaka --- agent/gpg-agent.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 9ef00cb9d..5b3a78519 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -2818,6 +2818,16 @@ win32_openssh_thread (void *arg) break; } +#if _WIN32_WINNT >= 0x600 + if (!GetNamedPipeClientProcessId (pipe, &ctrl->client_pid)) + log_info ("failed to get client process id: %ld\n", GetLastError ()); + else + { + log_info ("PID: %ld\n", ctrl->client_pid); + ctrl->client_uid = -1; + } +#endif + ctrl->session_env = session_env_new (); if (!ctrl->session_env) {