]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: make --no-anyauth not be accepted
authorDaniel Stenberg <daniel@haxx.se>
Sun, 1 Jun 2025 16:21:52 +0000 (18:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jun 2025 09:19:04 +0000 (11:19 +0200)
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

index 9c1f1e54e9dbe7c274b2044363dd752dfc0bbf5f..f09a594c05f6f5177a6fd0f02084bc75f28b5b9e 100644 (file)
@@ -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();