diff options
author | Werner Koch <[email protected]> | 2007-02-14 16:27:55 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2007-02-14 16:27:55 +0000 |
commit | 5240d014f87974ae89d792458b63769b950da20f (patch) | |
tree | 22ff17214a36dafacaaf89deea94ad7a6d3e2335 /agent/call-pinentry.c | |
parent | * export.c (do_export_stream): Allow reset-subkey-passwd along (diff) | |
download | gnupg-5240d014f87974ae89d792458b63769b950da20f.tar.gz gnupg-5240d014f87974ae89d792458b63769b950da20f.zip |
agent/
* gpg-agent.c: New option --pinentry-touch-file.
(get_agent_socket_name): New.
* agent.h (opt): Add pinentry_touch_file.
* call-pinentry.c (start_pinentry): Send new option to the
pinentry.
Diffstat (limited to '')
-rw-r--r-- | agent/call-pinentry.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index bb3b5deb5..8b527b2d5 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -181,6 +181,7 @@ start_pinentry (ctrl_t ctrl) int no_close_list[3]; int i; pth_event_t evt; + const char *tmpstr; evt = pth_event (PTH_EVENT_TIME, pth_timeout (LOCK_TIMEOUT, 0)); if (!pth_mutex_acquire (&entry_lock, 0, evt)) @@ -297,6 +298,30 @@ start_pinentry (ctrl_t ctrl) if (rc) return unlock_pinentry (rc); } + + + /* Tell the pinentry the name of a file it shall touch after having + messed with the tty. This is optional and only supported by + newer pinentries and thus we do no error checking. */ + tmpstr = opt.pinentry_touch_file; + if (tmpstr && !strcmp (tmpstr, "/dev/null")) + tmpstr = NULL; + else if (!tmpstr) + tmpstr = get_agent_socket_name (); + if (tmpstr) + { + char *optstr; + + if (asprintf (&optstr, "OPTION touch-file=%s", tmpstr ) < 0 ) + ; + else + { + assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL, + NULL); + free (optstr); + } + } + return 0; } |