From fc77f1065422278205a63626f34d104720026b40 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Mon, 8 Jul 2013 19:28:36 -0400 Subject: [PATCH] Have 'OPTION disable-pinentry' reset the gpg-agent --pinentry-mode. --- src/commands.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/commands.c b/src/commands.c index 88959bc9..6aa663cf 100644 --- a/src/commands.c +++ b/src/commands.c @@ -3275,6 +3275,21 @@ option_command (assuan_context_t ctx, char *line) client->flags |= FLAG_NO_PINENTRY; else client->flags &= ~FLAG_NO_PINENTRY; + +#ifdef WITH_AGENT + if (use_agent) + { + if (client->flags & FLAG_NO_PINENTRY) + rc = set_agent_option (client->crypto->agent, "pinentry-mode", + "loopback"); + else + rc = set_agent_option (client->crypto->agent, "pinentry-mode", + "ask"); + + if (rc) + return send_error (ctx, rc); + } +#endif } else return send_error (ctx, GPG_ERR_UNKNOWN_OPTION); -- 2.11.4.GIT