mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
agent: Fix the handling of socket takeover.
* agent/gpg-agent.c (handle_connections): Check the takeover when interrupted. (check_own_socket_thread): Kick the loop when detected. -- GnuPG-bug-id: 6692 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
95186ae92f
commit
b2826924ee
@ -3238,6 +3238,16 @@ handle_connections (gnupg_fd_t listen_fd,
|
|||||||
gnupg_sleep (1);
|
gnupg_sleep (1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (socket_takeover_detected)
|
||||||
|
{
|
||||||
|
/* We may not remove the socket as it is now in use by another
|
||||||
|
server. */
|
||||||
|
inhibit_socket_removal = 1;
|
||||||
|
shutdown_pending = 2;
|
||||||
|
log_info ("this process is useless - shutting down\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
/* Interrupt or timeout. Will be handled when calculating the
|
/* Interrupt or timeout. Will be handled when calculating the
|
||||||
next timeout. */
|
next timeout. */
|
||||||
@ -3274,15 +3284,6 @@ handle_connections (gnupg_fd_t listen_fd,
|
|||||||
log_info ("homedir has been removed - shutting down\n");
|
log_info ("homedir has been removed - shutting down\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (socket_takeover_detected)
|
|
||||||
{
|
|
||||||
/* We may not remove the socket as it is now in use by another
|
|
||||||
server. */
|
|
||||||
inhibit_socket_removal = 1;
|
|
||||||
shutdown_pending = 2;
|
|
||||||
log_info ("this process is useless - shutting down\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shutdown_pending)
|
if (!shutdown_pending)
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
@ -3440,6 +3441,7 @@ check_own_socket_thread (void *arg)
|
|||||||
|
|
||||||
xfree (sockname);
|
xfree (sockname);
|
||||||
socket_takeover_detected = 1;
|
socket_takeover_detected = 1;
|
||||||
|
agent_kick_the_loop ();
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user