chiark / gitweb /
gnupg2 (2.1.18-8~deb9u1) stretch; urgency=medium
[gnupg2.git] / debian / patches / 0056-common-Fix-connecting-to-the-agent.patch
1 From: Justus Winter <justus@g10code.com>
2 Date: Mon, 27 Mar 2017 16:14:20 +0200
3 Subject: common: Fix connecting to the agent.
4
5 * common/homedir.c (_gnupg_socketdir_internal): Fix error handling.
6 --
7
8 Prior to 26086b36 the non-existance of the socket directory was
9 considered an error if a non-default home directory is used.  Since
10 26086b36 we now create the directory on demand, but the function still
11 returned the fallback path.  This made the agent bind the socket in
12 the socket directory, and the client trying to connect to the socket
13 in the home directory.
14
15 Fixes-commit: 26086b362ff47d21b1abefaf674a6464bf0a8921
16 Signed-off-by: Justus Winter <justus@g10code.com>
17 (cherry picked from commit caf00915532e6e8e509738962964edcd14fb0654)
18 ---
19  common/homedir.c | 2 ++
20  1 file changed, 2 insertions(+)
21
22 diff --git a/common/homedir.c b/common/homedir.c
23 index c41cbdc..4571aac 100644
24 --- a/common/homedir.c
25 +++ b/common/homedir.c
26 @@ -586,6 +586,8 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
27                    else
28                      *r_info |= 64; /* Subdir does not exist.  */
29                  }
30 +              else
31 +                goto leave; /* Success!  */
32              }
33            else
34              *r_info |= 64; /* Subdir does not exist.  */