aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-10-24 08:40:42 +0000
committerAndre Heinecke <[email protected]>2018-11-12 12:54:26 +0000
commit678e4706ee614a6b7e543e2a80072d75405dd4db (patch)
tree0f62c1fdae0d90adf4d5d5e00ce0bfcf3caae90b /dirmngr/server.c
parentcommon: Prepare for parsing mail sub-addresses. (diff)
downloadgnupg-678e4706ee614a6b7e543e2a80072d75405dd4db.tar.gz
gnupg-678e4706ee614a6b7e543e2a80072d75405dd4db.zip
dirmngr: Add FLUSHCRLs command
Summary: * dirmngr/crlcache.c (crl_cache_flush): Also deinit the cache. * dirmngr/server.c (hlp_flushcrls, cmd_flushcrls): New. (register_commands): Add FLUSHCRLS. -- This allows it to flush the CRL cache of a running dirmngr server. This can be useful to debug / analyze CRL issues. GnuPG-Bug-Id: T3967 Differential Revision: https://dev.gnupg.org/D469 Signed-off-by: Andre Heinecke <[email protected]> (cherry picked from commit 00321a025f90990a71b60b4689ede1f38fbde347)
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r--dirmngr/server.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c
index a21e1abb6..ac2562031 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -2689,6 +2689,20 @@ cmd_reloaddirmngr (assuan_context_t ctx, char *line)
}
+static const char hlp_flushcrls[] =
+ "FLUSHCRLS\n"
+ "\n"
+ "Remove all cached CRLs from memory and\n"
+ "the file system.";
+static gpg_error_t
+cmd_flushcrls (assuan_context_t ctx, char *line)
+{
+ (void)line;
+
+ return leave_cmd (ctx, crl_cache_flush () ? GPG_ERR_GENERAL : 0);
+}
+
+
/* Tell the assuan library about our commands. */
static int
@@ -2719,6 +2733,7 @@ register_commands (assuan_context_t ctx)
{ "LOADSWDB", cmd_loadswdb, hlp_loadswdb },
{ "KILLDIRMNGR",cmd_killdirmngr,hlp_killdirmngr },
{ "RELOADDIRMNGR",cmd_reloaddirmngr,hlp_reloaddirmngr },
+ { "FLUSHCRLS", cmd_flushcrls, hlp_flushcrls },
{ NULL, NULL }
};
int i, j, rc;