From d591bc141629d13170e704785609e8482e814f94 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 1 Jun 2025 18:21:52 +0200 Subject: [PATCH] tool_getparam: make --no-anyauth not be accepted It was previously just ignored, now it triggers an error. It was never documented (nor intended) to work. Fixes #17508 Reported-by: Dan Fandrich Closes #17511 --- src/tool_getparam.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 9c1f1e54e9..f09a594c05 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -88,7 +88,7 @@ static const struct LongShort aliases[]= { {"abstract-unix-socket", ARG_FILE, ' ', C_ABSTRACT_UNIX_SOCKET}, {"alpn", ARG_BOOL|ARG_NO|ARG_TLS, ' ', C_ALPN}, {"alt-svc", ARG_STRG, ' ', C_ALT_SVC}, - {"anyauth", ARG_BOOL, ' ', C_ANYAUTH}, + {"anyauth", ARG_NONE, ' ', C_ANYAUTH}, {"append", ARG_BOOL, 'a', C_APPEND}, {"aws-sigv4", ARG_STRG, ' ', C_AWS_SIGV4}, {"basic", ARG_BOOL, ' ', C_BASIC}, @@ -1698,6 +1698,9 @@ static ParameterError opt_none(struct GlobalConfig *global, const struct LongShort *a) { switch(a->cmd) { + case C_ANYAUTH: /* --anyauth */ + config->authtype = CURLAUTH_ANY; + break; case C_DUMP_CA_EMBED: /* --dump-ca-embed */ return PARAM_CA_EMBED_REQUESTED; @@ -1828,11 +1831,6 @@ static ParameterError opt_bool(struct GlobalConfig *global, case C_BASIC: /* --basic */ togglebit(toggle, &config->authtype, CURLAUTH_BASIC); break; - case C_ANYAUTH: /* --anyauth */ - if(toggle) - config->authtype = CURLAUTH_ANY; - /* --no-anyauth simply does not touch it */ - break; #ifdef USE_WATT32 case C_WDEBUG: /* --wdebug */ dbug_init();