aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-07-05 10:10:29 +0000
committerWerner Koch <[email protected]>2023-07-05 10:10:29 +0000
commitff81ded48df44d9fe1800fe1d7d6c30ddcc8d82b (patch)
tree95ed81becb3992ecc399a19397c3b1bcde6a120b
parentgpgtar: New option --no-compress. (diff)
downloadgnupg-ff81ded48df44d9fe1800fe1d7d6c30ddcc8d82b.tar.gz
gnupg-ff81ded48df44d9fe1800fe1d7d6c30ddcc8d82b.zip
dirmngr: New dummy option --compatibility-flags.
* dirmngr/dirmngr.c (oCompatibilityFlags): New. (opts): Add option --compatibility-flags. (compatibility_flags): New. (parse_rereadable_options): Parse them.
-rw-r--r--dirmngr/dirmngr.c19
-rw-r--r--dirmngr/dirmngr.h7
-rw-r--r--doc/dirmngr.texi8
3 files changed, 34 insertions, 0 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index e1f3a1dcd..a94257e5c 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -157,6 +157,7 @@ enum cmd_and_opt_values {
oConnectTimeout,
oConnectQuickTimeout,
oListenBacklog,
+ oCompatibilityFlags,
aTest
};
@@ -297,6 +298,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_s (oSocketName, "socket-name", "@"), /* Only for debugging. */
ARGPARSE_s_n (oDebugCacheExpiredCerts, "debug-cache-expired-certs", "@"),
+ ARGPARSE_s_s (oCompatibilityFlags, "compatibility-flags", "@"),
ARGPARSE_header (NULL, ""), /* Stop the header group. */
@@ -328,6 +330,13 @@ static struct debug_flags_s debug_flags [] =
{ 77, NULL } /* 77 := Do not exit on "help" or "?". */
};
+/* The list of compatibility flags. */
+static struct compatibility_flags_s compatibility_flags [] =
+ {
+ { 0, NULL }
+ };
+
+
#define DEFAULT_MAX_REPLIES 10
#define DEFAULT_LDAP_TIMEOUT 15 /* seconds */
@@ -709,6 +718,7 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
opt.ldaptimeout = DEFAULT_LDAP_TIMEOUT;
ldapserver_list_needs_reset = 1;
opt.debug_cache_expired_certs = 0;
+ opt.compat_flags = 0;
return 1;
}
@@ -871,6 +881,15 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
opt.debug_cache_expired_certs = 0;
break;
+ case oCompatibilityFlags:
+ if (parse_compatibility_flags (pargs->r.ret_str, &opt.compat_flags,
+ compatibility_flags))
+ {
+ pargs->r_opt = ARGPARSE_INVALID_ARG;
+ pargs->err = ARGPARSE_PRINT_WARNING;
+ }
+ break;
+
default:
return 0; /* Not handled. */
}
diff --git a/dirmngr/dirmngr.h b/dirmngr/dirmngr.h
index fed459924..dd9f605da 100644
--- a/dirmngr/dirmngr.h
+++ b/dirmngr/dirmngr.h
@@ -153,6 +153,9 @@ struct
current after nextUpdate. */
strlist_t keyserver; /* List of default keyservers. */
+
+ /* Compatibility flags (COMPAT_FLAG_xxxx). */
+ unsigned int compat_flags;
} opt;
@@ -179,6 +182,10 @@ struct
#define DBG_LOOKUP (opt.debug & DBG_LOOKUP_VALUE)
#define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE)
+/* Compatibility flags */
+/* None so far. */
+
+
/* A simple list of certificate references. FIXME: Better use
certlist_t also for references (Store NULL at .cert) */
struct cert_ref_s
diff --git a/doc/dirmngr.texi b/doc/dirmngr.texi
index 7b539ca4e..f9da5f090 100644
--- a/doc/dirmngr.texi
+++ b/doc/dirmngr.texi
@@ -168,6 +168,14 @@ Append all logging output to @var{file}. This is very helpful in
seeing what the agent actually does. Use @file{socket://} to log to
socket.
+@item --compatibility-flags @var{flags}
+@opindex compatibility-flags
+Set compatibility flags to work around certain problems or to emulate
+bugs. The @var{flags} are given as a comma separated list of flag
+names and are OR-ed together. The special flag "none" clears the list
+and allows to start over with an empty list. To get a list of
+available flags the sole word "help" can be used.
+
@item --debug-level @var{level}
@opindex debug-level
Select the debug level for investigating problems. @var{level} may be a