agent: Do not remove the ssh socket.
authorJustus Winter <justus@g10code.com>
Wed, 2 Mar 2016 15:41:04 +0000 (16:41 +0100)
committerJustus Winter <justus@g10code.com>
Wed, 2 Mar 2016 16:00:22 +0000 (17:00 +0100)
* agent/gpg-agent.c (create_server_socket): Also inhibit the removal
of the ssh socket if another agent process is already running.

GnuPG modern is not affected.

GnuPG-bug-id: 2258
Signed-off-by: Justus Winter <justus@g10code.com>
agent/gpg-agent.c

index 479f918..3b4a181 100644 (file)
@@ -1586,6 +1586,8 @@ create_server_socket (char *name, int is_ssh, assuan_sock_nonce_t *nonce)
           log_error (_("a gpg-agent is already running - "
                        "not starting a new one\n"));
           *name = 0; /* Inhibit removal of the socket by cleanup(). */
+          if (opt.ssh_support)
+            *socket_name_ssh = 0; /* Likewise for the ssh socket.  */
           assuan_sock_close (fd);
           agent_exit (2);
         }