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.) */ ge'>range
AgeCommit message (Expand)Author
2019-10-23cve: Rewrite to read the JSON feed instead of the XML feed....The XML feed was discontinued on Oct. 16th, 2019: <https://nvd.nist.gov/General/News/XML-Vulnerability-Feed-Retirement-Phase-3> * guix/cve.scm (string->date*): New procedure. (<cve-item>, <cve>, <cve-reference>): New record types. (cpe-match->cve-configuration, configuration-data->cve-configurations) (json->cve-items, version-matches?): New procedures. (yearly-feed-uri): Change URL to refer to JSON feed. (cpe->product-alist, %parse-vulnerability-feed) (xml->vulnerabilities): Remove. (cve-configuration->package-list, merge-package-lists) (cve-item->vulnerability, json->vulnerabilities): New procedures. (write-cache): Use 'json->vulnerabilities' instead of 'xml->vulnerabilities', and remove 'parameterize'. (vulnerabilities->lookup-proc): Use 'version-matches?' when VERSION is true. * tests/cve.scm (%sample): Use 'tests/cve-sample.json'. (%expected-vulnerabilities): Rewrite accordingly. ("json->cve-items", "cve-item-published-date") ("json->vulnerabilities"): New tests. ("xml->vulnerabilities"): Remove. ("vulnerabilities->lookup-proc"): Adjust to new vulnerabilities. * tests/cve-sample.json: New file. * tests/cve-sample.xml: Remove. * Makefile.am (EXTRA_DIST): Adjust accordingly. * doc/guix.texi (Invoking guix lint): Update nist.gov URLs. Ludovic Courtès
2019-10-20tests: Avoid now-deprecated 'make-struct'....* tests/cve.scm (vulnerability): Use 'make-struct/no-tail' instead of 'make-struct', which is deprecated. * tests/lint.scm ("cve: one vulnerability") ("cve: one patched vulnerability") ("cve: known safe from vulnerability") ("cve: vulnerability fixed in replacement version") ("cve: patched vulnerability in replacement"): Likewise. Ludovic Courtès