mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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 <wk@gnupg.org>
This commit is contained in:
parent
7052a0d77c
commit
309f464a59
5 changed files with 110 additions and 1 deletions
|
@ -3288,6 +3288,8 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd)
|
|||
|
||||
for (;;)
|
||||
{
|
||||
pid_t client_pid;
|
||||
|
||||
rc = assuan_accept (ctx);
|
||||
if (gpg_err_code (rc) == GPG_ERR_EOF || rc == -1)
|
||||
{
|
||||
|
@ -3299,7 +3301,12 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd)
|
|||
break;
|
||||
}
|
||||
|
||||
ctrl->server_local->connect_from_self = (assuan_get_pid (ctx)==getpid ());
|
||||
client_pid = assuan_get_pid (ctx);
|
||||
ctrl->server_local->connect_from_self = (client_pid == getpid ());
|
||||
if (client_pid != ASSUAN_INVALID_PID)
|
||||
ctrl->client_pid = (unsigned long)client_pid;
|
||||
else
|
||||
ctrl->client_pid = 0;
|
||||
|
||||
rc = assuan_process (ctx);
|
||||
if (rc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue