mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-22 14:57:02 +01:00
agent: kill pinentry by SIGINT, fixing a bug to be killed by SIGINT.
* agent/call-pinentry.c (atfork_cb): Reset signal mask and signal handler for child process. (agent_popup_message_stop): Send SIGINT (was: SIGKILL). -- pinentry-curses should be killed by SIGINT, so that it can reset terminal settings, but it didn't work.
This commit is contained in:
parent
3cfe527fa5
commit
42dd3956cc
@ -170,6 +170,16 @@ static void
|
|||||||
atfork_cb (void *opaque, int where)
|
atfork_cb (void *opaque, int where)
|
||||||
{
|
{
|
||||||
ctrl_t ctrl = opaque;
|
ctrl_t ctrl = opaque;
|
||||||
|
#ifndef HAVE_W32_SYSTEM
|
||||||
|
struct sigaction sa;
|
||||||
|
|
||||||
|
/* Pop up message should be able to be killed by SIGINT. */
|
||||||
|
sigemptyset (&sa.sa_mask);
|
||||||
|
sa.sa_handler = SIG_DFL;
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sigaction (SIGINT, &sa, NULL);
|
||||||
|
sigprocmask (SIG_SETMASK, &sa.sa_mask, NULL); /* Unblock all signals. */
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!where)
|
if (!where)
|
||||||
{
|
{
|
||||||
@ -1159,8 +1169,7 @@ agent_popup_message_stop (ctrl_t ctrl)
|
|||||||
assuan_set_flag (entry_ctx, ASSUAN_NO_WAITPID, 1);
|
assuan_set_flag (entry_ctx, ASSUAN_NO_WAITPID, 1);
|
||||||
}
|
}
|
||||||
else if (pid > 0)
|
else if (pid > 0)
|
||||||
kill (pid, SIGKILL); /* Need to use SIGKILL due to bad
|
kill (pid, SIGINT);
|
||||||
interaction of SIGINT with Pth. */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Now wait for the thread to terminate. */
|
/* Now wait for the thread to terminate. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user