[Pkg-gnupg-commit] [gnupg2] 80/292: agent: Adjust supervised mode for the new default socket names.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Nov 21 06:31:28 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit dc059af1ff007842e2633e686c87d05daf1d45e3
Author: Werner Koch <wk at gnupg.org>
Date: Tue Oct 4 11:23:18 2016 +0200
agent: Adjust supervised mode for the new default socket names.
* agent/gpg-agent.c (main): In supervised mode do not provide default
socket names. Unset DISPLAY and INSIDE_EMACS. Use log_error and
agent_exit.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
agent/gpg-agent.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 9221dc3..3e938f5 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1244,10 +1244,10 @@ main (int argc, char **argv )
agent_exit (0);
}
- if (! opt.extra_socket)
- {
- opt.extra_socket = 1;
- }
+ if (is_supervised)
+ ;
+ else if (!opt.extra_socket)
+ opt.extra_socket = 1;
else if (socket_name_extra
&& (!strcmp (socket_name_extra, "none")
|| !strcmp (socket_name_extra, "/dev/null")))
@@ -1257,10 +1257,10 @@ main (int argc, char **argv )
socket_name_extra = NULL;
}
- if (! opt.browser_socket)
- {
- opt.browser_socket = 1;
- }
+ if (is_supervised)
+ ;
+ else if (!opt.browser_socket)
+ opt.browser_socket = 1;
else if (socket_name_browser
&& (!strcmp (socket_name_browser, "none")
|| !strcmp (socket_name_browser, "/dev/null")))
@@ -1429,11 +1429,19 @@ main (int argc, char **argv )
log_info ("%s %s starting in supervised mode.\n",
strusage(11), strusage(13) );
+ /* See below on why we remove certain envvars. */
+#ifndef HAVE_W32_SYSTEM
+ if (!opt.keep_display)
+ gnupg_unsetenv ("DISPLAY");
+#endif
+ gnupg_unsetenv ("INSIDE_EMACS");
+
+ /* Virtually create the sockets. */
map_supervised_sockets (&fd, &fd_extra, &fd_browser, &fd_ssh);
if (fd == GNUPG_INVALID_FD)
{
- log_fatal ("no standard socket provided\n");
- exit (1);
+ log_error ("no standard socket provided\n");
+ agent_exit (1);
}
/* record socket names where possible: */
socket_name = get_socket_path (fd);
@@ -1456,8 +1464,8 @@ main (int argc, char **argv )
log_info ("no saved signal mask\n");
#endif /*HAVE_SIGPROCMASK*/
- log_debug ("FDs: std: %d extra: %d browser: %d ssh: %d\n",
- fd, fd_extra, fd_browser, fd_ssh);
+ log_info ("listening on: std=%d extra=%d browser=%d ssh=%d\n",
+ fd, fd_extra, fd_browser, fd_ssh);
handle_connections (fd, fd_extra, fd_browser, fd_ssh);
assuan_sock_close (fd);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list