diff options
author | Werner Koch <wk@gnupg.org> | 2022-01-27 14:41:38 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2022-01-27 14:43:45 +0100 |
commit | ed798a97f54fd8b5a48d662b0fc9ae517d938efe (patch) | |
tree | 1b9403a842f5500edc5402361984f86868abfdf0 | |
parent | gpgconf: Return again "keyserver" for gpgsm. (diff) | |
download | gnupg2-ed798a97f54fd8b5a48d662b0fc9ae517d938efe.tar.xz gnupg2-ed798a97f54fd8b5a48d662b0fc9ae517d938efe.zip |
gpgconf: Teach --show-config the legacy gpgconf.conf.
* tools/gpgconf.c (show_configs): Print gpgconf.conf and a warning.
-rw-r--r-- | tools/gpgconf.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/gpgconf.c b/tools/gpgconf.c index 4b9548d50..2bb25840d 100644 --- a/tools/gpgconf.c +++ b/tools/gpgconf.c @@ -1413,6 +1413,7 @@ show_configs (estream_t outfp) strlist_t list = NULL; strlist_t sl; const char *s; + int got_gpgconfconf = 0; es_fprintf (outfp, "### Dump of all standard config files\n"); show_version_gnupg (outfp, "### "); @@ -1423,6 +1424,15 @@ show_configs (estream_t outfp) list_dirs (outfp, NULL, 1); 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++) { fname = make_filename (gnupg_sysconfdir (), names[idx], NULL); @@ -1486,6 +1496,17 @@ show_configs (estream_t outfp) 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. */ dir = gnupg_opendir (gnupg_homedir ()); if (!dir) @@ -1496,7 +1517,6 @@ show_configs (estream_t outfp) return; } - any = 0; while ((dir_entry = gnupg_readdir (dir))) { for (idx = 0; idx < DIM (names); idx++) |