mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-11 22:52:47 +01:00
gpgconf: Teach --show-config the legacy gpgconf.conf.
* tools/gpgconf.c (show_configs): Print gpgconf.conf and a warning.
This commit is contained in:
parent
977b61ddab
commit
ed798a97f5
@ -1413,6 +1413,7 @@ show_configs (estream_t outfp)
|
|||||||
strlist_t list = NULL;
|
strlist_t list = NULL;
|
||||||
strlist_t sl;
|
strlist_t sl;
|
||||||
const char *s;
|
const char *s;
|
||||||
|
int got_gpgconfconf = 0;
|
||||||
|
|
||||||
es_fprintf (outfp, "### Dump of all standard config files\n");
|
es_fprintf (outfp, "### Dump of all standard config files\n");
|
||||||
show_version_gnupg (outfp, "### ");
|
show_version_gnupg (outfp, "### ");
|
||||||
@ -1423,6 +1424,15 @@ show_configs (estream_t outfp)
|
|||||||
list_dirs (outfp, NULL, 1);
|
list_dirs (outfp, NULL, 1);
|
||||||
es_fprintf (outfp, "\n");
|
es_fprintf (outfp, "\n");
|
||||||
|
|
||||||
|
fname = make_filename (gnupg_sysconfdir (), "gpgconf.conf", NULL);
|
||||||
|
if (!gnupg_access (fname, F_OK))
|
||||||
|
{
|
||||||
|
got_gpgconfconf = 1;
|
||||||
|
show_configs_one_file (fname, 1, outfp, &list);
|
||||||
|
es_fprintf (outfp, "\n");
|
||||||
|
}
|
||||||
|
xfree (fname);
|
||||||
|
|
||||||
for (idx = 0; idx < DIM (names); idx++)
|
for (idx = 0; idx < DIM (names); idx++)
|
||||||
{
|
{
|
||||||
fname = make_filename (gnupg_sysconfdir (), names[idx], NULL);
|
fname = make_filename (gnupg_sysconfdir (), names[idx], NULL);
|
||||||
@ -1486,6 +1496,17 @@ show_configs (estream_t outfp)
|
|||||||
|
|
||||||
free_strlist (list);
|
free_strlist (list);
|
||||||
|
|
||||||
|
any = 0;
|
||||||
|
|
||||||
|
/* Additional warning. */
|
||||||
|
if (got_gpgconfconf)
|
||||||
|
{
|
||||||
|
es_fprintf (outfp,
|
||||||
|
"###\n"
|
||||||
|
"### Warning: legacy config file \"gpgconf.conf\" found\n");
|
||||||
|
any = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for uncommon files in the home directory. */
|
/* Check for uncommon files in the home directory. */
|
||||||
dir = gnupg_opendir (gnupg_homedir ());
|
dir = gnupg_opendir (gnupg_homedir ());
|
||||||
if (!dir)
|
if (!dir)
|
||||||
@ -1496,7 +1517,6 @@ show_configs (estream_t outfp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
any = 0;
|
|
||||||
while ((dir_entry = gnupg_readdir (dir)))
|
while ((dir_entry = gnupg_readdir (dir)))
|
||||||
{
|
{
|
||||||
for (idx = 0; idx < DIM (names); idx++)
|
for (idx = 0; idx < DIM (names); idx++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user