summaryrefslogtreecommitdiffstats
path: root/pgp.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-06-06 18:38:46 -0700
committerKevin McCarthy <kevin@8t8.us>2017-06-06 18:38:46 -0700
commitb560c4e2fbe501cb0ac7adf84feed9d0c6713533 (patch)
tree1d36e1e33c3fe52f8fc543427d2d65fdda6c353c /pgp.c
parent74a49627fc283c9ea896a812eacfb562d1f262fe (diff)
Move setting of GPG_TTY to mutt_init(). (see #3948)
This allows other programs mutt runs to use the ncurses pinentry if needed.
Diffstat (limited to 'pgp.c')
-rw-r--r--pgp.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/pgp.c b/pgp.c
index 653905f0..5c17e94a 100644
--- a/pgp.c
+++ b/pgp.c
@@ -105,21 +105,13 @@ void pgp_forget_passphrase (void)
mutt_message _("PGP passphrase forgotten.");
}
+/* This function used to do more: check GPG_AGENT_INFO,
+ * set GPG_TTY. GPG_AGENT_INFO is no longer exported, and GPG_TTY
+ * is now set in mutt_init().
+ */
int pgp_use_gpg_agent (void)
{
- char *tty;
-
- /* GnuPG 2.1 no longer exports GPG_AGENT_INFO */
- if (!option (OPTUSEGPGAGENT))
- return 0;
-
- if ((tty = ttyname(0)))
- {
- setenv("GPG_TTY", tty, 0);
- mutt_envlist_set ("GPG_TTY", tty, 0);
- }
-
- return 1;
+ return option (OPTUSEGPGAGENT);
}
static pgp_key_t _pgp_parent(pgp_key_t k)