summaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-10-06 13:55:38 +0200
committerWerner Koch <wk@gnupg.org>2015-10-06 13:55:38 +0200
commit7faf45effcd47d2d04d35090a1e01a1dbb99ec70 (patch)
tree9a535011243730c40090de6ebbb81ff2b3614dba /dirmngr/server.c
parentpo: Typo fix in German translation. (diff)
downloadgnupg2-7faf45effcd47d2d04d35090a1e01a1dbb99ec70.tar.xz
gnupg2-7faf45effcd47d2d04d35090a1e01a1dbb99ec70.zip
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 <wk@gnupg.org>
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r--dirmngr/server.c15
1 files changed, 7 insertions, 8 deletions
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
}