aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dirmngr.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-03-14 17:53:43 +0000
committerWerner Koch <[email protected]>2020-03-14 18:12:41 +0000
commit451cd1b3928172b312ca2597c3318e6e9e8be97d (patch)
tree3f8b8aa7052753d26a585e71a5861a35786e5ebc /dirmngr/dirmngr.c
parentgpg: New option --auto-key-import (diff)
downloadgnupg-451cd1b3928172b312ca2597c3318e6e9e8be97d.tar.gz
gnupg-451cd1b3928172b312ca2597c3318e6e9e8be97d.zip
gpgconf: Further simplify the gpgconf option processing.
* common/gc-opt-flags.h (GC_OPT_FLAG_RUNTIME): Move to ... * tools/gpgconf-comp.c: here. (known_options_scdaemon): Remove "options". (known_options_dirmngr): Remove "options". (known_options_gpgsm): Remove "options". (known_options_gpg): Remove "options" and "keyserver". (struct gc_option_s): Rename active t gpgconf_list. (gc_component_list_options): Do not act upon active. (option_check_validity): Ditto. (is_known_option): Make it work correctly for unknown options. (retrieve_options_from_program): Use renamed flag gpgconf_list only to detect duplicated items from --gpgconf-list. Do not set runtime. Only e set the options if set by --gpgconf-list; never clear them. * agent/gpg-agent.c: Simplify the --gpgconf-list output. * dirmngr/dirmngr.c: Ditto. * g10/gpg.c: Ditto. * kbx/keyboxd.c: Ditto. * scd/scdaemon.c: Ditto. * sm/gpgsm.c: Ditto. * tests/openpgp/gpgconf.scm: Use "compliance" instead of "keyserver" for the string arg test. -- There is no need to read the list of options from the components unless they convey a default value. It is better to consult only the list we have in gpgconf-comp.c to decide on whether an option should be displayed. Right, this might mess up thing if a newer gpgconf version is used with an older component, but we already print warnings in this case and in general we do not want to support this anymore - the times of gpg 1.4. and 2.0 are long over now. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dirmngr.c')
-rw-r--r--dirmngr/dirmngr.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index c9dc4d17a..95f739a0c 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -1502,71 +1502,19 @@ main (int argc, char **argv)
else if (cmd == aGPGConfList)
{
unsigned long flags = 0;
- char *filename;
char *filename_esc;
- /* First the configuration file. This is not an option, but it
- is vital information for GPG Conf. */
- filename = percent_escape (opt.config_filename, NULL);
- es_printf ("gpgconf-dirmngr.conf:%lu:\"%s\n",
- GC_OPT_FLAG_DEFAULT, filename);
- xfree (filename);
-
- es_printf ("verbose:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("quiet:%lu:\n", flags | GC_OPT_FLAG_NONE);
es_printf ("debug-level:%lu:\"none\n", flags | GC_OPT_FLAG_DEFAULT);
- es_printf ("log-file:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("force:%lu:\n", flags | GC_OPT_FLAG_NONE);
-
- /* --csh and --sh are mutually exclusive, something we can not
- express in GPG Conf. --options is only usable from the
- command line, really. --debug-all interacts with --debug,
- and having both of them is thus problematic. --no-detach is
- also only usable on the command line. --batch is unused. */
-
- filename = make_filename (gnupg_homedir (),
- "dirmngr_ldapservers.conf",
- NULL);
- filename_esc = percent_escape (filename, NULL);
- es_printf ("ldapserverlist-file:%lu:\"%s\n", flags | GC_OPT_FLAG_DEFAULT,
- filename_esc);
- xfree (filename_esc);
- xfree (filename);
-
es_printf ("ldaptimeout:%lu:%u\n",
- flags | GC_OPT_FLAG_DEFAULT, DEFAULT_LDAP_TIMEOUT);
+ flags | GC_OPT_FLAG_DEFAULT, DEFAULT_LDAP_TIMEOUT);
es_printf ("max-replies:%lu:%u\n",
- flags | GC_OPT_FLAG_DEFAULT, DEFAULT_MAX_REPLIES);
- es_printf ("allow-ocsp:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("allow-version-check:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("ocsp-responder:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("ocsp-signer:%lu:\n", flags | GC_OPT_FLAG_NONE);
-
- es_printf ("faked-system-time:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("no-greeting:%lu:\n", flags | GC_OPT_FLAG_NONE);
-
- es_printf ("disable-http:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("disable-ldap:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("honor-http-proxy:%lu\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("http-proxy:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("ldap-proxy:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("only-ldap-proxy:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("ignore-ldap-dp:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("ignore-http-dp:%lu:\n", flags | GC_OPT_FLAG_NONE);
- es_printf ("ignore-ocsp-service-url:%lu:\n", flags | GC_OPT_FLAG_NONE);
- /* Note: The next one is to fix a typo in gpgconf - should be
- removed eventually. */
- es_printf ("ignore-ocsp-servic-url:%lu:\n", flags | GC_OPT_FLAG_NONE);
-
- es_printf ("use-tor:%lu:\n", flags | GC_OPT_FLAG_NONE);
+ flags | GC_OPT_FLAG_DEFAULT, DEFAULT_MAX_REPLIES);
filename_esc = percent_escape (get_default_keyserver (0), NULL);
es_printf ("keyserver:%lu:\"%s:\n", flags | GC_OPT_FLAG_DEFAULT,
filename_esc);
xfree (filename_esc);
-
- es_printf ("nameserver:%lu:\n", flags | GC_OPT_FLAG_NONE);
es_printf ("resolver-timeout:%lu:%u\n",
flags | GC_OPT_FLAG_DEFAULT, 0);
}