aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-01-17 13:23:13 +0000
committerWerner Koch <[email protected]>2020-01-17 13:28:13 +0000
commita265d3997a9120cb607c2d9b843bf9ee9e944378 (patch)
tree68d3f4a488edc80cfdc143c20d8dc0db7d30c59b
parentgpg: default-key: Simply don't limit by capability. (diff)
downloadgnupg-a265d3997a9120cb607c2d9b843bf9ee9e944378.tar.gz
gnupg-a265d3997a9120cb607c2d9b843bf9ee9e944378.zip
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 <[email protected]> (cherry picked from commit 7f12fb55f9757cd68147eca8f162c85378538405)
-rw-r--r--common/homedir.c3
-rw-r--r--tools/gpgconf.c14
2 files changed, 17 insertions, 0 deletions
diff --git a/common/homedir.c b/common/homedir.c
index e9e75d01e..4b6e46e88 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -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");
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index d9ee4a9c6..708b37002 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -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*/
}