agent: Stop scdaemon after reload when disable_scdaemon.

* agent/call-scd.c (agent_card_killscd): New.
* agent/gpg-agent.c (agent_sighup_action): Call agent_card_killscd.

--

GnuPG-bug-id: 4326
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2019-05-23 10:15:18 +09:00 committed by Werner Koch
parent 30f44957cc
commit 9ccdd59e4e
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
3 changed files with 13 additions and 0 deletions

View File

@ -597,6 +597,7 @@ int agent_card_scd (ctrl_t ctrl, const char *cmdline,
int (*getpin_cb)(void *, const char *,
const char *, char*, size_t),
void *getpin_cb_arg, void *assuan_context);
void agent_card_killscd (void);
/*-- learncard.c --*/

View File

@ -1324,3 +1324,12 @@ agent_card_scd (ctrl_t ctrl, const char *cmdline,
return unlock_scd (ctrl, 0);
}
void
agent_card_killscd (void)
{
if (primary_scd_ctx == NULL)
return;
assuan_transact (primary_scd_ctx, "KILLSCD",
NULL, NULL, NULL, NULL, NULL, NULL);
}

View File

@ -2434,6 +2434,9 @@ agent_sighup_action (void)
"pinentry" binary that one can be used in case the
"pinentry-basic" fallback was in use. */
gnupg_module_name_flush_some ();
if (opt.disable_scdaemon)
agent_card_killscd ();
}