mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpgconf: Fix --list-options for forced options
* tools/gpgconf-comp.c: Remove assert.h and replace all assert calls by log_assert. (known_options_gpg): Add "keyserver" as invisible. Remove "options". (known_pseudo_options_gpg, known_pseudo_options_gpgsm): New. (gc_component): Add field known_pseudo_options. (struct read_line_wrapper_parm_s): New. (read_line_wrapper): New. (retrieve_options_from_program): Use read_line_wrapper to handle pseudo options. (retrieve_options_from_program): Ignore to be ignored options. Add failsafe code to avoid calling percent_escape with NULL. -- GnuPG-bug-id: 5341,5800 Due to reading the list of options from the argparser of the component, we had no more information about the pseudo options and thus could not emit them. Well, there is just one pseudo option right now, but with this change we have a generalized concept for them: Pseudo options are used to convey information from a component to gpgconf; for example build-in values. This is a combined backport of patches to master.
This commit is contained in:
parent
d8e6d1e9ed
commit
85300587cc
3 changed files with 126 additions and 87 deletions
19
sm/gpgsm.c
19
sm/gpgsm.c
|
@ -1715,39 +1715,20 @@ main ( int argc, char **argv)
|
|||
{
|
||||
case aGPGConfList:
|
||||
{ /* List options and default values in the GPG Conf format. */
|
||||
char *config_filename_esc = percent_escape (opt.config_filename, NULL);
|
||||
|
||||
es_printf ("%s-%s.conf:%lu:\"%s\n",
|
||||
GPGCONF_NAME, GPGSM_NAME,
|
||||
GC_OPT_FLAG_DEFAULT, config_filename_esc);
|
||||
xfree (config_filename_esc);
|
||||
|
||||
es_printf ("verbose:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("quiet:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("debug-level:%lu:\"none:\n", GC_OPT_FLAG_DEFAULT);
|
||||
es_printf ("log-file:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("disable-crl-checks:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("enable-crl-checks:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("disable-trusted-cert-crl-check:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("enable-ocsp:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("include-certs:%lu:%d:\n", GC_OPT_FLAG_DEFAULT,
|
||||
DEFAULT_INCLUDE_CERTS);
|
||||
es_printf ("disable-policy-checks:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("auto-issuer-key-retrieve:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("disable-dirmngr:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
es_printf ("cipher-algo:%lu:\"%s:\n", GC_OPT_FLAG_DEFAULT,
|
||||
DEFAULT_CIPHER_ALGO);
|
||||
es_printf ("p12-charset:%lu:\n", GC_OPT_FLAG_DEFAULT);
|
||||
es_printf ("default-key:%lu:\n", GC_OPT_FLAG_DEFAULT);
|
||||
es_printf ("encrypt-to:%lu:\n", GC_OPT_FLAG_DEFAULT);
|
||||
es_printf ("keyserver:%lu:\n", GC_OPT_FLAG_NONE);
|
||||
|
||||
/* The next one is an info only item and should match what
|
||||
proc_parameters actually implements. */
|
||||
es_printf ("default_pubkey_algo:%lu:\"%s:\n", GC_OPT_FLAG_DEFAULT,
|
||||
"RSA-3072");
|
||||
es_printf ("compliance:%lu:\"%s:\n", GC_OPT_FLAG_DEFAULT, "gnupg");
|
||||
|
||||
}
|
||||
break;
|
||||
case aGPGConfTest:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue