From 03cf3475d6f60c0e9348e71500197b868c56f999 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:21:48 +0000 Subject: import libsoup-2.56.0-3.el7 --- diff --git a/.gitignore b/.gitignore index 720aa72..48a8fc3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libsoup-2.48.1.tar.xz +SOURCES/libsoup-2.56.0.tar.xz diff --git a/.libsoup.metadata b/.libsoup.metadata index d4f33f4..625b2a6 100644 --- a/.libsoup.metadata +++ b/.libsoup.metadata @@ -1 +1 @@ -cccb3e0ab4182bbe891d8ae3de504b8a848a3497 SOURCES/libsoup-2.48.1.tar.xz +faf72c678d013b8ad9d1d9eecc7e7da8a93c4dd1 SOURCES/libsoup-2.56.0.tar.xz diff --git a/SOURCES/coverity-scan-issues.patch b/SOURCES/coverity-scan-issues.patch new file mode 100644 index 0000000..ffa1d30 --- /dev/null +++ b/SOURCES/coverity-scan-issues.patch @@ -0,0 +1,74 @@ +diff --git a/libsoup/soup-auth-basic.c b/libsoup/soup-auth-basic.c +index 5f1e718..d8b3226 100644 +--- a/libsoup/soup-auth-basic.c ++++ b/libsoup/soup-auth-basic.c +@@ -74,7 +74,7 @@ soup_auth_basic_get_protection_space (SoupAuth *auth, SoupURI *source_uri) + + /* Strip filename component */ + p = strrchr (space, '/'); +- if (p == space && p[1]) ++ if (p && p == space && p[1]) + p[1] = '\0'; + else if (p && p[1]) + *p = '\0'; +diff --git a/libsoup/soup-auth-negotiate.c b/libsoup/soup-auth-negotiate.c +index 94863d6..f94760c 100644 +--- a/libsoup/soup-auth-negotiate.c ++++ b/libsoup/soup-auth-negotiate.c +@@ -268,7 +268,7 @@ soup_auth_negotiate_update_connection (SoupConnectionAuth *auth, SoupMessage *ms + } else { + /* FIXME: report further upward via + * soup_message_get_error_message */ +- g_warning ("gssapi step failed: %s", err->message); ++ g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error"); + success = FALSE; + } + } else if (!strncmp (header, "Negotiate ", 10)) { +diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c +index a180c6e..abef34c 100644 +--- a/libsoup/soup-message-headers.c ++++ b/libsoup/soup-message-headers.c +@@ -1324,7 +1324,7 @@ content_type_setter (SoupMessageHeaders *hdrs, const char *value) + { + g_free (hdrs->content_type); + if (value) { +- char *content_type, *p; ++ char *content_type = NULL, *p; + + parse_content_foo (hdrs, "Content-Type", &content_type, NULL); + p = strpbrk (content_type, " /"); +diff --git a/libsoup/soup-xmlrpc.c b/libsoup/soup-xmlrpc.c +index 42dcda9..2da6344 100644 +--- a/libsoup/soup-xmlrpc.c ++++ b/libsoup/soup-xmlrpc.c +@@ -588,7 +588,7 @@ signature_get_next_complete_type (const char **signature) + + (*signature)++; + +- if ( (*signature)[0] == stack[stack_len - 1]) ++ if ( stack_len > 0 && (*signature)[0] == stack[stack_len - 1]) + stack_len--; + } while (stack_len > 0); + +diff --git a/tests/test-utils.c b/tests/test-utils.c +index 9c74206..fc58362 100644 +--- a/tests/test-utils.c ++++ b/tests/test-utils.c +@@ -676,6 +678,8 @@ soup_test_request_read_all (SoupRequest *req, + + if (!SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) + data.loop = g_main_loop_new (g_main_context_get_thread_default (), FALSE); ++ else ++ data.loop = NULL; + + do { + if (SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) { +@@ -691,7 +695,7 @@ soup_test_request_read_all (SoupRequest *req, + } + } while (nread > 0); + +- if (!SOUP_IS_SESSION_SYNC (soup_request_get_session (req))) ++ if (data.loop) + g_main_loop_unref (data.loop); + + return nread == 0; diff --git a/SOURCES/get-leaks.patch b/SOURCES/get-leaks.patch new file mode 100644 index 0000000..67f77bd --- /dev/null +++ b/SOURCES/get-leaks.patch @@ -0,0 +1,19 @@ +diff -up libsoup-2.56.0/examples/get.c.get-leaks libsoup-2.56.0/examples/get.c +--- libsoup-2.56.0/examples/get.c.get-leaks 2016-09-16 17:14:27.000000000 +0200 ++++ libsoup-2.56.0/examples/get.c 2017-06-20 14:31:00.325517968 +0200 +@@ -90,6 +90,7 @@ get_url (const char *url) + fclose (output_file); + } + } ++ g_object_unref (msg); + } + + /* Inline class for providing a pre-configured client certificate */ +@@ -287,5 +288,7 @@ main (int argc, char **argv) + if (!synchronous) + g_main_loop_unref (loop); + ++ g_object_unref (session); ++ + return 0; + } diff --git a/SOURCES/negotiate-connection-close.patch b/SOURCES/negotiate-connection-close.patch new file mode 100644 index 0000000..0e22774 --- /dev/null +++ b/SOURCES/negotiate-connection-close.patch @@ -0,0 +1,46 @@ +diff -up libsoup-2.56.0/libsoup/soup-auth-negotiate.c.negotiate-connection-close libsoup-2.56.0/libsoup/soup-auth-negotiate.c +--- libsoup-2.56.0/libsoup/soup-auth-negotiate.c.negotiate-connection-close 2017-06-20 14:38:57.074528827 +0200 ++++ libsoup-2.56.0/libsoup/soup-auth-negotiate.c 2017-06-20 14:40:02.165257249 +0200 +@@ -188,7 +188,29 @@ soup_auth_negotiate_get_connection_autho + SoupNegotiateConnectionState *conn = state; + char *header = NULL; + +- if (conn->state == SOUP_NEGOTIATE_RECEIVED_CHALLENGE) { ++ if (conn->state == SOUP_NEGOTIATE_NEW) { ++ GError *err = NULL; ++ ++ if (!check_auth_trusted_uri (auth, msg)) { ++ conn->state = SOUP_NEGOTIATE_FAILED; ++ return NULL; ++ } ++ ++ if (!soup_gss_build_response (conn, SOUP_AUTH (auth), &err)) { ++ /* FIXME: report further upward via ++ * soup_message_get_error_message */ ++ if (conn->initialized) ++ g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error"); ++ else ++ g_warning ("gssapi init failed: %s", err ? err->message : "Unknown error"); ++ conn->state = SOUP_NEGOTIATE_FAILED; ++ g_clear_error (&err); ++ ++ return NULL; ++ } ++ } ++ ++ if (conn->response_header) { + header = conn->response_header; + conn->response_header = NULL; + conn->state = SOUP_NEGOTIATE_SENT_RESPONSE; +@@ -251,7 +273,10 @@ soup_auth_negotiate_update_connection (S + } else { + /* FIXME: report further upward via + * soup_message_get_error_message */ +- g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error"); ++ if (conn->initialized) ++ g_warning ("gssapi step failed: %s", err ? err->message : "Unknown error"); ++ else ++ g_warning ("gssapi init failed: %s", err ? err->message : "Unknown error"); + success = FALSE; + } + } else if (!strncmp (header, "Negotiate ", 10)) { diff --git a/SOURCES/negotiate-internals.patch b/SOURCES/negotiate-internals.patch new file mode 100644 index 0000000..9fd6d97 --- /dev/null +++ b/SOURCES/negotiate-internals.patch @@ -0,0 +1,205 @@ +diff -up libsoup-2.56.0/libsoup/soup-auth-negotiate.c.negotiate-internals libsoup-2.56.0/libsoup/soup-auth-negotiate.c +--- libsoup-2.56.0/libsoup/soup-auth-negotiate.c.negotiate-internals 2016-09-16 17:14:27.000000000 +0200 ++++ libsoup-2.56.0/libsoup/soup-auth-negotiate.c 2017-06-20 14:34:42.018592998 +0200 +@@ -83,11 +83,6 @@ typedef struct { + + typedef struct { + gboolean is_authenticated; +- +- gulong message_finished_signal_id; +- gulong message_got_headers_signal_id; +- +- SoupNegotiateConnectionState *conn_state; + } SoupAuthNegotiatePrivate; + + #define SOUP_AUTH_NEGOTIATE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_AUTH_NEGOTIATE, SoupAuthNegotiatePrivate)) +@@ -108,7 +103,6 @@ static GSList *blacklisted_uris; + static void parse_uris_from_env_variable (const gchar *env_variable, GSList **list); + + static void check_server_response (SoupMessage *msg, gpointer auth); +-static void remove_server_response_handler (SoupMessage *msg, gpointer auth); + + static const char spnego_OID[] = "\x2b\x06\x01\x05\x05\x02"; + static const gss_OID_desc gss_mech_spnego = { sizeof (spnego_OID) - 1, (void *) &spnego_OID }; +@@ -116,12 +110,10 @@ static const gss_OID_desc gss_mech_spneg + static gpointer + soup_auth_negotiate_create_connection_state (SoupConnectionAuth *auth) + { +- SoupAuthNegotiatePrivate *priv = SOUP_AUTH_NEGOTIATE_GET_PRIVATE (auth); + SoupNegotiateConnectionState *conn; + + conn = g_slice_new0 (SoupNegotiateConnectionState); + conn->state = SOUP_NEGOTIATE_NEW; +- priv->conn_state = conn; + + return conn; + } +@@ -137,14 +129,11 @@ static void + soup_auth_negotiate_free_connection_state (SoupConnectionAuth *auth, + gpointer state) + { +- SoupAuthNegotiate *negotiate = SOUP_AUTH_NEGOTIATE (auth); +- SoupAuthNegotiatePrivate *priv = SOUP_AUTH_NEGOTIATE_GET_PRIVATE (negotiate); + SoupNegotiateConnectionState *conn = state; + + free_connection_state_data (conn); + + g_slice_free (SoupNegotiateConnectionState, conn); +- priv->conn_state = NULL; + } + + static GSList * +@@ -226,7 +215,6 @@ soup_auth_negotiate_update_connection (S + #ifdef LIBSOUP_HAVE_GSSAPI + gboolean success = TRUE; + SoupNegotiateConnectionState *conn = state; +- SoupAuthNegotiatePrivate *priv = SOUP_AUTH_NEGOTIATE_GET_PRIVATE (auth); + GError *err = NULL; + + if (!check_auth_trusted_uri (auth, msg)) { +@@ -245,24 +233,19 @@ soup_auth_negotiate_update_connection (S + + conn->state = SOUP_NEGOTIATE_RECEIVED_CHALLENGE; + if (soup_gss_build_response (conn, SOUP_AUTH (auth), &err)) { +- /* Register the callbacks just once */ +- if (priv->message_finished_signal_id == 0) { +- gulong id = 0; +- id = g_signal_connect (msg, +- "finished", +- G_CALLBACK (remove_server_response_handler), +- auth); +- priv->message_finished_signal_id = id; +- } +- +- if (priv->message_got_headers_signal_id == 0) { +- gulong id = 0; ++ /* Connect the signal only once per message */ ++ if (!g_object_get_data (G_OBJECT (msg), "negotiate-got-headers-connected")) { + /* Wait for the 2xx response to verify server response */ +- id = g_signal_connect (msg, ++ g_signal_connect_data (msg, + "got_headers", + G_CALLBACK (check_server_response), +- auth); +- priv->message_got_headers_signal_id = id; ++ g_object_ref (auth), ++ (GClosureNotify) g_object_unref, ++ 0); ++ /* Mark that the signal was connected */ ++ g_object_set_data (G_OBJECT (msg), ++ "negotiate-got-headers-connected", ++ GINT_TO_POINTER (1)); + } + goto out; + } else { +@@ -333,7 +316,11 @@ check_server_response (SoupMessage *msg, + GError *err = NULL; + SoupAuthNegotiate *negotiate = auth; + SoupAuthNegotiatePrivate *priv = SOUP_AUTH_NEGOTIATE_GET_PRIVATE (negotiate); +- SoupNegotiateConnectionState *conn = priv->conn_state; ++ SoupNegotiateConnectionState *conn; ++ ++ conn = soup_connection_auth_get_connection_state_for_message (SOUP_CONNECTION_AUTH (auth), msg); ++ if (!conn) ++ return; + + if (auth != soup_message_get_auth (msg)) + return; +@@ -365,19 +352,6 @@ check_server_response (SoupMessage *msg, + g_clear_error (&err); + } + +-static void +-remove_server_response_handler (SoupMessage *msg, gpointer auth) +-{ +- SoupAuthNegotiate *negotiate = auth; +- SoupAuthNegotiatePrivate *priv = SOUP_AUTH_NEGOTIATE_GET_PRIVATE (negotiate); +- +- g_signal_handler_disconnect (msg, priv->message_got_headers_signal_id); +- priv->message_got_headers_signal_id = 0; +- +- g_signal_handler_disconnect (msg, priv->message_finished_signal_id); +- priv->message_finished_signal_id = 0; +-} +- + /* Check if scheme://host:port from message matches the given URI. */ + static gint + match_base_uri (SoupURI *list_uri, SoupURI *msg_uri) +diff -up libsoup-2.56.0/libsoup/soup-connection-auth.c.negotiate-internals libsoup-2.56.0/libsoup/soup-connection-auth.c +--- libsoup-2.56.0/libsoup/soup-connection-auth.c.negotiate-internals 2016-02-05 16:05:33.000000000 +0100 ++++ libsoup-2.56.0/libsoup/soup-connection-auth.c 2017-06-20 14:31:00.333517935 +0200 +@@ -71,12 +71,31 @@ soup_connection_auth_finalize (GObject * + G_OBJECT_CLASS (soup_connection_auth_parent_class)->finalize (object); + } + +-static gpointer +-get_connection_state_for_message (SoupConnectionAuth *auth, SoupMessage *msg) ++ ++/** ++ * soup_connection_auth_get_connection_state_for_message: ++ * @auth: a #SoupConnectionAuth ++ * @msg: a #SoupMessage ++ * ++ * Returns an associated connection state object for the given @auth and @msg. ++ * ++ * This function is only useful from within implementations of SoupConnectionAuth ++ * subclasses. ++ * ++ * Return value: (transfer none): the connection state ++ * ++ * Since: 2.56 ++ **/ ++gpointer ++soup_connection_auth_get_connection_state_for_message (SoupConnectionAuth *auth, ++ SoupMessage *msg) + { + SoupConnection *conn; + gpointer state; + ++ g_return_val_if_fail (SOUP_IS_CONNECTION_AUTH (auth), NULL); ++ g_return_val_if_fail (SOUP_IS_MESSAGE (msg), NULL); ++ + conn = soup_message_get_connection (msg); + state = g_hash_table_lookup (auth->priv->conns, conn); + if (state) +@@ -98,7 +117,7 @@ soup_connection_auth_update (SoupAuth + GHashTable *auth_params) + { + SoupConnectionAuth *cauth = SOUP_CONNECTION_AUTH (auth); +- gpointer conn = get_connection_state_for_message (cauth, msg); ++ gpointer conn = soup_connection_auth_get_connection_state_for_message (cauth, msg); + GHashTableIter iter; + GString *auth_header; + gpointer key, value; +@@ -140,7 +159,7 @@ soup_connection_auth_get_authorization ( + SoupMessage *msg) + { + SoupConnectionAuth *cauth = SOUP_CONNECTION_AUTH (auth); +- gpointer conn = get_connection_state_for_message (cauth, msg); ++ gpointer conn = soup_connection_auth_get_connection_state_for_message (cauth, msg); + + return SOUP_CONNECTION_AUTH_GET_CLASS (auth)-> + get_connection_authorization (cauth, msg, conn); +@@ -151,7 +170,7 @@ soup_connection_auth_is_ready (SoupAuth + SoupMessage *msg) + { + SoupConnectionAuth *cauth = SOUP_CONNECTION_AUTH (auth); +- gpointer conn = get_connection_state_for_message (cauth, msg); ++ gpointer conn = soup_connection_auth_get_connection_state_for_message (cauth, msg); + + return SOUP_CONNECTION_AUTH_GET_CLASS (auth)-> + is_connection_ready (SOUP_CONNECTION_AUTH (auth), msg, conn); +diff -up libsoup-2.56.0/libsoup/soup-connection-auth.h.negotiate-internals libsoup-2.56.0/libsoup/soup-connection-auth.h +--- libsoup-2.56.0/libsoup/soup-connection-auth.h.negotiate-internals 2016-09-16 17:14:27.000000000 +0200 ++++ libsoup-2.56.0/libsoup/soup-connection-auth.h 2017-06-20 14:31:00.333517935 +0200 +@@ -46,6 +46,10 @@ typedef struct { + + GType soup_connection_auth_get_type (void); + ++SOUP_AVAILABLE_IN_2_56 ++gpointer soup_connection_auth_get_connection_state_for_message ++ (SoupConnectionAuth *auth, ++ SoupMessage *message); + G_END_DECLS + + #endif /* SOUP_CONNECTION_AUTH_H */ diff --git a/SOURCES/rh1088458-ntlm-fix.patch b/SOURCES/rh1088458-ntlm-fix.patch deleted file mode 100644 index 7b0fbde..0000000 --- a/SOURCES/rh1088458-ntlm-fix.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up libsoup-2.44.2/libsoup/soup-auth-ntlm.c.ntlm-fix libsoup-2.44.2/libsoup/soup-auth-ntlm.c ---- libsoup-2.44.2/libsoup/soup-auth-ntlm.c.ntlm-fix 2013-11-11 11:02:00.000000000 -0400 -+++ libsoup-2.44.2/libsoup/soup-auth-ntlm.c 2014-04-29 11:52:15.974627250 -0400 -@@ -300,12 +300,14 @@ soup_auth_ntlm_update_connection (SoupCo - if (conn->state > SOUP_NTLM_SENT_REQUEST) { - if (priv->password_state == SOUP_NTLM_PASSWORD_ACCEPTED) { - /* We know our password is correct, so a 401 -- * means "permission denied". Since the conn -- * state is now FAILED, the auth is no longer -- * is_ready() for this message, so this will -- * cause a "retrying" authenticate signal. -+ * means "permission denied". The code can't deal -+ * with re-authenticating correctly, so make sure -+ * we don't try. - */ -- conn->state = SOUP_NTLM_FAILED; -+ if (soup_message_is_keepalive (msg)) { -+ soup_message_headers_append (msg->response_headers, -+ "Connection", "close"); -+ } - return TRUE; - } - diff --git a/SOURCES/rh1224989-make-check.patch b/SOURCES/rh1224989-make-check.patch deleted file mode 100644 index 892b057..0000000 --- a/SOURCES/rh1224989-make-check.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up libsoup-2.48.1/libsoup/Makefile.am.check libsoup-2.48.1/libsoup/Makefile.am ---- libsoup-2.48.1/libsoup/Makefile.am.check 2015-05-26 08:43:08.168859956 -0400 -+++ libsoup-2.48.1/libsoup/Makefile.am 2015-05-26 08:43:35.820163943 -0400 -@@ -304,6 +304,6 @@ check-local: - @nm $(builddir)/.libs/libsoup-2.4.so | \ - grep "^[[:xdigit:]]\+ [BTR] " | \ - sed "s/^[[:xdigit:]]\+ [BTR] //" | \ -- env LANG=C sort -u | \ -+ env LC_ALL=C sort -u | \ - diff -U0 $(srcdir)/libsoup-2.4.sym - >&2 - endif -diff -up libsoup-2.48.1/libsoup/Makefile.in.check libsoup-2.48.1/libsoup/Makefile.in ---- libsoup-2.48.1/libsoup/Makefile.in.check 2015-05-26 08:43:03.639973945 -0400 -+++ libsoup-2.48.1/libsoup/Makefile.in 2015-05-26 08:43:29.239329595 -0400 -@@ -1230,7 +1230,7 @@ include $(INTROSPECTION_MAKEFILE) - @OS_LINUX_TRUE@ @nm $(builddir)/.libs/libsoup-2.4.so | \ - @OS_LINUX_TRUE@ grep "^[[:xdigit:]]\+ [BTR] " | \ - @OS_LINUX_TRUE@ sed "s/^[[:xdigit:]]\+ [BTR] //" | \ --@OS_LINUX_TRUE@ env LANG=C sort -u | \ -+@OS_LINUX_TRUE@ env LC_ALL=C sort -u | \ - @OS_LINUX_TRUE@ diff -U0 $(srcdir)/libsoup-2.4.sym - >&2 - - # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/SOURCES/rh1302366-nul-in-headers.patch b/SOURCES/rh1302366-nul-in-headers.patch deleted file mode 100644 index 3f4feba..0000000 --- a/SOURCES/rh1302366-nul-in-headers.patch +++ /dev/null @@ -1,143 +0,0 @@ -diff -up libsoup-2.48.1/libsoup/soup-headers.c.nul-in-headers libsoup-2.48.1/libsoup/soup-headers.c ---- libsoup-2.48.1/libsoup/soup-headers.c.nul-in-headers 2014-11-30 16:32:58.000000000 +0100 -+++ libsoup-2.48.1/libsoup/soup-headers.c 2016-04-13 09:05:32.947147115 +0200 -@@ -35,17 +35,12 @@ soup_headers_parse (const char *str, int - const char *headers_start; - char *headers_copy, *name, *name_end, *value, *value_end; - char *eol, *sol, *p; -+ gsize copy_len; - gboolean success = FALSE; - - g_return_val_if_fail (str != NULL, FALSE); - g_return_val_if_fail (dest != NULL, FALSE); - -- /* RFC 2616 does allow NUL bytes in the headers, but httpbis -- * is changing that, and we can't deal with them anyway. -- */ -- if (memchr (str, '\0', len)) -- return FALSE; -- - /* As per RFC 2616 section 19.3, we treat '\n' as the - * line terminator, and '\r', if it appears, merely as - * ignorable trailing whitespace. -@@ -55,14 +50,28 @@ soup_headers_parse (const char *str, int - headers_start = memchr (str, '\n', len); - if (!headers_start) - return FALSE; -+ /* No '\0's in the Request-Line / Status-Line */ -+ if (memchr (str, '\0', headers_start - str)) -+ return FALSE; - - /* We work on a copy of the headers, which we can write '\0's - * into, so that we don't have to individually g_strndup and - * then g_free each header name and value. - */ -- headers_copy = g_strndup (headers_start, len - (headers_start - str)); -+ copy_len = len - (headers_start - str); -+ headers_copy = g_malloc (copy_len + 1); -+ memcpy (headers_copy, headers_start, copy_len); -+ headers_copy[copy_len] = '\0'; - value_end = headers_copy; - -+ /* There shouldn't be any '\0's in the headers already, but -+ * this is the web we're talking about. -+ */ -+ while ((p = memchr (headers_copy, '\0', copy_len))) { -+ memmove (p, p + 1, copy_len - (p - headers_copy)); -+ copy_len--; -+ } -+ - while (*(value_end + 1)) { - name = value_end + 1; - name_end = strchr (name, ':'); -diff -up libsoup-2.48.1/tests/header-parsing.c.nul-in-headers libsoup-2.48.1/tests/header-parsing.c ---- libsoup-2.48.1/tests/header-parsing.c.nul-in-headers 2014-12-07 15:55:22.000000000 +0100 -+++ libsoup-2.48.1/tests/header-parsing.c 2016-04-13 09:09:15.631137526 +0200 -@@ -358,6 +358,24 @@ static struct RequestTest { - } - }, - -+ { "NUL in header name", "760832", -+ "GET / HTTP/1.1\r\nHost\x00: example.com\r\n", 36, -+ SOUP_STATUS_OK, -+ "GET", "/", SOUP_HTTP_1_1, -+ { { "Host", "example.com" }, -+ { NULL } -+ } -+ }, -+ -+ { "NUL in header value", "760832", -+ "GET / HTTP/1.1\r\nHost: example\x00" "com\r\n", 35, -+ SOUP_STATUS_OK, -+ "GET", "/", SOUP_HTTP_1_1, -+ { { "Host", "examplecom" }, -+ { NULL } -+ } -+ }, -+ - /************************/ - /*** INVALID REQUESTS ***/ - /************************/ -@@ -418,20 +436,6 @@ static struct RequestTest { - { { NULL } } - }, - -- { "NUL in header name", "666316", -- "GET / HTTP/1.1\r\n\x00: silly\r\n", 37, -- SOUP_STATUS_BAD_REQUEST, -- NULL, NULL, -1, -- { { NULL } } -- }, -- -- { "NUL in header value", NULL, -- "GET / HTTP/1.1\r\nHost: example\x00com\r\n", 37, -- SOUP_STATUS_BAD_REQUEST, -- NULL, NULL, -1, -- { { NULL } } -- }, -- - { "No terminating CRLF", NULL, - "GET / HTTP/1.1\r\nHost: example.com", -1, - SOUP_STATUS_BAD_REQUEST, -@@ -608,6 +612,22 @@ static struct ResponseTest { - { NULL } } - }, - -+ { "NUL in header name", "760832", -+ "HTTP/1.1 200 OK\r\nF\x00oo: bar\r\n", 28, -+ SOUP_HTTP_1_1, SOUP_STATUS_OK, "OK", -+ { { "Foo", "bar" }, -+ { NULL } -+ } -+ }, -+ -+ { "NUL in header value", "760832", -+ "HTTP/1.1 200 OK\r\nFoo: b\x00" "ar\r\n", 28, -+ SOUP_HTTP_1_1, SOUP_STATUS_OK, "OK", -+ { { "Foo", "bar" }, -+ { NULL } -+ } -+ }, -+ - /*************************/ - /*** INVALID RESPONSES ***/ - /*************************/ -@@ -677,18 +697,6 @@ static struct ResponseTest { - -1, 0, NULL, - { { NULL } } - }, -- -- { "NUL in header name", NULL, -- "HTTP/1.1 200 OK\r\nF\x00oo: bar\r\n", 28, -- -1, 0, NULL, -- { { NULL } } -- }, -- -- { "NUL in header value", NULL, -- "HTTP/1.1 200 OK\r\nFoo: b\x00ar\r\n", 28, -- -1, 0, NULL, -- { { NULL } } -- }, - }; - static const int num_resptests = G_N_ELEMENTS (resptests); - diff --git a/SOURCES/rh1304238-ja-translation.patch b/SOURCES/rh1304238-ja-translation.patch deleted file mode 100644 index 417943b..0000000 --- a/SOURCES/rh1304238-ja-translation.patch +++ /dev/null @@ -1,160 +0,0 @@ -diff -up libsoup-2.48.1/po/ja.po.translation libsoup-2.48.1/po/ja.po ---- libsoup-2.48.1/po/ja.po.translation 2016-04-13 08:06:46.450298968 +0200 -+++ libsoup-2.48.1/po/ja.po 2016-04-13 08:06:56.466298536 +0200 -@@ -1,81 +1,133 @@ - # libsoup ja.po - # Copyright (C) 2012 libsoup's COPYRIGHT HOLDER - # This file is distributed under the same license as the libsoup package. --# Takayuki KUSANO , 2012. - # -+# Takayuki KUSANO , 2012, 2016. - msgid "" - msgstr "" - "Project-Id-Version: libsoup master\n" --"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=libsoup&keywords=I18N+L10N&component=general\n" --"POT-Creation-Date: 2012-11-02 19:31+0000\n" --"PO-Revision-Date: 2012-10-12 13:30+0900\n" --"Last-Translator: Takayuki KUSANO \n" --"Language-Team: Japanese \n" -+"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -+"product=libsoup&keywords=I18N+L10N&component=general\n" -+"POT-Creation-Date: 2016-03-14 13:25+0000\n" -+"PO-Revision-Date: 2016-03-15 10:19+1000\n" -+"Last-Translator: \n" -+"Language-Team: Japanese \n" - "Language: ja\n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" -+"Plural-Forms: nplurals=1; plural=0;\n" -+"X-Generator: Lokalize 1.5\n" - --#: ../libsoup/soup-body-input-stream.c:141 --#: ../libsoup/soup-body-input-stream.c:172 --#: ../libsoup/soup-body-input-stream.c:205 ../libsoup/soup-message-io.c:191 -+#: ../libsoup/soup-body-input-stream.c:140 -+#: ../libsoup/soup-body-input-stream.c:171 -+#: ../libsoup/soup-body-input-stream.c:204 ../libsoup/soup-message-io.c:200 - msgid "Connection terminated unexpectedly" - msgstr "接続が突然切断されました" - --#: ../libsoup/soup-body-input-stream.c:461 -+#: ../libsoup/soup-body-input-stream.c:462 - msgid "Invalid seek request" - msgstr "無効な seek 要求" - --#: ../libsoup/soup-body-input-stream.c:489 -+#: ../libsoup/soup-body-input-stream.c:490 - msgid "Cannot truncate SoupBodyInputStream" - msgstr "SoupBodyInputStream は truncate できません" - -+#: ../libsoup/soup-cache-input-stream.c:73 -+msgid "Network stream unexpectedly closed" -+msgstr "ネットワークストリームが予想外に閉じられました" -+ -+#: ../libsoup/soup-cache-input-stream.c:290 -+msgid "Failed to completely cache the resource" -+msgstr "リソースの完全なキャッシュに失敗しました" -+ - #: ../libsoup/soup-converter-wrapper.c:192 - #, c-format - msgid "Output buffer is too small" - msgstr "出力バッファーが小さすぎます" - --#: ../libsoup/soup-message-io.c:846 ../libsoup/soup-message-io.c:882 --msgid "Operation was cancelled" --msgstr "動作が中止されました" -+#: ../libsoup/soup-message-client-io.c:41 -+#| msgid "Could not parse URI '%s'" -+msgid "Could not parse HTTP response" -+msgstr "HTTP 応答をパースできませんでした" -+ -+#: ../libsoup/soup-message-client-io.c:66 -+msgid "Unrecognized HTTP response encoding" -+msgstr "認識できない HTTP 応答をエンコードしています" - --#: ../libsoup/soup-message-io.c:893 -+#: ../libsoup/soup-message-io.c:357 ../libsoup/soup-message-io.c:960 - msgid "Operation would block" - msgstr "動作はブロックします" - --#: ../libsoup/soup-request.c:142 -+#: ../libsoup/soup-message-io.c:912 ../libsoup/soup-message-io.c:949 -+msgid "Operation was cancelled" -+msgstr "動作が中止されました" -+ -+#: ../libsoup/soup-message-server-io.c:41 -+#| msgid "Could not parse URI '%s'" -+msgid "Could not parse HTTP request" -+msgstr "HTTP 応答ををパースできませんでした" -+ -+#: ../libsoup/soup-request.c:140 - #, c-format - msgid "No URI provided" - msgstr "URI が与えられていません" - --#: ../libsoup/soup-request.c:152 -+#: ../libsoup/soup-request.c:150 - #, c-format - msgid "Invalid '%s' URI: %s" - msgstr "不正なスキーム '%s' の URI: %s" - --#: ../libsoup/soup-requester.c:219 -+#: ../libsoup/soup-server.c:1529 -+msgid "Can't create a TLS server without a TLS certificate" -+msgstr "TLS 証明書がないと TLS サーバーは作成できません" -+ -+#: ../libsoup/soup-server.c:1548 -+#, c-format -+msgid "Could not listen on address %s, port %d" -+msgstr "アドレス %s、ポート %d をリッスンできませんでした" -+ -+#: ../libsoup/soup-session.c:4485 - #, c-format - msgid "Could not parse URI '%s'" - msgstr "URI '%s' をパースできませんでした" - --#: ../libsoup/soup-requester.c:253 -+#: ../libsoup/soup-session.c:4522 - #, c-format - msgid "Unsupported URI scheme '%s'" - msgstr "サポートされていない URI のスキーム '%s'" - --#: ../libsoup/soup-tld.c:154 -+#: ../libsoup/soup-session.c:4544 -+#, c-format -+msgid "Not an HTTP URI" -+msgstr "HTTP URI ではありません" -+ -+#: ../libsoup/soup-socket.c:142 -+msgid "Can't import non-socket as SoupSocket" -+msgstr "非ソケットを SoupSocket としてインポートできません" -+ -+#: ../libsoup/soup-socket.c:160 -+msgid "Could not import existing socket: " -+msgstr "既存のソケットをインポートできませんでした:" -+ -+#: ../libsoup/soup-socket.c:169 -+msgid "Can't import unconnected socket" -+msgstr "非接続ソケットをインポートできません" -+ -+#: ../libsoup/soup-tld.c:188 - msgid "Hostname is an IP address" - msgstr "ホスト名が IP アドレスです" - --#: ../libsoup/soup-tld.c:175 -+#: ../libsoup/soup-tld.c:198 ../libsoup/soup-tld.c:220 - msgid "Invalid hostname" - msgstr "不正なホスト名です" - --#: ../libsoup/soup-tld.c:204 -+#: ../libsoup/soup-tld.c:250 - msgid "Hostname has no base domain" - msgstr "ホスト名にトップレベルドメインがありません" - - # ソースコードと http://www.nic.ad.jp/ja/dom/system.html 参照 --#: ../libsoup/soup-tld.c:226 -+#: ../libsoup/soup-tld.c:304 - msgid "Not enough domains" - msgstr "ドメイン名が十分な数のラベルがありません" -+ diff --git a/SOURCES/rh1328453-ntlm-auth-failure.patch b/SOURCES/rh1328453-ntlm-auth-failure.patch deleted file mode 100644 index 5156faf..0000000 --- a/SOURCES/rh1328453-ntlm-auth-failure.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -up libsoup-2.48.1/libsoup/soup-auth-ntlm.c.ntlm-auth-failure libsoup-2.48.1/libsoup/soup-auth-ntlm.c ---- libsoup-2.48.1/libsoup/soup-auth-ntlm.c.ntlm-auth-failure 2016-04-19 17:53:34.747283256 +0200 -+++ libsoup-2.48.1/libsoup/soup-auth-ntlm.c 2016-04-19 17:53:34.753283256 +0200 -@@ -354,6 +354,7 @@ soup_auth_ntlm_update_connection (SoupCo - conn->state = SOUP_NTLM_SSO_FAILED; - success = FALSE; - } else if (!g_ascii_strcasecmp (response, "PW")) { -+ conn->state = SOUP_NTLM_SSO_FAILED; - priv->sso_available = FALSE; - g_free (response); - } else { -@@ -484,7 +485,7 @@ soup_auth_ntlm_get_connection_authorizat - priv->sso_available = FALSE; - } - } else { -- g_warning ("NTLM single-sign-on using %s failed", NTLM_AUTH); -+ g_debug ("NTLM single-sign-on using %s failed", NTLM_AUTH); - } - } - /* If NTLM single-sign-on fails, go back to original -@@ -519,7 +520,7 @@ soup_auth_ntlm_get_connection_authorizat - #ifdef USE_NTLM_AUTH - case SOUP_NTLM_SSO_FAILED: - /* Restart request without SSO */ -- g_warning ("NTLM single-sign-on by using %s failed", NTLM_AUTH); -+ g_debug ("NTLM single-sign-on by using %s failed", NTLM_AUTH); - priv->sso_available = FALSE; - header = soup_ntlm_request (); - conn->state = SOUP_NTLM_SENT_REQUEST; diff --git a/SOURCES/tcms-site-warning.patch b/SOURCES/tcms-site-warning.patch new file mode 100644 index 0000000..e13bd2e --- /dev/null +++ b/SOURCES/tcms-site-warning.patch @@ -0,0 +1,36 @@ +diff -up libsoup-2.56.0/libsoup/soup-auth-negotiate.c.tcms-site-warning libsoup-2.56.0/libsoup/soup-auth-negotiate.c +--- libsoup-2.56.0/libsoup/soup-auth-negotiate.c.tcms-site-warning 2017-06-20 14:41:20.593930021 +0200 ++++ libsoup-2.56.0/libsoup/soup-auth-negotiate.c 2017-06-20 14:41:20.601929988 +0200 +@@ -364,13 +364,28 @@ check_server_response (SoupMessage *msg, + + ret = soup_gss_client_step (conn, auth_headers + 10, &err); + +- priv->is_authenticated = ret == AUTH_GSS_COMPLETE; +- +- if (ret == AUTH_GSS_CONTINUE) { ++ switch (ret) { ++ case AUTH_GSS_COMPLETE: ++ priv->is_authenticated = TRUE; ++ break; ++ case AUTH_GSS_CONTINUE: + conn->state = SOUP_NEGOTIATE_RECEIVED_CHALLENGE; +- } else if (ret == AUTH_GSS_ERROR) { ++ break; ++ case AUTH_GSS_ERROR: + if (err) + g_warning ("%s", err->message); ++ /* Unfortunately, so many programs (curl, Firefox, ..) ignore ++ * the return token that is included in the response, so it is ++ * possible that there are servers that send back broken stuff. ++ * Try to behave in the right way (pass the token to ++ * gss_init_sec_context()), show a warning, but don't fail ++ * if the server returned 200. */ ++ if (msg->status_code == SOUP_STATUS_OK) ++ priv->is_authenticated = TRUE; ++ else ++ conn->state = SOUP_NEGOTIATE_FAILED; ++ break; ++ default: + conn->state = SOUP_NEGOTIATE_FAILED; + } + out: diff --git a/SPECS/libsoup.spec b/SPECS/libsoup.spec index bdcf84f..a8630d4 100644 --- a/SPECS/libsoup.spec +++ b/SPECS/libsoup.spec @@ -1,32 +1,33 @@ -%define glib2_version 2.42.0 - -### Abstract ### +%define glib2_version 2.38.0 Name: libsoup -Version: 2.48.1 -Release: 6%{?dist} -License: LGPLv2 -Group: Development/Libraries +Version: 2.56.0 +Release: 3%{?dist} Summary: Soup, an HTTP library implementation -URL: http://live.gnome.org/LibSoup -#VCS: git:git://git.gnome.org/libsoup -Source: http://download.gnome.org/sources/libsoup/2.48/libsoup-%{version}.tar.xz -Patch1: rh1088458-ntlm-fix.patch -Patch2: rh1224989-make-check.patch -Patch3: rh1304238-ja-translation.patch -Patch4: rh1302366-nul-in-headers.patch -Patch5: rh1328453-ntlm-auth-failure.patch -Requires: glib-networking >= %{glib2_version} - -### Build Dependencies ### +License: LGPLv2 +URL: https://wiki.gnome.org/Projects/libsoup +Source0: https://download.gnome.org/sources/%{name}/2.56/%{name}-%{version}.tar.xz + +Patch01: coverity-scan-issues.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1439798 +# https://bugzilla.gnome.org/show_bug.cgi?id=782939 +Patch02: get-leaks.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=782940 +Patch03: negotiate-internals.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=783780 +Patch04: negotiate-connection-close.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=783781 +Patch05: tcms-site-warning.patch BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: glib-networking -BuildRequires: gobject-introspection-devel BuildRequires: intltool -BuildRequires: libxml2-devel -BuildRequires: sqlite-devel +BuildRequires: krb5-devel >= 1.11 +BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(sqlite3) +BuildRequires: vala Requires: glib2%{?_isa} >= %{glib2_version} Requires: glib-networking%{?_isa} >= %{glib2_version} @@ -44,7 +45,6 @@ supported for those who want it). %package devel Summary: Header files for the Soup library -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel @@ -53,11 +53,11 @@ you to develop applications that use the libsoup library. %prep %setup -q -%patch1 -p1 -b .ntlm-fix -%patch2 -p1 -b .check -%patch3 -p1 -b .ja-translation -%patch4 -p1 -b .nul-in-headers -%patch5 -p1 -b .ntlm-auth-failure +%patch01 -p1 -b .coverity-scan-issues +%patch02 -p1 -b .get-leaks +%patch03 -p1 -b .negotiate-internals +%patch04 -p1 -b .negotiate-connection-close +%patch05 -p1 -b .tcms-site-warning %build %configure --disable-static @@ -68,7 +68,7 @@ sed --in-place --expression 's! -shared ! -Wl,--as-needed\0!g' libtool make %{?_smp_mflags} %install -make DESTDIR=$RPM_BUILD_ROOT install +%make_install rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la @@ -79,7 +79,8 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la %postun -p /sbin/ldconfig %files -f libsoup.lang -%doc README COPYING NEWS AUTHORS +%license COPYING +%doc README NEWS AUTHORS %{_libdir}/lib*.so.* %{_libdir}/girepository-1.0/Soup*2.4.typelib @@ -90,8 +91,22 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la %{_libdir}/pkgconfig/*.pc %{_datadir}/gir-1.0/Soup*2.4.gir %{_datadir}/gtk-doc/html/%{name}-2.4 +%dir %{_datadir}/vala +%dir %{_datadir}/vala/vapi +%{_datadir}/vala/vapi/libsoup-2.4.deps +%{_datadir}/vala/vapi/libsoup-2.4.vapi %changelog +* Thu Jun 22 2017 Tomas Popela - 2.56.0-3 +- libsoup stuck on infinite loop for kerberized pages (rh #1439798) + +* Wed Apr 26 2017 Milan Crha - 2.56.0-2 +- Add patch to address some of Coverity Scan and clang reported issues + +* Mon Sep 19 2016 Kalev Lember - 2.56.0-1 +- Update to 2.56.0 +- Resolves: #1387019 + * Tue Apr 19 2016 Milan Crha - 2.48.1-6 - NTLM auth failure with latest samba (rh #1328453)