diff options
| author | Changqing Li <changqing.li@windriver.com> | 2025-05-08 17:54:27 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-12 22:01:55 +0100 |
| commit | d491b6303584033e6c49e886b4630096e8006294 (patch) | |
| tree | 47fb83a393587ddeb9f3197233981d9896555a42 | |
| parent | 534f92cb0a0d4a3cbf73c42488f4a5a4c8e8791c (diff) | |
| download | poky-d491b6303584033e6c49e886b4630096e8006294.tar.gz | |
libsoup-2.4: fix build failure
Backport 2 patches to fix build failures
(From OE-Core rev: 31ddbed4155f36ff8cda5fcf7e6c301ae63cd62f)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 192 insertions, 1 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/0001-Fix-possibly-uninitialized-warnings.patch b/meta/recipes-support/libsoup/libsoup-2.4/0001-Fix-possibly-uninitialized-warnings.patch new file mode 100644 index 0000000000..fcd442c13a --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/0001-Fix-possibly-uninitialized-warnings.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 1159686379184a1c899eabb2174258aba5e0fd79 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Patrick Griffis <pgriffis@igalia.com> | ||
| 3 | Date: Mon, 20 Sep 2021 15:41:31 -0500 | ||
| 4 | Subject: [PATCH] Fix possibly uninitialized warnings | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/fb98e9a8c3062c75357b961543af091de2dd5459] | ||
| 7 | |||
| 8 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 9 | --- | ||
| 10 | libsoup/soup-websocket-connection.c | 2 +- | ||
| 11 | tests/samesite-test.c | 3 +++ | ||
| 12 | 2 files changed, 4 insertions(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c | ||
| 15 | index 65c1492..585d45c 100644 | ||
| 16 | --- a/libsoup/soup-websocket-connection.c | ||
| 17 | +++ b/libsoup/soup-websocket-connection.c | ||
| 18 | @@ -471,7 +471,7 @@ send_message (SoupWebsocketConnection *self, | ||
| 19 | GByteArray *bytes; | ||
| 20 | gsize frame_len; | ||
| 21 | guint8 *outer; | ||
| 22 | - guint8 mask_offset; | ||
| 23 | + guint8 mask_offset = 0; | ||
| 24 | GBytes *filtered_bytes; | ||
| 25 | GList *l; | ||
| 26 | GError *error = NULL; | ||
| 27 | diff --git a/tests/samesite-test.c b/tests/samesite-test.c | ||
| 28 | index 0b081b2..60c9b8e 100644 | ||
| 29 | --- a/tests/samesite-test.c | ||
| 30 | +++ b/tests/samesite-test.c | ||
| 31 | @@ -60,6 +60,9 @@ assert_highest_policy_visible (GSList *cookies, SoupSameSitePolicy policy) | ||
| 32 | case SOUP_SAME_SITE_POLICY_NONE: | ||
| 33 | expected_count = 1; | ||
| 34 | break; | ||
| 35 | + default: | ||
| 36 | + g_assert_not_reached (); | ||
| 37 | + break; | ||
| 38 | } | ||
| 39 | |||
| 40 | g_assert_cmpuint (size, ==, expected_count); | ||
| 41 | -- | ||
| 42 | 2.34.1 | ||
| 43 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch b/meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch new file mode 100644 index 0000000000..0d4139ec08 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/0001-Remove-http-and-https-aliases-support-test.patch | |||
| @@ -0,0 +1,145 @@ | |||
| 1 | From 0e3bfa22b23451531caf8cc30b1771ac6a41fcad Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Carlos Garcia Campos <cgarcia@igalia.com> | ||
| 3 | Date: Thu, 11 Feb 2021 10:47:09 +0100 | ||
| 4 | Subject: [PATCH] Remove http and https aliases support test | ||
| 5 | |||
| 6 | Upstream has removed the whole function of http and https aliases | ||
| 7 | support, this commit partially cherry pick it, only remove the test to | ||
| 8 | mute the warning: | ||
| 9 | | ../libsoup-2.74.3/tests/server-test.c: In function 'do_one_server_aliases_test': | ||
| 10 | | ../libsoup-2.74.3/tests/server-test.c:180:17: warning: 'g_socket_client_set_tls_validation_flags' is deprecated [-Wdeprecated-declarations] | ||
| 11 | | 180 | g_socket_client_set_tls_validation_flags (client, 0); | ||
| 12 | | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/111ae4ebe7cc2e389573cff5b9ac76509d6cbac0] | ||
| 15 | |||
| 16 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 17 | --- | ||
| 18 | tests/server-test.c | 104 -------------------------------------------- | ||
| 19 | 1 file changed, 104 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/tests/server-test.c b/tests/server-test.c | ||
| 22 | index 8976103..cb7e815 100644 | ||
| 23 | --- a/tests/server-test.c | ||
| 24 | +++ b/tests/server-test.c | ||
| 25 | @@ -154,108 +154,6 @@ do_star_test (ServerData *sd, gconstpointer test_data) | ||
| 26 | soup_uri_free (star_uri); | ||
| 27 | } | ||
| 28 | |||
| 29 | -static void | ||
| 30 | -do_one_server_aliases_test (SoupURI *uri, | ||
| 31 | - const char *alias, | ||
| 32 | - gboolean succeed) | ||
| 33 | -{ | ||
| 34 | - GSocketClient *client; | ||
| 35 | - GSocketConnectable *addr; | ||
| 36 | - GSocketConnection *conn; | ||
| 37 | - GInputStream *in; | ||
| 38 | - GOutputStream *out; | ||
| 39 | - GError *error = NULL; | ||
| 40 | - GString *req; | ||
| 41 | - static char buf[1024]; | ||
| 42 | - | ||
| 43 | - debug_printf (1, " %s via %s\n", alias, uri->scheme); | ||
| 44 | - | ||
| 45 | - /* There's no way to make libsoup's client side send an absolute | ||
| 46 | - * URI (to a non-proxy server), so we have to fake this. | ||
| 47 | - */ | ||
| 48 | - | ||
| 49 | - client = g_socket_client_new (); | ||
| 50 | - if (uri->scheme == SOUP_URI_SCHEME_HTTPS) { | ||
| 51 | - g_socket_client_set_tls (client, TRUE); | ||
| 52 | - g_socket_client_set_tls_validation_flags (client, 0); | ||
| 53 | - } | ||
| 54 | - addr = g_network_address_new (uri->host, uri->port); | ||
| 55 | - | ||
| 56 | - conn = g_socket_client_connect (client, addr, NULL, &error); | ||
| 57 | - g_object_unref (addr); | ||
| 58 | - g_object_unref (client); | ||
| 59 | - if (!conn) { | ||
| 60 | - g_assert_no_error (error); | ||
| 61 | - g_error_free (error); | ||
| 62 | - return; | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - in = g_io_stream_get_input_stream (G_IO_STREAM (conn)); | ||
| 66 | - out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); | ||
| 67 | - | ||
| 68 | - req = g_string_new (NULL); | ||
| 69 | - g_string_append_printf (req, "GET %s://%s:%d HTTP/1.1\r\n", | ||
| 70 | - alias, uri->host, uri->port); | ||
| 71 | - g_string_append_printf (req, "Host: %s:%d\r\n", | ||
| 72 | - uri->host, uri->port); | ||
| 73 | - g_string_append (req, "Connection: close\r\n\r\n"); | ||
| 74 | - | ||
| 75 | - if (!g_output_stream_write_all (out, req->str, req->len, NULL, NULL, &error)) { | ||
| 76 | - g_assert_no_error (error); | ||
| 77 | - g_error_free (error); | ||
| 78 | - g_object_unref (conn); | ||
| 79 | - g_string_free (req, TRUE); | ||
| 80 | - return; | ||
| 81 | - } | ||
| 82 | - g_string_free (req, TRUE); | ||
| 83 | - | ||
| 84 | - if (!g_input_stream_read_all (in, buf, sizeof (buf), NULL, NULL, &error)) { | ||
| 85 | - g_assert_no_error (error); | ||
| 86 | - g_error_free (error); | ||
| 87 | - g_object_unref (conn); | ||
| 88 | - return; | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - if (succeed) | ||
| 92 | - g_assert_true (g_str_has_prefix (buf, "HTTP/1.1 200 ")); | ||
| 93 | - else | ||
| 94 | - g_assert_true (g_str_has_prefix (buf, "HTTP/1.1 400 ")); | ||
| 95 | - | ||
| 96 | - g_io_stream_close (G_IO_STREAM (conn), NULL, NULL); | ||
| 97 | - g_object_unref (conn); | ||
| 98 | -} | ||
| 99 | - | ||
| 100 | -static void | ||
| 101 | -do_server_aliases_test (ServerData *sd, gconstpointer test_data) | ||
| 102 | -{ | ||
| 103 | - char *http_aliases[] = { "dav", NULL }; | ||
| 104 | - char *https_aliases[] = { "davs", NULL }; | ||
| 105 | - char *http_good[] = { "http", "dav", NULL }; | ||
| 106 | - char *http_bad[] = { "https", "davs", "fred", NULL }; | ||
| 107 | - char *https_good[] = { "https", "davs", NULL }; | ||
| 108 | - char *https_bad[] = { "http", "dav", "fred", NULL }; | ||
| 109 | - int i; | ||
| 110 | - | ||
| 111 | - g_test_bug ("703694"); | ||
| 112 | - | ||
| 113 | - g_object_set (G_OBJECT (sd->server), | ||
| 114 | - SOUP_SERVER_HTTP_ALIASES, http_aliases, | ||
| 115 | - SOUP_SERVER_HTTPS_ALIASES, https_aliases, | ||
| 116 | - NULL); | ||
| 117 | - | ||
| 118 | - for (i = 0; http_good[i]; i++) | ||
| 119 | - do_one_server_aliases_test (sd->base_uri, http_good[i], TRUE); | ||
| 120 | - for (i = 0; http_bad[i]; i++) | ||
| 121 | - do_one_server_aliases_test (sd->base_uri, http_bad[i], FALSE); | ||
| 122 | - | ||
| 123 | - if (tls_available) { | ||
| 124 | - for (i = 0; https_good[i]; i++) | ||
| 125 | - do_one_server_aliases_test (sd->ssl_base_uri, https_good[i], TRUE); | ||
| 126 | - for (i = 0; https_bad[i]; i++) | ||
| 127 | - do_one_server_aliases_test (sd->ssl_base_uri, https_bad[i], FALSE); | ||
| 128 | - } | ||
| 129 | -} | ||
| 130 | - | ||
| 131 | static void | ||
| 132 | do_dot_dot_test (ServerData *sd, gconstpointer test_data) | ||
| 133 | { | ||
| 134 | @@ -1382,8 +1280,6 @@ main (int argc, char **argv) | ||
| 135 | |||
| 136 | g_test_add ("/server/OPTIONS *", ServerData, NULL, | ||
| 137 | server_setup, do_star_test, server_teardown); | ||
| 138 | - g_test_add ("/server/aliases", ServerData, NULL, | ||
| 139 | - server_setup, do_server_aliases_test, server_teardown); | ||
| 140 | g_test_add ("/server/..-in-path", ServerData, NULL, | ||
| 141 | server_setup, do_dot_dot_test, server_teardown); | ||
| 142 | g_test_add ("/server/ipv6", ServerData, NULL, | ||
| 143 | -- | ||
| 144 | 2.34.1 | ||
| 145 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb b/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb index 25e0d7dcbc..5753ab2745 100644 --- a/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +++ b/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb | |||
| @@ -13,7 +13,10 @@ SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" | |||
| 13 | 13 | ||
| 14 | SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ | 14 | SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ |
| 15 | file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch \ | 15 | file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch \ |
| 16 | file://0001-CVE-2025-32911.patch" | 16 | file://0001-CVE-2025-32911.patch \ |
| 17 | file://0001-Fix-possibly-uninitialized-warnings.patch \ | ||
| 18 | file://0001-Remove-http-and-https-aliases-support-test.patch" | ||
| 19 | |||
| 17 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" | 20 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" |
| 18 | 21 | ||
| 19 | CVE_PRODUCT = "libsoup" | 22 | CVE_PRODUCT = "libsoup" |
