]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/auth.c
Fix a parsing bug in the new authentication code.
[thirdparty/cups.git] / cups / auth.c
index f545b2331d7c623c986b6bfa678fcf5daeaa5de9..ab2ce996a00c436614b1fa00a39de4c0b412c2c1 100644 (file)
@@ -212,7 +212,7 @@ cupsDoAuthentication(
       if (!cg->lang_default)
        cg->lang_default = cupsLangDefault();
 
-      if (cups_auth_param(scheme, "username", default_username, sizeof(default_username)))
+      if (cups_auth_param(schemedata, "username", default_username, sizeof(default_username)))
        cupsSetUser(default_username);
 
       snprintf(prompt, sizeof(prompt), _cupsLangString(cg->lang_default, _("Password for %s on %s? ")), cupsUser(), http->hostname[0] == '/' ? "localhost" : http->hostname);
@@ -795,7 +795,7 @@ cups_auth_scheme(const char *www_authenticate,      /* I - Pointer into WWW-Authentic
     * Parse the scheme name or param="value" string...
     */
 
-    for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && !isspace(*www_authenticate & 255); www_authenticate ++)
+    for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && *www_authenticate != ',' && !isspace(*www_authenticate & 255); www_authenticate ++)
     {
       if (*www_authenticate == '=')
         param = 1;