Make GnuPG automatically find a pinentry installed by Guix. Try using $HOME or, if that variable is not set, use the system password database, or fall back to looking in "/". More information: https://bugs.gnu.org/24076 diff --git a/common/homedir.c b/common/homedir.c index 4b6e46e88..f7ae68ba5 100644 --- a/common/homedir.c +++ b/common/homedir.c @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef HAVE_W32_SYSTEM #include /* Due to the stupid mingw64 requirement to @@ -67,6 +68,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 +514,25 @@ 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 (dir == NULL) + { + struct passwd *pw = NULL; + pw = getpwuid (getuid ()); + if (pw != NULL) + dir = pw->pw_dir; + else + dir = "/"; + } + 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 +995,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.) */ ue='author'>author
AgeCommit message (Expand)Author
2023-07-06installer: Restore LatGrkCyr-8x16 console font depending on language....Partially-Fixes: <https://issues.guix.gnu.org/64006> * gnu/installer/services.scm (system-services->configuration): When the LANGUAGE environment variable matches a known native console font, wrap the base services with modify-services, configuring console-font-service-type to set the native console font on every tty instead of the default console font. Signed-off-by: Florian Pelz <pelzflorian@pelzflorian.de> Denys Nykula
2022-11-20installer: Add comment above the 'packages' field....* gnu/installer/services.scm (system-services->configuration): Add heading above the 'packages' field. Rename 'heading' to 'service-heading'. Ludovic Courtès
2022-08-08installer: Add comments and vertical space to the generated config....* gnu/installer/parted.scm (user-partitions->configuration): Introduce vertical space and a comment. * gnu/installer/services.scm (G_): New macro. (%system-services): Add comment for OpenSSH. (system-services->configuration): Add vertical space and comments. * gnu/installer/user.scm (users->configuration): Add comment. * gnu/installer/steps.scm (format-configuration): Add comment. (configuration->file): Expound leading comment. Pass #:format-comment to 'pretty-print-with-comments/splice'. Ludovic Courtès