chiark / gitweb /
common: Fix connecting to the agent.
authorJustus Winter <justus@g10code.com>
Mon, 27 Mar 2017 14:14:20 +0000 (16:14 +0200)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)
* common/homedir.c (_gnupg_socketdir_internal): Fix error handling.
--

Prior to 26086b36 the non-existance of the socket directory was
considered an error if a non-default home directory is used.  Since
26086b36 we now create the directory on demand, but the function still
returned the fallback path.  This made the agent bind the socket in
the socket directory, and the client trying to connect to the socket
in the home directory.

Fixes-commit: 26086b362ff47d21b1abefaf674a6464bf0a8921
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit caf00915532e6e8e509738962964edcd14fb0654)

Gbp-Pq: Name 0056-common-Fix-connecting-to-the-agent.patch

common/homedir.c

index c41cbdc7e4b14e85e94be313d92ec6eefb282c09..4571aac7b680c65950631b4159c2bb3837d9eec6 100644 (file)
@@ -586,6 +586,8 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
                   else
                     *r_info |= 64; /* Subdir does not exist.  */
                 }
+              else
+                goto leave; /* Success!  */
             }
           else
             *r_info |= 64; /* Subdir does not exist.  */