1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| | diff --git a/common/homedir.c b/common/homedir.c
index 4b6e46e88..de71e97b1 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -67,6 +67,10 @@
* gnupg_homedir and gnupg_set_homedir. Malloced. */
static char *the_gnupg_homedir;
+/* The user's home directory. Used in Guix to help GnuPG find the
+ * pinentry. */
+static char *the_user_homedir;
+
/* Flag indicating that home directory is not the default one. */
static byte non_default_homedir;
@@ -509,6 +513,16 @@ gnupg_homedir (void)
return the_gnupg_homedir;
}
+/* Return the user's home directory */
+const char *
+user_homedir (void)
+{
+ const char *dir;
+ dir = getenv("HOME");
+ if (!the_user_homedir)
+ the_user_homedir = make_absfilename (dir, NULL);
+ return the_user_homedir;
+}
/* Return whether the home dir is the default one. */
int
@@ -971,6 +985,7 @@ get_default_pinentry_name (int reset)
} names[] = {
/* The first entry is what we return in case we found no
other pinentry. */
+ { user_homedir, "/.guix-profile/bin/pinentry" },
{ gnupg_bindir, DIRSEP_S "pinentry" EXEEXT_S },
#ifdef HAVE_W32_SYSTEM
/* Try Gpg4win directory (with bin and without.) */
|