[Pkg-gnupg-commit] [gnupg2] 161/292: agent: --supervised mode improvements.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:37 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 27f6d5b9f4b6057ddeb9ace87a1e7e61ebac63e6
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Tue Oct 25 23:55:08 2016 -0400

    agent: --supervised mode improvements.
    
    * agent/gpg-agent.c (map_supervised_socket): if the agent is running
      in --supervised mode and is not actually given LISTEN_FDNAMES
      directives, require at least fd 3 to be open for listening.
    --
    Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
---
 agent/gpg-agent.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 16edae0..8e2d012 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -716,12 +716,19 @@ map_supervised_sockets (gnupg_fd_t *r_fd,
   /* Assign the descriptors to the return values.  */
   if (!fdnames)
     {
+      struct stat statbuf;
       if (fd_count != 1)
         log_error ("no LISTEN_FDNAMES and LISTEN_FDS (%d) != 1"
                    " in --supervised mode."
                    " (ignoring all sockets but the first one)\n",
                    fd_count);
+      if (fstat (3, &statbuf) == -1 && errno ==EBADF)
+        log_fatal ("file descriptor 3 must be valid in --supervised mode (as the "
+                   "agent's standard socket) if LISTEN_FDNAMES is not set\n");
       *r_fd = 3;
+      socket_name = get_socket_name (3);
+      if (!socket_name)
+          log_error ("cannot learn socket name for fd 3\n");
     }
   else if (fd_count != nfdnames)
     {

-- 
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