gpgconf,w32: Print a warning for a suspicious homedir.

* tools/gpgconf.c (list_dirs): Check whether the homedir has been
taken from the registry.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 7f12fb55f9)
This commit is contained in:
Werner Koch 2020-01-17 14:23:13 +01:00
parent a7840777e4
commit a265d3997a
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 17 additions and 0 deletions

View File

@ -305,6 +305,9 @@ default_homedir (void)
{
char *tmp, *p;
/* This is deprecated; gpgconf --list-dirs prints a
* warning if the homedir has been taken from the
* registry. */
tmp = read_w32_registry_string (NULL,
GNUPG_REGISTRY_DIR,
"HomeDir");

View File

@ -274,6 +274,20 @@ list_dirs (estream_t fp, char **names)
xfree (tmp);
}
#ifdef HAVE_W32_SYSTEM
tmp = read_w32_registry_string (NULL,
GNUPG_REGISTRY_DIR,
"HomeDir");
if (tmp)
{
es_fflush (fp);
log_info ("Warning: homedir taken from registry key (%s %s)\n",
GNUPG_REGISTRY_DIR, "HomeDir");
xfree (tmp);
}
#endif /*HAVE_W32_SYSTEM*/
}