aboutsummaryrefslogtreecommitdiffstats
path: root/g10/call-agent.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-11-28 08:44:19 +0000
committerWerner Koch <[email protected]>2014-11-28 08:44:19 +0000
commit7aee3579be6e24a1aa280e75615fc3a11ceef960 (patch)
treef8ae9f5c3cf5b30d7bfa6d31e37417d9c823996b /g10/call-agent.c
parentgpg-agent: Add restricted connection feature. (diff)
downloadgnupg-7aee3579be6e24a1aa280e75615fc3a11ceef960.tar.gz
gnupg-7aee3579be6e24a1aa280e75615fc3a11ceef960.zip
Add option --no-autostart.
* g10/gpg.c: Add option --no-autostart. * sm/gpgsm.c: Ditto. * g10/options.h (opt): Add field autostart. * sm/gpgsm.h (opt): Ditto. * g10/call-agent.c (start_agent): Print note if agent was not autostarted. * sm/call-agent.c (start_agent): Ditto. * g10/call-dirmngr.c (create_context): Likewise. * sm/call-dirmngr.c (start_dirmngr_ext): Ditto. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r--g10/call-agent.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 74d8cec28..f5c943d70 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -285,9 +285,19 @@ start_agent (ctrl_t ctrl, int for_card)
opt.agent_program,
opt.lc_ctype, opt.lc_messages,
opt.session_env,
- 1, opt.verbose, DBG_ASSUAN,
+ opt.autostart, opt.verbose, DBG_ASSUAN,
NULL, NULL);
- if (!rc)
+ if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT)
+ {
+ static int shown;
+
+ if (!shown)
+ {
+ shown = 1;
+ log_info (_("no gpg-agent running in this session\n"));
+ }
+ }
+ else if (!rc)
{
/* Tell the agent that we support Pinentry notifications.
No error checking so that it will work also with older