From 4978eed9c0d774fa49f6bacea21d48b378b3a793 Mon Sep 17 00:00:00 2001 From: msweet Date: Tue, 21 Oct 2014 13:52:24 +0000 Subject: [PATCH] The IPP backend did not work with some configurations of Windows (STR #4503) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12229 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES-2.0.txt | 2 ++ cups/auth.c | 4 ++-- cups/http.c | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGES-2.0.txt b/CHANGES-2.0.txt index 38fc1b316..714130d9b 100644 --- a/CHANGES-2.0.txt +++ b/CHANGES-2.0.txt @@ -18,6 +18,8 @@ CHANGES IN CUPS V2.0.1 configured Group and SystemGroup values (STR #4495) - The network backends no longer report waste-receptacle conditions when using SNMP (STR #4499) + - The IPP backend did not work with some configurations of Windows + (STR #4503) - RPMs did not build (STR #4490) diff --git a/cups/auth.c b/cups/auth.c index f61def522..1593953d0 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -761,7 +761,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */ if ( # ifdef HAVE_GSSAPI - strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) && + _cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) && # endif /* HAVE_GSSAPI */ # ifdef HAVE_AUTHORIZATION_H !httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey", @@ -808,7 +808,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */ filename, strerror(errno))); # ifdef HAVE_GSSAPI - if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9)) + if (!_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9)) { /* * Kerberos required, don't try the root certificate... diff --git a/cups/http.c b/cups/http.c index dfcd759ac..493044fed 100644 --- a/cups/http.c +++ b/cups/http.c @@ -2702,6 +2702,19 @@ httpSetField(http_t *http, /* I - HTTP connection */ http->server = _cupsStrAlloc(value); break; + case HTTP_FIELD_WWW_AUTHENTICATE : + /* CUPS STR #4503 - don't override WWW-Authenticate for unknown auth schemes */ + if (http->fields[HTTP_FIELD_WWW_AUTHENTICATE][0] && + _cups_strncasecmp(value, "Basic ", 6) && + _cups_strncasecmp(value, "Digest ", 7) && + _cups_strncasecmp(value, "Negotiate ", 10)) + { + DEBUG_printf(("1httpSetField: Ignoring unknown auth scheme in \"%s\".", value)); + return; + } + + /* Fall through to copy */ + default : strlcpy(http->fields[field], value, HTTP_MAX_VALUE); break; -- 2.39.5