summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:31 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:31 +0900
commit8601db8a702e59fe82e777c44d09d7d0a1326cb8 (patch)
treeb97bfe7674b331456f8810f9a6bab5a5a7815af5 /common
parent2139edc88d3496b81f2da0efead0f8111b6696fb (diff)
downloadgpg2-8601db8a702e59fe82e777c44d09d7d0a1326cb8.tar.gz
gpg2-8601db8a702e59fe82e777c44d09d7d0a1326cb8.tar.bz2
gpg2-8601db8a702e59fe82e777c44d09d7d0a1326cb8.zip
Imported Upstream version 2.2.4upstream/2.2.4
Diffstat (limited to 'common')
-rw-r--r--common/homedir.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/homedir.c b/common/homedir.c
index 149e1ec..a598900 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -541,7 +541,17 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
#else /* Unix and stat(2) available. */
- static const char * const bases[] = { "/run", "/var/run", NULL};
+ static const char * const bases[] = {
+#ifdef USE_RUN_GNUPG_USER_SOCKET
+ "/run/gnupg",
+#endif
+ "/run",
+#ifdef USE_RUN_GNUPG_USER_SOCKET
+ "/var/run/gnupg",
+#endif
+ "/var/run",
+ NULL
+ };
int i;
struct stat sb;
char prefix[13 + 1 + 20 + 6 + 1];
@@ -559,7 +569,7 @@ _gnupg_socketdir_internal (int skip_checks, unsigned *r_info)
* as a background process with no (desktop) user logged in. Thus
* we better don't do that. */
- /* Check whether we have a /run/user dir. */
+ /* Check whether we have a /run/[gnupg/]user dir. */
for (i=0; bases[i]; i++)
{
snprintf (prefix, sizeof prefix, "%s/user/%u",