From e8434306215c4faec42eae1a415ba19a77829160 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Fri, 5 Aug 2011 19:59:04 +0000 Subject: [PATCH] - rel 4 - fix client authentication, empty auth -> try again, and ignore HTML content in server response Changed files: cups-auth.patch -> 1.1 cups.spec -> 1.305 --- cups-auth.patch | 43 +++++++++++++++++++++++++++++++++++++++++++ cups.spec | 4 +++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 cups-auth.patch diff --git a/cups-auth.patch b/cups-auth.patch new file mode 100644 index 0000000..1db4d0a --- /dev/null +++ b/cups-auth.patch @@ -0,0 +1,43 @@ +diff -ur cups-1.5.0/cups/auth.c cups-1.5.0-auth/cups/auth.c +--- cups-1.5.0/cups/auth.c 2011-05-20 20:22:33.000000000 +0200 ++++ cups-1.5.0-auth/cups/auth.c 2011-08-05 19:39:19.587496832 +0200 +@@ -276,8 +278,7 @@ + { + DEBUG_printf(("1cupsDoAuthentication: Unknown auth type: \"%s\"", + http->fields[HTTP_FIELD_WWW_AUTHENTICATE])); +- http->status = HTTP_AUTHORIZATION_CANCELED; +- return (-1); ++ return (1); + } + + DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\"", http->authstring)); +diff -ur cups-1.5.0/cups/request.c cups-1.5.0-auth/cups/request.c +--- cups-1.5.0/cups/request.c 2011-05-20 05:49:49.000000000 +0200 ++++ cups-1.5.0-auth/cups/request.c 2011-08-05 19:40:37.981496819 +0200 +@@ -396,7 +396,7 @@ + { + status = httpUpdate(http); + } +- while (status != HTTP_ERROR && http->state == HTTP_POST_RECV); ++ while (http->state == HTTP_POST_RECV); + + DEBUG_printf(("2cupsGetResponse: status=%d", status)); + +@@ -448,7 +449,7 @@ + + DEBUG_puts("2cupsGetResponse: Need authorization..."); + +- if (!cupsDoAuthentication(http, "POST", resource)) ++ if (cupsDoAuthentication(http, "POST", resource) >= 0) + httpReconnect(http); + else + status = HTTP_AUTHORIZATION_CANCELED; +@@ -780,7 +781,7 @@ + return (status); + + case HTTP_UNAUTHORIZED : +- if (cupsDoAuthentication(http, "POST", resource)) ++ if (cupsDoAuthentication(http, "POST", resource) < 0) + return (HTTP_AUTHORIZATION_CANCELED); + + if (httpReconnect(http)) diff --git a/cups.spec b/cups.spec index 1f0edc2..61eb33a 100644 --- a/cups.spec +++ b/cups.spec @@ -17,7 +17,7 @@ Summary(pl.UTF-8): Ogólny system druku dla Uniksa Summary(pt_BR.UTF-8): Sistema Unix de Impressão Name: cups Version: 1.5.0 -Release: 3 +Release: 4 Epoch: 1 License: LGPL v2 (libraries), GPL v2 (the rest) + openssl exception Group: Applications/Printing @@ -43,6 +43,7 @@ Patch10: %{name}-peercred.patch Patch11: %{name}-usb.patch Patch12: %{name}-desktop.patch Patch13: %{name}-ssl-segfault.patch +Patch14: %{name}-auth.patch URL: http://www.cups.org/ BuildRequires: acl-devel BuildRequires: autoconf >= 2.60 @@ -313,6 +314,7 @@ Wsparcie dla LPD w serwerze wydruków CUPS. #%patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 %build %{__aclocal} -I config-scripts -- 2.44.0