diff options
author | Werner Koch <[email protected]> | 2017-02-03 16:13:08 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-02-03 16:13:08 +0000 |
commit | 309f464a5952c7d7504b875bf4853914b1242346 (patch) | |
tree | 7c81ec6fbd9c8f02bfcbef9dbcdd3f9323654b92 /agent/call-pinentry.c | |
parent | gpg: More diagnostics for a launched pinentry. (diff) | |
download | gnupg-309f464a5952c7d7504b875bf4853914b1242346.tar.gz gnupg-309f464a5952c7d7504b875bf4853914b1242346.zip |
agent: Tell the Pinentry the client's pid.
* configure.ac: Check for SO_PEERCRED et al.
* agent/agent.h (server_control_s): Add field 'client_pid'.
* agent/command.c (start_command_handler): Set CLIENT_PID.
* agent/command-ssh.c (get_client_pid): New.
(start_command_handler_ssh): Set CLIENT_PID.
* agent/call-pinentry.c (start_pinentry): Tell Pinentry the client-pid.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/call-pinentry.c')
-rw-r--r-- | agent/call-pinentry.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index 2bebee205..384b23a64 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -540,6 +540,20 @@ start_pinentry (ctrl_t ctrl) } } + /* Tell Pinentry about our client. */ + if (ctrl->client_pid) + { + char *optstr; + if ((optstr = xtryasprintf ("OPTION owner=%lu", ctrl->client_pid))) + { + assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL, + NULL); + /* We ignore errors because this is just a fancy thing and + older pinentries do not support this feature. */ + xfree (optstr); + } + } + /* Ask the pinentry for its version and flavor and store that as a * string in MB. This information is useful for helping users to |