From: Jan Rękorajski Date: Wed, 23 Nov 2011 12:29:04 +0000 (+0000) Subject: - from cups svn X-Git-Tag: auto/th/cups-1_5_0-5~1 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=f3d5ca43a829852c2956cc28bba4c90d1ae4b5ff;p=packages%2Fcups.git - from cups svn Changed files: cups-auth.patch -> 1.2 cups-ssl-segfault.patch -> 1.2 --- diff --git a/cups-auth.patch b/cups-auth.patch index 1db4d0a..f78830f 100644 --- a/cups-auth.patch +++ b/cups-auth.patch @@ -1,43 +1,72 @@ -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)) +Index: cups/request.c +=================================================================== +--- cups/request.c (revision 9973) ++++ cups/request.c (revision 9974) +@@ -248,16 +248,9 @@ + + while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0) + { +- if (httpCheck(http)) +- { +- _httpUpdate(http, &status); +- +- if (status >= HTTP_MULTIPLE_CHOICES) +- break; +- } +- +- if (httpWrite2(http, buffer, bytes) < bytes) +- break; ++ if ((status = cupsWriteRequestData(http, buffer, bytes)) ++ != HTTP_CONTINUE) ++ break; + } + } + +@@ -265,13 +258,11 @@ + * Get the server's response... + */ + +- if (status == HTTP_CONTINUE || status == HTTP_OK) ++ if (status != HTTP_ERROR) + { + response = cupsGetResponse(http, resource); +- status = http->status; ++ status = httpGetStatus(http); + } +- else +- httpFlush(http); + + DEBUG_printf(("2cupsDoIORequest: status=%d", status)); + +@@ -785,7 +776,17 @@ + */ + + if (status >= HTTP_MULTIPLE_CHOICES) ++ { ++ _cupsSetHTTPError(status); ++ ++ do ++ { ++ status = httpUpdate(http); ++ } ++ while (status != HTTP_ERROR && http->state == HTTP_POST_RECV); ++ + httpFlush(http); ++ } + + switch (status) + { +@@ -922,6 +923,13 @@ + if (status >= HTTP_MULTIPLE_CHOICES) + { + _cupsSetHTTPError(status); ++ ++ do ++ { ++ status = httpUpdate(http); ++ } ++ while (status != HTTP_ERROR && http->state == HTTP_POST_RECV); ++ + httpFlush(http); + } + diff --git a/cups-ssl-segfault.patch b/cups-ssl-segfault.patch index 938c341..0d42d33 100644 --- a/cups-ssl-segfault.patch +++ b/cups-ssl-segfault.patch @@ -1,6 +1,17 @@ ---- cups-1.5.0/cups/http.c~ 2011-06-16 22:12:16.000000000 +0200 -+++ cups-1.5.0/cups/http.c 2011-08-02 14:06:25.143633360 +0200 -@@ -3814,7 +3814,7 @@ +Index: cups/http.c +=================================================================== +--- cups/http.c (revision 9908) ++++ cups/http.c (revision 9909) +@@ -3807,6 +3807,8 @@ + any_root = cg->any_root; + + # ifdef HAVE_LIBSSL ++ (void)any_root; ++ + context = SSL_CTX_new(SSLv23_client_method()); + + SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */ +@@ -3815,7 +3817,7 @@ BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http); http->tls = SSL_new(context); @@ -9,7 +20,7 @@ if (SSL_connect(http->tls) != 1) { -@@ -4173,11 +4173,11 @@ +@@ -4200,11 +4202,11 @@ # ifdef HAVE_LIBSSL SSL_CTX *context; /* Context for encryption */