From 7faf45effcd47d2d04d35090a1e01a1dbb99ec70 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 6 Oct 2015 13:55:38 +0200 Subject: dirmngr: Make commands RELOADDIRMNGR and KILLDIRMNGR work properly. * dirmngr/server.c (cmd_killdirmngr): Set assuan close flag. (cmd_reloaddirmngr): Use check_owner_permission. Signed-off-by: Werner Koch --- dirmngr/server.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'dirmngr') diff --git a/dirmngr/server.c b/dirmngr/server.c index 5400a9876..63a5cd825 100644 --- a/dirmngr/server.c +++ b/dirmngr/server.c @@ -2120,6 +2120,7 @@ cmd_killdirmngr (assuan_context_t ctx, char *line) if (!err) { ctrl->server_local->stopme = 1; + assuan_set_flag (ctx, ASSUAN_FORCE_CLOSE, 1); err = gpg_error (GPG_ERR_EOF); } return err; @@ -2141,14 +2142,12 @@ cmd_reloaddirmngr (assuan_context_t ctx, char *line) { #ifndef HAVE_W32_SYSTEM { - gpg_err_code_t ec; - assuan_peercred_t cred; - - ec = gpg_err_code (assuan_get_peercred (ctx, &cred)); - if (!ec && cred->uid) - ec = GPG_ERR_EPERM; /* Only root may terminate. */ - if (ec) - return set_error (ec, "no permission to reload this process"); + gpg_error_t err; + + err = check_owner_permission (ctx, + "no permission to reload this process"); + if (err) + return err; } #endif } -- cgit v1.2.3