summaryrefslogtreecommitdiffstats
path: root/tools/gpgconf-comp.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-07-01 06:07:22 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2019-07-01 06:07:22 +0200
commit7c877f942a344e7778005840ed7f3e20ace12f4a (patch)
treea187377dd2f0ef70f7cab05fbd24885539db2c12 /tools/gpgconf-comp.c
parentagent: Close a dialog cleanly when gpg/ssh is killed for CONFIRM. (diff)
downloadgnupg2-7c877f942a344e7778005840ed7f3e20ace12f4a.tar.xz
gnupg2-7c877f942a344e7778005840ed7f3e20ace12f4a.zip
tools: gpgconf: Killing order is children-first.
* tools/gpgconf-comp.c (gc_component_kill): Reverse the order. -- The order matters in a corner case; On a busy machine, there was a race condition between gpg-agent's running KILLAGENT command and its accepting incoming request on the socket. If a request by gpg-connect-agent was accepted, it resulted an error by sudden shutdown. This change of the order can remove such a race. Here, we know backend=0 is none. GnuPG-bug-id: 4577 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'tools/gpgconf-comp.c')
-rw-r--r--tools/gpgconf-comp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index 110f88975..628ca358f 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -1343,7 +1343,7 @@ gc_component_kill (int component)
}
/* Do the restart for the selected backends. */
- for (backend = 0; backend < GC_BACKEND_NR; backend++)
+ for (backend = GC_BACKEND_NR-1; backend; backend--)
{
if (runtime[backend] && gc_backend[backend].runtime_change)
(*gc_backend[backend].runtime_change) (1);