]> git.pld-linux.org Git - packages/cups.git/commitdiff
- rel 2; fix http auth for browsers like google chrome auto/th/cups-2.2.7-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 6 Jun 2018 16:58:55 +0000 (18:58 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 6 Jun 2018 16:58:55 +0000 (18:58 +0200)
cups-bug-5289.patch [new file with mode: 0644]
cups.spec

diff --git a/cups-bug-5289.patch b/cups-bug-5289.patch
new file mode 100644 (file)
index 0000000..8324229
--- /dev/null
@@ -0,0 +1,54 @@
+From bb10adda6f2f41448d809c3fe86175b5b69cba7b Mon Sep 17 00:00:00 2001
+From: Michael R Sweet <michael.r.sweet@gmail.com>
+Date: Mon, 16 Apr 2018 19:19:13 -0400
+Subject: [PATCH] Try again to mirror fix (Issue #5289)
+
+---
+ scheduler/client.c | 14 +++++++++++++-
+ scheduler/client.h |  1 +
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/scheduler/client.c b/scheduler/client.c
+index f68924aa1..1c4760bfd 100644
+--- a/scheduler/client.c
++++ b/scheduler/client.c
+@@ -818,6 +818,18 @@ cupsdReadClient(cupsd_client_t *con)      /* I - Client to read from */
+   if (status == HTTP_STATUS_OK)
+   {
++   /*
++    * Record whether the client is a web browser.  "Mozilla" was the original
++    * and it seems that every web browser in existence now uses that as the
++    * prefix with additional information identifying *which* browser.
++    *
++    * Chrome (at least) has problems with multiple WWW-Authenticate values in
++    * a single header, so we only report Basic or Negotiate to web browsers and
++    * leave the multiple choices to the native CUPS client...
++    */
++
++    con->is_browser = !strncmp(httpGetField(con->http, HTTP_FIELD_USER_AGENT), "Mozilla/", 8);
++
+     if (httpGetField(con->http, HTTP_FIELD_ACCEPT_LANGUAGE)[0])
+     {
+      /*
+@@ -2361,7 +2373,7 @@ cupsdSendHeader(
+       strlcpy(auth_str, "Negotiate", sizeof(auth_str));
+     }
+-    if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE &&
++    if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE && !con->is_browser &&
+         !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost"))
+     {
+      /*
+diff --git a/scheduler/client.h b/scheduler/client.h
+index 7705f2c59..beddab0cc 100644
+--- a/scheduler/client.h
++++ b/scheduler/client.h
+@@ -30,6 +30,7 @@ struct cupsd_client_s
+   struct timeval      start;          /* Request start time */
+   http_state_t                operation;      /* Request operation */
+   off_t                       bytes;          /* Bytes transferred for this request */
++  int                 is_browser;     /* Is the client a web browser? */
+   int                 type;           /* AuthType for username */
+   char                        username[HTTP_MAX_VALUE],
+                                       /* Username from Authorization: line */
index eaa45a379a51fbdba72f06f4b7425dab4addfcbc..11bf7b4a44a7859e0a5720746548ad2552357f64 100644 (file)
--- a/cups.spec
+++ b/cups.spec
@@ -13,7 +13,7 @@ Summary(pl.UTF-8):    Ogólny system druku dla Uniksa
 Summary(pt_BR.UTF-8):  Sistema Unix de Impressão
 Name:          cups
 Version:       2.2.7
-Release:       1
+Release:       2
 Epoch:         1
 License:       LGPL v2 (libraries), GPL v2 (the rest)
 Group:         Applications/Printing
@@ -61,6 +61,7 @@ Patch114:     cups-freebind.patch
 Patch115:      cups-ipp-multifile.patch
 Patch116:      cups-web-devices-timeout.patch
 Patch117:      cups-lspp.patch
+Patch118:      cups-bug-5289.patch
 URL:           http://www.cups.org/
 BuildRequires: acl-devel
 %{?with_lspp:BuildRequires:    audit-libs-devel}
@@ -294,6 +295,7 @@ Wsparcie dla LPD w serwerze wydruków CUPS.
 %patch115 -p1
 %patch116 -p1
 %patch117 -p1
+%patch118 -p1
 
 %build
 %{__aclocal} -I config-scripts
This page took 0.134835 seconds and 4 git commands to generate.