mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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 <wk@gnupg.org>
This commit is contained in:
parent
6b306f45f4
commit
451cd1b392
9 changed files with 44 additions and 240 deletions
|
@ -694,36 +694,10 @@ main (int argc, char **argv )
|
|||
if (gpgconf_list)
|
||||
{
|
||||
/* List options and default values in the GPG Conf format. */
|
||||
char *filename_esc;
|
||||
|
||||
filename_esc = percent_escape (config_filename, NULL);
|
||||
|
||||
es_printf ("%s-%s.conf:%lu:\"%s\n",
|
||||
GPGCONF_NAME, SCDAEMON_NAME,
|
||||
GC_OPT_FLAG_DEFAULT, filename_esc);
|
||||
xfree (filename_esc);
|
||||
|
||||
es_printf ("verbose:%lu:\n"
|
||||
"quiet:%lu:\n"
|
||||
"debug-level:%lu:\"none:\n"
|
||||
"log-file:%lu:\n",
|
||||
GC_OPT_FLAG_NONE,
|
||||
GC_OPT_FLAG_NONE,
|
||||
GC_OPT_FLAG_DEFAULT,
|
||||
GC_OPT_FLAG_NONE );
|
||||
|
||||
es_printf ("reader-port:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
es_printf ("ctapi-driver:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
es_printf ("debug-level:%lu:\"none:\n", GC_OPT_FLAG_DEFAULT);
|
||||
es_printf ("pcsc-driver:%lu:\"%s:\n",
|
||||
GC_OPT_FLAG_DEFAULT, DEFAULT_PCSC_DRIVER );
|
||||
#ifdef HAVE_LIBUSB
|
||||
es_printf ("disable-ccid:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
#endif
|
||||
es_printf ("deny-admin:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
es_printf ("disable-pinpad:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
GC_OPT_FLAG_DEFAULT, DEFAULT_PCSC_DRIVER );
|
||||
es_printf ("card-timeout:%lu:%d:\n", GC_OPT_FLAG_DEFAULT, 0);
|
||||
es_printf ("enable-pinpad-varlen:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
es_printf ("application-priority:%lu:\n", GC_OPT_FLAG_NONE );
|
||||
|
||||
scd_exit (0);
|
||||
}
|
||||
|
@ -732,7 +706,9 @@ main (int argc, char **argv )
|
|||
if (logfile)
|
||||
{
|
||||
log_set_file (logfile);
|
||||
log_set_prefix (NULL, GPGRT_LOG_WITH_PREFIX | GPGRT_LOG_WITH_TIME | GPGRT_LOG_WITH_PID);
|
||||
log_set_prefix (NULL, (GPGRT_LOG_WITH_PREFIX
|
||||
| GPGRT_LOG_WITH_TIME
|
||||
| GPGRT_LOG_WITH_PID));
|
||||
}
|
||||
|
||||
if (debug_wait && pipe_server)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue