Accepting request 42020 from home:jsmeix:branches:Printing

Copy from home:jsmeix:branches:Printing/cups via accept of submit request 42020 revision 2.
Request was accepted with message:
revert cups/http.c to its state in CUPS 1.4.3 as band-aid workaround to avoid bnc#617026 for now

OBS-URL: https://build.opensuse.org/request/show/42020
OBS-URL: https://build.opensuse.org/package/show/Printing/cups?expand=0&rev=202
This commit is contained in:
Johannes Meixner 2010-06-24 16:51:18 +00:00 committed by Git OBS Bridge
parent 61ac0d4852
commit 7b959f7f93
3 changed files with 294 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jun 24 18:47:59 CEST 2010 - jsmeix@suse.de
- revert_http.c_to_1.4.3_state.patch reverts cups/http.c
to its state in CUPS 1.4.3 as band-aid workaround to avoid
Novell/Suse Bugzilla bnc#617026 for now.
-------------------------------------------------------------------
Fri Jun 18 09:11:02 CEST 2010 - jsmeix@suse.de

View File

@ -92,6 +92,9 @@ Patch103: cups-1.4-do_not_strip_recommended_from_PPDs.patch
# Patch104 adds the 'allowallforanybody' policy to cupsd.conf
# see https://fate.novell.com/303515
Patch104: cups-1.4-additional_policies.patch
# Patch105 reverts cups/http.c to its state in CUPS 1.4.3 as band-aid workaround
# to avoid https://bugzilla.novell.com/show_bug.cgi?id=617026 for now:
Patch105: revert_http.c_to_1.4.3_state.patch
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -210,6 +213,9 @@ http://www.cups.org
%patch103
# Patch104 adds the 'allowallforanybody' policy to cupsd.conf:
%patch104
# Patch105 reverts cups/http.c to its state in CUPS 1.4.3 as band-aid workaround
# to avoid https://bugzilla.novell.com/show_bug.cgi?id=617026 for now:
%patch105 -p1
%build
# Disable SILENT run of make so that make runs verbose as usual:

View File

@ -0,0 +1,281 @@
--- cups-1.4.4/cups/http.c 2010-06-16 07:27:41.000000000 +0200
+++ cups-1.4.3/cups/http.c 2009-11-14 01:00:59.000000000 +0100
@@ -1,9 +1,9 @@
/*
- * "$Id: http.c 9157 2010-06-16 05:27:41Z mike $"
+ * "$Id: http.c 8863 2009-11-14 00:00:59Z mike $"
*
- * HTTP routines for CUPS.
+ * HTTP routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -25,8 +25,7 @@
* server.
* httpClearCookie() - Clear the cookie value(s).
* httpClearFields() - Clear HTTP request fields.
- * httpClose() - Close an HTTP connection.
- * httpConnect() - Connect to a HTTP server.
+ * httpClose() - Close an HTTP connection...
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
* _httpCreate() - Create an unconnected HTTP connection.
* httpDelete() - Send a DELETE request to the server.
@@ -62,7 +61,7 @@
* _httpReadGNUTLS() - Read function for the GNU TLS library.
* httpReconnect() - Reconnect to a HTTP server.
* httpSetAuthString() - Set the current authorization string.
- * httpSetCookie() - Set the cookie value(s).
+ * httpSetCookie() - Set the cookie value(s)...
* httpSetExpect() - Set the Expect: header in a request.
* httpSetField() - Set the value of an HTTP header.
* httpSetLength() - Set the content-length and content-encoding.
@@ -83,12 +82,10 @@
* http_debug_hex() - Do a hex dump of a buffer.
* http_field() - Return the field index for a field name.
* http_read_ssl() - Read from a SSL/TLS connection.
- * http_locking_cb() - Lock/unlock a thread's mutex.
* http_send() - Send a request with all fields and the trailing
* blank line.
* http_setup_ssl() - Set up SSL/TLS support on a connection.
* http_shutdown_ssl() - Shut down SSL/TLS on a connection.
- * http_threadid_cb() - Return the current thread ID.
* http_upgrade() - Force upgrade to TLS encryption.
* http_write() - Write a buffer to a HTTP connection.
* http_write_chunk() - Write a chunked buffer.
@@ -146,19 +143,6 @@ static int http_setup_ssl(http_t *http)
static void http_shutdown_ssl(http_t *http);
static int http_upgrade(http_t *http);
static int http_write_ssl(http_t *http, const char *buf, int len);
-
-# ifdef HAVE_GNUTLS
-# ifdef HAVE_PTHREAD_H
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
-# endif /* HAVE_PTHREAD_H */
-
-# elif defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD_H)
-static pthread_mutex_t *http_locks; /* OpenSSL lock mutexes */
-
-static void http_locking_cb(int mode, int type, const char *file,
- int line);
-static unsigned long http_threadid_cb(void);
-# endif /* HAVE_GNUTLS */
#endif /* HAVE_SSL */
@@ -327,7 +311,7 @@ httpClearFields(http_t *http) /* I - Co
/*
- * 'httpClose()' - Close an HTTP connection.
+ * 'httpClose()' - Close an HTTP connection...
*/
void
@@ -575,9 +559,8 @@ httpError(http_t *http) /* I - Connect
void
httpFlush(http_t *http) /* I - Connection to server */
{
- char buffer[8192]; /* Junk buffer */
- int blocking; /* To block or not to block */
- http_state_t oldstate; /* Old state */
+ char buffer[8192]; /* Junk buffer */
+ int blocking; /* To block or not to block */
DEBUG_printf(("httpFlush(http=%p), state=%s", http,
@@ -594,7 +577,6 @@ httpFlush(http_t *http) /* I - Connect
* Read any data we can...
*/
- oldstate = http->state;
while (httpRead2(http, buffer, sizeof(buffer)) > 0);
/*
@@ -604,7 +586,7 @@ httpFlush(http_t *http) /* I - Connect
http->blocking = blocking;
- if (http->state == oldstate && http->state != HTTP_WAITING && http->fd >= 0)
+ if (http->state != HTTP_WAITING && http->fd >= 0)
{
/*
* Didn't get the data back, so close the current connection.
@@ -1188,22 +1170,21 @@ httpHead(http_t *http, /* I - Conne
void
httpInitialize(void)
{
- static int initialized = 0; /* Have we been called before? */
-#ifdef WIN32
- WSADATA winsockdata; /* WinSock data */
-#endif /* WIN32 */
#ifdef HAVE_LIBSSL
- int i; /* Looping var */
- unsigned char data[1024]; /* Seed data */
+# ifndef WIN32
+ struct timeval curtime; /* Current time in microseconds */
+# endif /* !WIN32 */
+ int i; /* Looping var */
+ unsigned char data[1024]; /* Seed data */
#endif /* HAVE_LIBSSL */
-
- if (initialized)
- return;
-
#ifdef WIN32
- WSAStartup(MAKEWORD(2,2), &winsockdata);
+ WSADATA winsockdata; /* WinSock data */
+ static int initialized = 0; /* Has WinSock been initialized? */
+
+ if (!initialized)
+ WSAStartup(MAKEWORD(1,1), &winsockdata);
#elif !defined(SO_NOSIGPIPE)
/*
* Ignore SIGPIPE signals...
@@ -1211,7 +1192,6 @@ httpInitialize(void)
# ifdef HAVE_SIGSET
sigset(SIGPIPE, SIG_IGN);
-
# elif defined(HAVE_SIGACTION)
struct sigaction action; /* POSIX sigaction data */
@@ -1219,63 +1199,35 @@ httpInitialize(void)
memset(&action, 0, sizeof(action));
action.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &action, NULL);
-
# else
signal(SIGPIPE, SIG_IGN);
# endif /* !SO_NOSIGPIPE */
#endif /* WIN32 */
#ifdef HAVE_GNUTLS
- /*
- * Make sure we handle threading properly...
- */
-
-# ifdef HAVE_PTHREAD_H
- gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
-# endif /* HAVE_PTHREAD_H */
-
- /*
- * Initialize GNU TLS...
- */
-
gnutls_global_init();
+#endif /* HAVE_GNUTLS */
-#elif defined(HAVE_LIBSSL)
- /*
- * Initialize OpenSSL...
- */
-
+#ifdef HAVE_LIBSSL
SSL_load_error_strings();
SSL_library_init();
/*
- * Set the threading callbacks...
- */
-
-# ifdef HAVE_PTHREAD_H
- http_locks = calloc(CRYPTO_num_locks(), sizeof(pthread_mutex_t));
-
- for (i = 0; i < CRYPTO_num_locks(); i ++)
- pthread_mutex_init(http_locks + i, NULL);
-
- CRYPTO_set_id_callback(http_threadid_cb);
- CRYPTO_set_locking_callback(http_locking_cb);
-# endif /* HAVE_PTHREAD_H */
-
- /*
* Using the current time is a dubious random seed, but on some systems
* it is the best we can do (on others, this seed isn't even used...)
*/
- CUPS_SRAND(time(NULL));
+# ifdef WIN32
+# else
+ gettimeofday(&curtime, NULL);
+ srand(curtime.tv_sec + curtime.tv_usec);
+# endif /* WIN32 */
for (i = 0; i < sizeof(data); i ++)
- data[i] = CUPS_RAND();
+ data[i] = rand();
RAND_seed(data, sizeof(data));
-#endif /* HAVE_GNUTLS */
-
- initialized = 1;
+#endif /* HAVE_LIBSSL */
}
@@ -1863,7 +1815,7 @@ httpSetAuthString(http_t *http, /* I
/*
- * 'httpSetCookie()' - Set the cookie value(s).
+ * 'httpSetCookie()' - Set the cookie value(s)...
*
* @since CUPS 1.1.19/Mac OS X 10.3@
*/
@@ -2834,25 +2786,6 @@ http_read_ssl(http_t *http, /* I - Conn
#endif /* HAVE_SSL */
-#if defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD_H)
-/*
- * 'http_locking_cb()' - Lock/unlock a thread's mutex.
- */
-
-static void
-http_locking_cb(int mode, /* I - Lock mode */
- int type, /* I - Lock type */
- const char *file, /* I - Source file */
- int line) /* I - Line number */
-{
- if (mode & CRYPTO_LOCK)
- pthread_mutex_lock(http_locks + type);
- else
- pthread_mutex_unlock(http_locks + type);
-}
-#endif /* HAVE_LIBSSL && HAVE_PTHREAD_H */
-
-
/*
* 'http_send()' - Send a request with all fields and the trailing blank line.
*/
@@ -3224,19 +3157,6 @@ http_shutdown_ssl(http_t *http) /* I -
#endif /* HAVE_SSL */
-#if defined(HAVE_LIBSSL) && defined(HAVE_PTHREAD_H)
-/*
- * 'http_threadid_cb()' - Return the current thread ID.
- */
-
-static unsigned long /* O - Thread ID */
-http_threadid_cb(void)
-{
- return ((unsigned long)pthread_self());
-}
-#endif /* HAVE_LIBSSL && HAVE_PTHREAD_H */
-
-
#ifdef HAVE_SSL
/*
* 'http_upgrade()' - Force upgrade to TLS encryption.
@@ -3511,5 +3431,5 @@ http_write_ssl(http_t *http, /* I -
/*
- * End of "$Id: http.c 9157 2010-06-16 05:27:41Z mike $".
+ * End of "$Id: http.c 8863 2009-11-14 00:00:59Z mike $".
*/