summaryrefslogtreecommitdiffstats
path: root/tools/gpgconf.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2021-11-19 09:29:37 +0100
committerWerner Koch <wk@gnupg.org>2021-11-19 09:29:37 +0100
commita0fb78ee0fba13fdbe22d8c3f408a78b847cee28 (patch)
treeffc9930fb737201b654d2a2a821705056c259096 /tools/gpgconf.c
parentgpg,gpgsm: Add option --min-rsa-length. (diff)
downloadgnupg2-a0fb78ee0fba13fdbe22d8c3f408a78b847cee28.tar.xz
gnupg2-a0fb78ee0fba13fdbe22d8c3f408a78b847cee28.zip
gpgconf: Include output of --list-dirs in --show-configs.
* tools/gpgconf.c (list_dirs): Add arg special. (show_other_registry_entries): Print the Homedir. (show_configs): List directories.
Diffstat (limited to 'tools/gpgconf.c')
-rw-r--r--tools/gpgconf.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index 98780f2cc..a7bacf2ff 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -248,7 +248,7 @@ gpgconf_write_status (int no, const char *format, ...)
static void
-list_dirs (estream_t fp, char **names)
+list_dirs (estream_t fp, char **names, int special)
{
static struct {
const char *name;
@@ -327,13 +327,17 @@ list_dirs (estream_t fp, char **names)
}
es_fflush (fp);
- log_info ("Warning: homedir taken from registry key (%s:%s) in%s%s\n",
- GNUPG_REGISTRY_DIR, "HomeDir",
- hkcu?" HKCU":"",
- hklm?" HKLM":"");
-
-
-
+ if (special)
+ es_fprintf (fp, "\n"
+ "### Note: homedir taken from registry key %s\\%s:%s\n"
+ "\n",
+ hkcu?" HKCU":"", hklm?" HKLM":"",
+ GNUPG_REGISTRY_DIR, "HomeDir");
+ else
+ log_info ("Warning: homedir taken from registry key (%s:%s) in%s%s\n",
+ GNUPG_REGISTRY_DIR, "HomeDir",
+ hkcu?" HKCU":"",
+ hklm?" HKLM":"");
}
else if ((tmp = read_w32_registry_string (NULL,
GNUPG_REGISTRY_DIR,
@@ -341,12 +345,18 @@ list_dirs (estream_t fp, char **names)
{
xfree (tmp);
es_fflush (fp);
- log_info ("Warning: registry key (%s) without value in HKCU or HKLM\n",
- GNUPG_REGISTRY_DIR);
+ if (special)
+ es_fprintf (fp, "\n"
+ "### Note: registry %s:%s without value in HKCU or HKLM\n"
+ "\n", GNUPG_REGISTRY_DIR);
+ else
+ log_info ("Warning: registry key (%s) without value in HKCU or HKLM\n",
+ GNUPG_REGISTRY_DIR);
}
-
-#endif /*HAVE_W32_SYSTEM*/
+#else /*!HAVE_W32_SYSTEM*/
+ (void)special;
+#endif /*!HAVE_W32_SYSTEM*/
}
@@ -789,7 +799,7 @@ main (int argc, char **argv)
names[0] = NULL;
names[1] = NULL;
get_outfp (&outfp);
- list_dirs (outfp, names);
+ list_dirs (outfp, names, 0);
}
if (err)
gpgconf_failure (0);
@@ -866,7 +876,7 @@ main (int argc, char **argv)
case aListDirs:
/* Show the system configuration directories for gpgconf. */
get_outfp (&outfp);
- list_dirs (outfp, argc? argv : NULL);
+ list_dirs (outfp, argc? argv : NULL, 0);
break;
case aQuerySWDB:
@@ -1306,6 +1316,7 @@ show_other_registry_entries (estream_t outfp)
{ 1, "HKLM\\Software\\Gpg4win:Install Directory" },
{ 1, "HKLM\\Software\\Gpg4win:Desktop-Version" },
{ 1, "HKLM\\Software\\Gpg4win:VS-Desktop-Version" },
+ { 1, "\\" GNUPG_REGISTRY_DIR ":HomeDir" },
{ 2, "Software\\Microsoft\\Office\\Outlook\\Addins\\GNU.GpgOL"
":LoadBehavior" },
{ 2, "HKCU\\Software\\Microsoft\\Office\\16.0\\Outlook\\Options\\Mail:"
@@ -1405,6 +1416,9 @@ show_configs (estream_t outfp)
es_fprintf (outfp, "### GpgRT %s\n", gpg_error_check_version (NULL));
es_fprintf (outfp, "###\n\n");
+ list_dirs (outfp, NULL, 1);
+ es_fprintf (outfp, "\n");
+
for (idx = 0; idx < DIM (names); idx++)
{
fname = make_filename (gnupg_sysconfdir (), names[idx], NULL);