1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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.
This commit is contained in:
Werner Koch 2021-11-19 09:29:37 +01:00
parent 5f39db70c0
commit a0fb78ee0f
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -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);