summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-05-23 03:15:18 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2019-05-23 03:15:18 +0200
commit7158a5696dc84e1ebd2b523ab83a43a32423181d (patch)
tree0ef2d86fdd7bea7416db6adbdf9c1d184afc23ea /agent
parentg10: Copy expiredate from primary key when marked expired. (diff)
downloadgnupg2-7158a5696dc84e1ebd2b523ab83a43a32423181d.tar.xz
gnupg2-7158a5696dc84e1ebd2b523ab83a43a32423181d.zip
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>
Diffstat (limited to 'agent')
-rw-r--r--agent/agent.h1
-rw-r--r--agent/call-scd.c9
-rw-r--r--agent/gpg-agent.c3
3 files changed, 13 insertions, 0 deletions
diff --git a/agent/agent.h b/agent/agent.h
index 77672bd50..ec8370c4b 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -618,6 +618,7 @@ int agent_card_scd (ctrl_t ctrl, const char *cmdline,
void agent_card_free_keyinfo (struct card_key_info_s *l);
gpg_error_t agent_card_keyinfo (ctrl_t ctrl, const char *keygrip,
struct card_key_info_s **result);
+void agent_card_killscd (void);
/*-- learncard.c --*/
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 5b53b0223..a96f5b783 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -1515,3 +1515,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);
+}
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index d3fe7fe56..57d5a459c 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -2441,6 +2441,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 ();
}