From 214b5f8436a8bfb2c9813dd77d4c732f2f80c1be Mon Sep 17 00:00:00 2001 From: yangcheng1203 Date: Fri, 17 Sep 2021 10:50:57 +0800 Subject: [PATCH] fix the 2.66.8 version update error --- ...ry-leaks-of-error-in-completion-case.patch | 68 +++ backport-gapplication-Fix-a-memory-leak.patch | 24 + backport-gdbusauth-fix-error-leak.patch | 27 + ...anagerservice-fix-leak-in-error-path.patch | 43 ++ ...ileenumerator-fix-leak-in-error-path.patch | 29 + ...k-when-getting-GSettingsAction-state.patch | 28 + ...t-Crash-on-error-if-error-is-missing.patch | 59 ++ ...-RESOLVING-RESOLVED-events-only-once.patch | 118 ++++ ...rash-when-async-connectio-step-fails.patch | 38 ++ ...etclient-return-best-errors-possible.patch | 520 ++++++++++++++++++ ...t-IP-BIND-ADDRESS-NO-PORT-if-binding.patch | 58 ++ ...tally-delete-temp-file-within-dtrace.patch | 31 ++ glib2.spec | 66 ++- 13 files changed, 1102 insertions(+), 7 deletions(-) create mode 100644 backport-Correct-memory-leaks-of-error-in-completion-case.patch create mode 100644 backport-gapplication-Fix-a-memory-leak.patch create mode 100644 backport-gdbusauth-fix-error-leak.patch create mode 100644 backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch create mode 100644 backport-gfileenumerator-fix-leak-in-error-path.patch create mode 100644 backport-gsettings-Fix-a-minor-memory-leak-when-getting-GSettingsAction-state.patch create mode 100644 backport-gsocketclient-Crash-on-error-if-error-is-missing.patch create mode 100644 backport-gsocketclient-emit-RESOLVING-RESOLVED-events-only-once.patch create mode 100644 backport-gsocketclient-fix-crash-when-async-connectio-step-fails.patch create mode 100644 backport-gsocketclient-return-best-errors-possible.patch create mode 100644 backport-gsocketclient-set-IP-BIND-ADDRESS-NO-PORT-if-binding.patch create mode 100644 fix-accidentally-delete-temp-file-within-dtrace.patch diff --git a/backport-Correct-memory-leaks-of-error-in-completion-case.patch b/backport-Correct-memory-leaks-of-error-in-completion-case.patch new file mode 100644 index 0000000..d35626a --- /dev/null +++ b/backport-Correct-memory-leaks-of-error-in-completion-case.patch @@ -0,0 +1,68 @@ +From 1c7c849d34ee89a030fe0d85e326311741a0f3d1 Mon Sep 17 00:00:00 2001 +From: Frederic Martinsons +Date: Tue, 26 Jan 2021 15:43:46 +0100 +Subject: [PATCH] Correct memory leaks of error in completion case. + +Signed-off-by: Frederic Martinsons + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/1c7c849d34ee89a030fe0d85e326311741a0f3d1 + +--- + gio/gdbus-tool.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c +index 5cb80b45f7..06f61cfac6 100644 +--- a/gio/gdbus-tool.c ++++ b/gio/gdbus-tool.c +@@ -681,8 +681,8 @@ handle_emit (gint *argc, + else + { + g_printerr (_("Error connecting: %s\n"), error->message); +- g_error_free (error); + } ++ g_error_free (error); + goto out; + } + +@@ -995,8 +995,8 @@ handle_call (gint *argc, + else + { + g_printerr (_("Error connecting: %s\n"), error->message); +- g_error_free (error); + } ++ g_error_free (error); + goto out; + } + +@@ -1825,8 +1825,8 @@ handle_introspect (gint *argc, + else + { + g_printerr (_("Error connecting: %s\n"), error->message); +- g_error_free (error); + } ++ g_error_free (error); + goto out; + } + +@@ -2057,8 +2057,8 @@ handle_monitor (gint *argc, + else + { + g_printerr (_("Error connecting: %s\n"), error->message); +- g_error_free (error); + } ++ g_error_free (error); + goto out; + } + +@@ -2277,8 +2277,8 @@ handle_wait (gint *argc, + else + { + g_printerr (_("Error connecting: %s\n"), error->message); +- g_error_free (error); + } ++ g_error_free (error); + goto out; + } + diff --git a/backport-gapplication-Fix-a-memory-leak.patch b/backport-gapplication-Fix-a-memory-leak.patch new file mode 100644 index 0000000..355f6bf --- /dev/null +++ b/backport-gapplication-Fix-a-memory-leak.patch @@ -0,0 +1,24 @@ +From a1203b3d3bbdf3f851ffa5a903cf4fb9644e5943 Mon Sep 17 00:00:00 2001 +From: Mohammed Sadiq +Date: Thu, 4 Feb 2021 18:36:45 +0530 +Subject: [PATCH] gapplication: Fix a memory leak + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/a1203b3d3bbdf3f851ffa5a903cf4fb9644e5943 + +--- + gio/gapplication.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/gapplication.c b/gio/gapplication.c +index 1c560e5e8c..3720146af9 100644 +--- a/gio/gapplication.c ++++ b/gio/gapplication.c +@@ -1091,6 +1091,7 @@ g_application_real_local_command_line (GApplication *application, + if (!options) + { + g_printerr ("%s\n", error->message); ++ g_error_free (error); + *exit_status = 1; + return TRUE; + } diff --git a/backport-gdbusauth-fix-error-leak.patch b/backport-gdbusauth-fix-error-leak.patch new file mode 100644 index 0000000..709b71e --- /dev/null +++ b/backport-gdbusauth-fix-error-leak.patch @@ -0,0 +1,27 @@ +From 2b29495bcb59ba00bec808c509112dae6e019fd7 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 31 Mar 2021 14:12:39 -0500 +Subject: [PATCH] gdbusauth: fix error leak + +local_error is leaked in the G_IO_ERROR_NOT_SUPPORTED case. Found by +Coverity. + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/2b29495bcb59ba00bec808c509112dae6e019fd7 + +--- + gio/gdbusauth.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c +index c430f0cf03..534dca2d19 100644 +--- a/gio/gdbusauth.c ++++ b/gio/gdbusauth.c +@@ -1007,6 +1007,7 @@ _g_dbus_auth_run_server (GDBusAuth *auth, + g_propagate_error (error, local_error); + goto out; + } ++ g_clear_error (&local_error); + } + else + { diff --git a/backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch b/backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch new file mode 100644 index 0000000..79cf015 --- /dev/null +++ b/backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch @@ -0,0 +1,43 @@ +From 719484a5754cca036d123ae4c2ae3d150bacef32 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 31 Mar 2021 14:23:13 -0500 +Subject: [PATCH] gdbusobjectmanagerservice: fix leak in error path + +If the third g_return_val_if_fail() is hit, then we leak +orig_object_path. There is no reason we need to strdup it here. + +Found by Coverity. + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/719484a5754cca036d123ae4c2ae3d150bacef32 +--- + gio/gdbusobjectmanagerserver.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/gio/gdbusobjectmanagerserver.c b/gio/gdbusobjectmanagerserver.c +index 39f4ed5006..0a0cea84ab 100644 +--- a/gio/gdbusobjectmanagerserver.c ++++ b/gio/gdbusobjectmanagerserver.c +@@ -565,12 +565,12 @@ void + g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager, + GDBusObjectSkeleton *object) + { +- gchar *orig_object_path; ++ const gchar *orig_object_path; + gchar *object_path; + guint count; + gboolean modified; + +- orig_object_path = g_strdup (g_dbus_object_get_object_path (G_DBUS_OBJECT (object))); ++ orig_object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (object)); + + g_return_if_fail (G_IS_DBUS_OBJECT_MANAGER_SERVER (manager)); + g_return_if_fail (G_IS_DBUS_OBJECT (object)); +@@ -602,7 +602,6 @@ g_dbus_object_manager_server_export_uniquely (GDBusObjectManagerServer *manager, + g_dbus_object_skeleton_set_object_path (G_DBUS_OBJECT_SKELETON (object), object_path); + + g_free (object_path); +- g_free (orig_object_path); + + } + diff --git a/backport-gfileenumerator-fix-leak-in-error-path.patch b/backport-gfileenumerator-fix-leak-in-error-path.patch new file mode 100644 index 0000000..ddfe7fc --- /dev/null +++ b/backport-gfileenumerator-fix-leak-in-error-path.patch @@ -0,0 +1,29 @@ +From 8bfc2998135ee9c4460520febb3af720c61438a5 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Thu, 1 Apr 2021 14:13:19 -0500 +Subject: [PATCH] gfileenumerator: fix leak in error path + +Found by Coverity. + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/8bfc2998135ee9c4460520febb3af720c61438a5 +--- + gio/gfileenumerator.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c +index ac2e4eb980..1f9bc24ebe 100644 +--- a/gio/gfileenumerator.c ++++ b/gio/gfileenumerator.c +@@ -787,7 +787,10 @@ next_files_thread (GTask *task, + } + + if (error) +- g_task_return_error (task, error); ++ { ++ g_list_free_full (files, g_object_unref); ++ g_task_return_error (task, error); ++ } + else + g_task_return_pointer (task, files, (GDestroyNotify)next_async_op_free); + } diff --git a/backport-gsettings-Fix-a-minor-memory-leak-when-getting-GSettingsAction-state.patch b/backport-gsettings-Fix-a-minor-memory-leak-when-getting-GSettingsAction-state.patch new file mode 100644 index 0000000..2c48db8 --- /dev/null +++ b/backport-gsettings-Fix-a-minor-memory-leak-when-getting-GSettingsAction-state.patch @@ -0,0 +1,28 @@ +From 1cde07b9789ff3b58be4af4596065d4f6fc365f0 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Tue, 15 Dec 2020 10:54:41 +0000 +Subject: [PATCH] gsettings: Fix a minor memory leak when getting + GSettingsAction:state + +Signed-off-by: Philip Withnall + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/1cde07b9789ff3b58be4af4596065d4f6fc365f0 + +--- + gio/gsettings.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/gsettings.c b/gio/gsettings.c +index 4332ebe444..9a04a86309 100644 +--- a/gio/gsettings.c ++++ b/gio/gsettings.c +@@ -3296,7 +3296,7 @@ g_settings_action_get_property (GObject *object, guint prop_id, + break; + + case ACTION_PROP_STATE: +- g_value_set_variant (value, g_settings_action_get_state (action)); ++ g_value_take_variant (value, g_settings_action_get_state (action)); + break; + + default: diff --git a/backport-gsocketclient-Crash-on-error-if-error-is-missing.patch b/backport-gsocketclient-Crash-on-error-if-error-is-missing.patch new file mode 100644 index 0000000..b73aebd --- /dev/null +++ b/backport-gsocketclient-Crash-on-error-if-error-is-missing.patch @@ -0,0 +1,59 @@ +From 14f7b5e590f6adc3207019227586d20848274654 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Mon, 5 Oct 2020 12:32:32 -0500 +Subject: [PATCH 0990/1095] gsocketclient: Crash on error if error is missing + +We should never return unknown errors to the application. This would be +a glib bug. + +I don't think it's currently possible to hit these cases, so asserts +should be OK. For this to happen, either (a) a GSocketAddressEnumerator +would have to return NULL on its first enumeration, without returning an +error, or (b) there would have to be a bug in our GSocketClient logic. +Either way, if such a bug were to exist, it would be better to surface +it rather than hide it. + +These changes are actually going to be effectively undone in a +subsequent commit, as I'm refactoring the error handling, but the commit +history is a bit nicer with two separate commits, so let's go with two. + +reason:Crash on error if error is missing + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/14f7b5e590f6adc3207019227586d20848274654 +--- + gio/gsocketclient.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c +index 9df8f29..fb68c09 100644 +--- a/gio/gsocketclient.c ++++ b/gio/gsocketclient.c +@@ -1053,8 +1053,9 @@ g_socket_client_connect (GSocketClient *client, + g_propagate_error (error, last_error); + } + else +- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, +- _("Unknown error on connect")); ++ { ++ g_assert_not_reached (); ++ } + break; + } + +@@ -1879,10 +1880,9 @@ g_socket_client_enumerator_callback (GObject *object, + error = data->last_error; + data->last_error = NULL; + } +- else if (!error) ++ else + { +- g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, +- _("Unknown error on connect")); ++ g_assert (error); + } + + complete_connection_with_error (data, error); +-- +1.8.3.1 + diff --git a/backport-gsocketclient-emit-RESOLVING-RESOLVED-events-only-once.patch b/backport-gsocketclient-emit-RESOLVING-RESOLVED-events-only-once.patch new file mode 100644 index 0000000..e94d936 --- /dev/null +++ b/backport-gsocketclient-emit-RESOLVING-RESOLVED-events-only-once.patch @@ -0,0 +1,118 @@ +From f0a7b147806e852e2090eeda6e4e38f7d3f52b52 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Tue, 6 Oct 2020 15:39:45 -0500 +Subject: [PATCH 0989/1095] gsocketclient: emit RESOLVING/RESOLVED events only + once + +GSocketAddressEnumerator encapsulates the details of how DNS happens, so +we don't have to think about it. But we may have taken encapsulation a +bit too far, here. Usually, we resolve a domain name to a list of IPv4 +and IPv6 addresses. Then we go through each address in the list and try +to connect to it. Name resolution happens exactly once, at the start. +It doesn't happen each time we enumerate the enumerator. In theory, it +*could*, because we've designed these APIs to be agnostic of underlying +implementation details like DNS and network protocols. But in practice, +we know that's not really what's happening. It's weird to say that we +are RESOLVING what we know to be the same name multiple times. Behind +the scenes, we're not doing that. + +This also fixes #1994, where enumeration can end with a RESOLVING event, +even though this is supposed to be the first event rather than the last. +I thought this would be hard to fix, even requiring new public API in +GSocketAddressEnumerator to peek ahead to see if the next enumeration is +going to return NULL. Then I decided we should just fake it: always emit +both RESOLVING and RESOLVED at the same time right after each +enumeration. Finally, I realized we can emit them at the correct time if +we simply assume resolving only happens the first time. This seems like +the most elegant of the possible solutions. + +Now, this is a behavior change, and arguably an API break, but it should +align better with reasonable expectations of how GSocketClientEvent +ought to work. I don't expect it to break anything besides tests that +check which order GSocketClientEvent events are emitted in. (Currently, +libsoup has such tests, which will need to be updated.) Ideally we would +have GLib-level tests as well, but in a concession to pragmatism, it's a +lot easier to keep network tests in libsoup. + +reason:emit RESOLVING/RESOLVED events only once + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/f0a7b147806e852e2090eeda6e4e38f7d3f52b52 +--- + gio/gsocketclient.c | 29 +++++++++++++++++++++-------- + 1 file changed, 21 insertions(+), 8 deletions(-) + +diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c +index 8a663c3..9df8f29 100644 +--- a/gio/gsocketclient.c ++++ b/gio/gsocketclient.c +@@ -991,6 +991,7 @@ g_socket_client_connect (GSocketClient *client, + { + GIOStream *connection = NULL; + GSocketAddressEnumerator *enumerator = NULL; ++ gboolean ever_resolved = FALSE; + GError *last_error, *tmp_error; + + last_error = NULL; +@@ -1025,10 +1026,20 @@ g_socket_client_connect (GSocketClient *client, + } + + tmp_error = NULL; +- g_socket_client_emit_event (client, G_SOCKET_CLIENT_RESOLVING, +- connectable, NULL); ++ ++ if (!ever_resolved) ++ { ++ g_socket_client_emit_event (client, G_SOCKET_CLIENT_RESOLVING, ++ connectable, NULL); ++ } + address = g_socket_address_enumerator_next (enumerator, cancellable, + &tmp_error); ++ if (!ever_resolved) ++ { ++ g_socket_client_emit_event (client, G_SOCKET_CLIENT_RESOLVED, ++ connectable, NULL); ++ ever_resolved = TRUE; ++ } + + if (address == NULL) + { +@@ -1046,8 +1057,6 @@ g_socket_client_connect (GSocketClient *client, + _("Unknown error on connect")); + break; + } +- g_socket_client_emit_event (client, G_SOCKET_CLIENT_RESOLVED, +- connectable, NULL); + + using_proxy = (G_IS_PROXY_ADDRESS (address) && + client->priv->enable_proxy); +@@ -1509,7 +1518,8 @@ enumerator_next_async (GSocketClientAsyncConnectData *data, + if (add_task_ref) + g_object_ref (data->task); + +- g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVING, data->connectable, NULL); ++ if (!data->enumerated_at_least_once) ++ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVING, data->connectable, NULL); + g_debug ("GSocketClient: Starting new address enumeration"); + g_socket_address_enumerator_next_async (data->enumerator, + data->enumeration_cancellable, +@@ -1883,10 +1893,13 @@ g_socket_client_enumerator_callback (GObject *object, + return; + } + +- data->enumerated_at_least_once = TRUE; + g_debug ("GSocketClient: Address enumeration succeeded"); +- g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVED, +- data->connectable, NULL); ++ if (!data->enumerated_at_least_once) ++ { ++ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVED, ++ data->connectable, NULL); ++ data->enumerated_at_least_once = TRUE; ++ } + + g_clear_error (&data->last_error); + +-- +1.8.3.1 + diff --git a/backport-gsocketclient-fix-crash-when-async-connectio-step-fails.patch b/backport-gsocketclient-fix-crash-when-async-connectio-step-fails.patch new file mode 100644 index 0000000..59b2460 --- /dev/null +++ b/backport-gsocketclient-fix-crash-when-async-connectio-step-fails.patch @@ -0,0 +1,38 @@ +From c2b8fa8a34765d42be69e7eb9a4c44eeb970f775 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 28 Oct 2020 10:41:13 -0500 +Subject: [PATCH 1035/1095] gsocketclient: fix crash when async connection step + fails + +This is a regression from !1686. The tmp_error is no longer valid after +it is "considered" and cannot be used at this point. We should print the +error earlier instead. + +Fixes #2233 + +reason:fix crash when async connection step fails + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/c2b8fa8a34765d42be69e7eb9a4c44eeb970f775 +--- + gio/gsocketclient.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c +index ce3c186..3737746 100644 +--- a/gio/gsocketclient.c ++++ b/gio/gsocketclient.c +@@ -1837,9 +1837,9 @@ g_socket_client_connected_callback (GObject *source, + { + if (!g_cancellable_is_cancelled (attempt->cancellable)) + { ++ g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message); + clarify_connect_error (data->error_info->tmp_error, data->connectable, attempt->address); + consider_tmp_error (data->error_info, G_SOCKET_CLIENT_CONNECTING); +- g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message); + connection_attempt_remove (attempt); + connection_attempt_unref (attempt); + try_next_connection_or_finish (data, FALSE); +-- +1.8.3.1 + diff --git a/backport-gsocketclient-return-best-errors-possible.patch b/backport-gsocketclient-return-best-errors-possible.patch new file mode 100644 index 0000000..0cf0e07 --- /dev/null +++ b/backport-gsocketclient-return-best-errors-possible.patch @@ -0,0 +1,520 @@ +From b88b3712e0d4474ff55d3b94050285ea08580ddb Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Thu, 8 Oct 2020 18:02:56 -0500 +Subject: [PATCH 0991/1095] gsocketclient: return best errors possible + +Originally, GSocketClient returned whatever error occured last. Turns +out this doesn't work well in practice. Consider the following case: +DNS returns an IPv4 and IPv6 address. First we'll connect() to the +IPv4 address, and say that succeeds, but TLS is enabled and the TLS +handshake fails. Then we try the IPv6 address and receive ENETUNREACH +because IPv6 isn't supported. We wind up returning NETWORK_UNREACHABLE +even though the address can be pinged and a TLS error would be more +appropriate. So instead, we now try to return the error corresponding +to the latest attempted GSocketClientEvent in the connection process. +TLS errors take precedence over proxy errors, which take precedence +over connect() errors, which take precedence over DNS errors. + +In writing this commit, I made several mistakes that were caught by +proxy-test.c, which tests using GSocketClient to make a proxy +connection. So although adding a new test to ensure we get the +best-possible error would be awkward, at least we have some test +coverage for the code that helped avoid introducing bugs. + +Fixes #2211 + +reason:gsocketclient: return best errors possible + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/b88b3712e0d4474ff55d3b94050285ea08580ddb +--- + gio/gsocketclient.c | 209 ++++++++++++++++++++++++++++++++-------------------- + 1 file changed, 130 insertions(+), 79 deletions(-) + +diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c +index fb68c09..ce3c186 100644 +--- a/gio/gsocketclient.c ++++ b/gio/gsocketclient.c +@@ -953,6 +953,72 @@ g_socket_client_emit_event (GSocketClient *client, + event, connectable, connection); + } + ++/* Originally, GSocketClient returned whatever error occured last. Turns ++ * out this doesn't work well in practice. Consider the following case: ++ * DNS returns an IPv4 and IPv6 address. First we'll connect() to the ++ * IPv4 address, and say that succeeds, but TLS is enabled and the TLS ++ * handshake fails. Then we try the IPv6 address and receive ENETUNREACH ++ * because IPv6 isn't supported. We wind up returning NETWORK_UNREACHABLE ++ * even though the address can be pinged and a TLS error would be more ++ * appropriate. So instead, we now try to return the error corresponding ++ * to the latest attempted GSocketClientEvent in the connection process. ++ * TLS errors take precedence over proxy errors, which take precedence ++ * over connect() errors, which take precedence over DNS errors. ++ * ++ * Note that the example above considers a sync codepath, but this is an ++ * issue for the async codepath too, where events and errors may occur ++ * in confusing orders. ++ */ ++typedef struct ++{ ++ GError *tmp_error; ++ GError *best_error; ++ GSocketClientEvent best_error_event; ++} SocketClientErrorInfo; ++ ++static SocketClientErrorInfo * ++socket_client_error_info_new (void) ++{ ++ return g_new0 (SocketClientErrorInfo, 1); ++} ++ ++static void ++socket_client_error_info_free (SocketClientErrorInfo *info) ++{ ++ g_assert (info->tmp_error == NULL); ++ g_clear_error (&info->best_error); ++ g_free (info); ++} ++ ++static void ++consider_tmp_error (SocketClientErrorInfo *info, ++ GSocketClientEvent event) ++{ ++ if (info->tmp_error == NULL) ++ return; ++ ++ /* If we ever add more GSocketClientEvents in the future, then we'll ++ * no longer be able to use >= for this comparison, because future ++ * events will compare greater than G_SOCKET_CLIENT_COMPLETE. Until ++ * then, this is convenient. Note G_SOCKET_CLIENT_RESOLVING is 0 so we ++ * need to use >= here or those errors would never be set. That means ++ * if we get two errors on the same GSocketClientEvent, we wind up ++ * preferring the last one, which is fine. ++ */ ++ g_assert (event <= G_SOCKET_CLIENT_COMPLETE); ++ if (event >= info->best_error_event) ++ { ++ g_clear_error (&info->best_error); ++ info->best_error = info->tmp_error; ++ info->tmp_error = NULL; ++ info->best_error_event = event; ++ } ++ else ++ { ++ g_clear_error (&info->tmp_error); ++ } ++} ++ + /** + * g_socket_client_connect: + * @client: a #GSocketClient. +@@ -991,10 +1057,10 @@ g_socket_client_connect (GSocketClient *client, + { + GIOStream *connection = NULL; + GSocketAddressEnumerator *enumerator = NULL; ++ SocketClientErrorInfo *error_info; + gboolean ever_resolved = FALSE; +- GError *last_error, *tmp_error; + +- last_error = NULL; ++ error_info = socket_client_error_info_new (); + + if (can_use_proxy (client)) + { +@@ -1019,21 +1085,19 @@ g_socket_client_connect (GSocketClient *client, + + if (g_cancellable_is_cancelled (cancellable)) + { +- g_clear_error (error); +- g_clear_error (&last_error); +- g_cancellable_set_error_if_cancelled (cancellable, error); ++ g_clear_error (&error_info->best_error); ++ g_cancellable_set_error_if_cancelled (cancellable, &error_info->best_error); + break; + } + +- tmp_error = NULL; +- + if (!ever_resolved) + { + g_socket_client_emit_event (client, G_SOCKET_CLIENT_RESOLVING, + connectable, NULL); + } + address = g_socket_address_enumerator_next (enumerator, cancellable, +- &tmp_error); ++ &error_info->tmp_error); ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_RESOLVING); + if (!ever_resolved) + { + g_socket_client_emit_event (client, G_SOCKET_CLIENT_RESOLVED, +@@ -1043,29 +1107,16 @@ g_socket_client_connect (GSocketClient *client, + + if (address == NULL) + { +- if (tmp_error) +- { +- g_clear_error (&last_error); +- g_propagate_error (error, tmp_error); +- } +- else if (last_error) +- { +- g_propagate_error (error, last_error); +- } +- else +- { +- g_assert_not_reached (); +- } ++ /* Enumeration is finished. */ ++ g_assert (&error_info->best_error != NULL); + break; + } + + using_proxy = (G_IS_PROXY_ADDRESS (address) && + client->priv->enable_proxy); + +- /* clear error from previous attempt */ +- g_clear_error (&last_error); +- +- socket = create_socket (client, address, &last_error); ++ socket = create_socket (client, address, &error_info->tmp_error); ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_CONNECTING); + if (socket == NULL) + { + g_object_unref (address); +@@ -1077,14 +1128,15 @@ g_socket_client_connect (GSocketClient *client, + g_socket_client_emit_event (client, G_SOCKET_CLIENT_CONNECTING, connectable, connection); + + if (g_socket_connection_connect (G_SOCKET_CONNECTION (connection), +- address, cancellable, &last_error)) ++ address, cancellable, &error_info->tmp_error)) + { + g_socket_connection_set_cached_remote_address ((GSocketConnection*)connection, NULL); + g_socket_client_emit_event (client, G_SOCKET_CLIENT_CONNECTED, connectable, connection); + } + else + { +- clarify_connect_error (last_error, connectable, address); ++ clarify_connect_error (error_info->tmp_error, connectable, address); ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_CONNECTING); + g_object_unref (connection); + connection = NULL; + } +@@ -1105,9 +1157,10 @@ g_socket_client_connect (GSocketClient *client, + g_critical ("Trying to proxy over non-TCP connection, this is " + "most likely a bug in GLib IO library."); + +- g_set_error_literal (&last_error, ++ g_set_error_literal (&error_info->tmp_error, + G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Proxying over a non-TCP connection is not supported.")); ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_PROXY_NEGOTIATING); + + g_object_unref (connection); + connection = NULL; +@@ -1125,7 +1178,9 @@ g_socket_client_connect (GSocketClient *client, + connection, + proxy_addr, + cancellable, +- &last_error); ++ &error_info->tmp_error); ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_PROXY_NEGOTIATING); ++ + g_object_unref (connection); + connection = proxy_connection; + g_object_unref (proxy); +@@ -1135,9 +1190,10 @@ g_socket_client_connect (GSocketClient *client, + } + else + { +- g_set_error (&last_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, ++ g_set_error (&error_info->tmp_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Proxy protocol ā€œ%sā€ is not supported."), + protocol); ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_PROXY_NEGOTIATING); + g_object_unref (connection); + connection = NULL; + } +@@ -1147,7 +1203,7 @@ g_socket_client_connect (GSocketClient *client, + { + GIOStream *tlsconn; + +- tlsconn = g_tls_client_connection_new (connection, connectable, &last_error); ++ tlsconn = g_tls_client_connection_new (connection, connectable, &error_info->tmp_error); + g_object_unref (connection); + connection = tlsconn; + +@@ -1157,16 +1213,21 @@ g_socket_client_connect (GSocketClient *client, + client->priv->tls_validation_flags); + g_socket_client_emit_event (client, G_SOCKET_CLIENT_TLS_HANDSHAKING, connectable, connection); + if (g_tls_connection_handshake (G_TLS_CONNECTION (tlsconn), +- cancellable, &last_error)) ++ cancellable, &error_info->tmp_error)) + { + g_socket_client_emit_event (client, G_SOCKET_CLIENT_TLS_HANDSHAKED, connectable, connection); + } + else + { ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_TLS_HANDSHAKING); + g_object_unref (tlsconn); + connection = NULL; + } + } ++ else ++ { ++ consider_tmp_error (error_info, G_SOCKET_CLIENT_TLS_HANDSHAKING); ++ } + } + + if (connection && !G_IS_SOCKET_CONNECTION (connection)) +@@ -1183,6 +1244,10 @@ g_socket_client_connect (GSocketClient *client, + } + g_object_unref (enumerator); + ++ if (!connection) ++ g_propagate_error (error, g_steal_pointer (&error_info->best_error)); ++ socket_client_error_info_free (error_info); ++ + g_socket_client_emit_event (client, G_SOCKET_CLIENT_COMPLETE, connectable, connection); + return G_SOCKET_CONNECTION (connection); + } +@@ -1360,7 +1425,7 @@ typedef struct + + GSList *connection_attempts; + GSList *successful_connections; +- GError *last_error; ++ SocketClientErrorInfo *error_info; + + gboolean enumerated_at_least_once; + gboolean enumeration_completed; +@@ -1380,7 +1445,7 @@ g_socket_client_async_connect_data_free (GSocketClientAsyncConnectData *data) + g_slist_free_full (data->connection_attempts, connection_attempt_unref); + g_slist_free_full (data->successful_connections, connection_attempt_unref); + +- g_clear_error (&data->last_error); ++ g_clear_pointer (&data->error_info, socket_client_error_info_free); + + g_slice_free (GSocketClientAsyncConnectData, data); + } +@@ -1503,14 +1568,6 @@ g_socket_client_enumerator_callback (GObject *object, + gpointer user_data); + + static void +-set_last_error (GSocketClientAsyncConnectData *data, +- GError *error) +-{ +- g_clear_error (&data->last_error); +- data->last_error = error; +-} +- +-static void + enumerator_next_async (GSocketClientAsyncConnectData *data, + gboolean add_task_ref) + { +@@ -1540,7 +1597,7 @@ g_socket_client_tls_handshake_callback (GObject *object, + + if (g_tls_connection_handshake_finish (G_TLS_CONNECTION (object), + result, +- &data->last_error)) ++ &data->error_info->tmp_error)) + { + g_object_unref (attempt->connection); + attempt->connection = G_IO_STREAM (object); +@@ -1553,7 +1610,9 @@ g_socket_client_tls_handshake_callback (GObject *object, + { + g_object_unref (object); + connection_attempt_unref (attempt); +- g_debug ("GSocketClient: TLS handshake failed: %s", data->last_error->message); ++ ++ g_debug ("GSocketClient: TLS handshake failed: %s", data->error_info->tmp_error->message); ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_TLS_HANDSHAKING); + try_next_connection_or_finish (data, TRUE); + } + } +@@ -1573,7 +1632,7 @@ g_socket_client_tls_handshake (ConnectionAttempt *attempt) + g_debug ("GSocketClient: Starting TLS handshake"); + tlsconn = g_tls_client_connection_new (attempt->connection, + data->connectable, +- &data->last_error); ++ &data->error_info->tmp_error); + if (tlsconn) + { + g_tls_client_connection_set_validation_flags (G_TLS_CLIENT_CONNECTION (tlsconn), +@@ -1588,6 +1647,8 @@ g_socket_client_tls_handshake (ConnectionAttempt *attempt) + else + { + connection_attempt_unref (attempt); ++ ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_TLS_HANDSHAKING); + try_next_connection_or_finish (data, TRUE); + } + } +@@ -1603,19 +1664,19 @@ g_socket_client_proxy_connect_callback (GObject *object, + g_object_unref (attempt->connection); + attempt->connection = g_proxy_connect_finish (G_PROXY (object), + result, +- &data->last_error); ++ &data->error_info->tmp_error); + if (attempt->connection) + { + g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_PROXY_NEGOTIATED, data->connectable, attempt->connection); ++ g_socket_client_tls_handshake (attempt); + } + else + { + connection_attempt_unref (attempt); ++ ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_PROXY_NEGOTIATING); + try_next_connection_or_finish (data, TRUE); +- return; + } +- +- g_socket_client_tls_handshake (attempt); + } + + static void +@@ -1683,9 +1744,10 @@ try_next_successful_connection (GSocketClientAsyncConnectData *data) + g_critical ("Trying to proxy over non-TCP connection, this is " + "most likely a bug in GLib IO library."); + +- g_set_error_literal (&data->last_error, ++ g_set_error_literal (&data->error_info->tmp_error, + G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Proxying over a non-TCP connection is not supported.")); ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_PROXY_NEGOTIATING); + } + else if (g_hash_table_contains (data->client->priv->app_proxies, protocol)) + { +@@ -1712,11 +1774,10 @@ try_next_successful_connection (GSocketClientAsyncConnectData *data) + } + else + { +- g_clear_error (&data->last_error); +- +- g_set_error (&data->last_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, ++ g_set_error (&data->error_info->tmp_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Proxy protocol ā€œ%sā€ is not supported."), + protocol); ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_PROXY_NEGOTIATING); + } + + data->connection_in_progress = FALSE; +@@ -1747,7 +1808,7 @@ try_next_connection_or_finish (GSocketClientAsyncConnectData *data, + return; + } + +- complete_connection_with_error (data, data->last_error); ++ complete_connection_with_error (data, g_steal_pointer (&data->error_info->best_error)); + } + + static void +@@ -1757,7 +1818,6 @@ g_socket_client_connected_callback (GObject *source, + { + ConnectionAttempt *attempt = user_data; + GSocketClientAsyncConnectData *data = attempt->data; +- GError *error = NULL; + + if (task_completed_or_cancelled (data) || g_cancellable_is_cancelled (attempt->cancellable)) + { +@@ -1773,20 +1833,20 @@ g_socket_client_connected_callback (GObject *source, + } + + if (!g_socket_connection_connect_finish (G_SOCKET_CONNECTION (source), +- result, &error)) ++ result, &data->error_info->tmp_error)) + { + if (!g_cancellable_is_cancelled (attempt->cancellable)) + { +- clarify_connect_error (error, data->connectable, attempt->address); +- set_last_error (data, error); +- g_debug ("GSocketClient: Connection attempt failed: %s", error->message); ++ clarify_connect_error (data->error_info->tmp_error, data->connectable, attempt->address); ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_CONNECTING); ++ g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message); + connection_attempt_remove (attempt); + connection_attempt_unref (attempt); + try_next_connection_or_finish (data, FALSE); + } + else /* Silently ignore cancelled attempts */ + { +- g_clear_error (&error); ++ g_clear_error (&data->error_info->tmp_error); + g_object_unref (data->task); + connection_attempt_unref (attempt); + } +@@ -1844,7 +1904,6 @@ g_socket_client_enumerator_callback (GObject *object, + GSocketAddress *address = NULL; + GSocket *socket; + ConnectionAttempt *attempt; +- GError *error = NULL; + + if (task_completed_or_cancelled (data)) + { +@@ -1853,7 +1912,7 @@ g_socket_client_enumerator_callback (GObject *object, + } + + address = g_socket_address_enumerator_next_finish (data->enumerator, +- result, &error); ++ result, &data->error_info->tmp_error); + if (address == NULL) + { + if (G_UNLIKELY (data->enumeration_completed)) +@@ -1862,7 +1921,7 @@ g_socket_client_enumerator_callback (GObject *object, + data->enumeration_completed = TRUE; + g_debug ("GSocketClient: Address enumeration completed (out of addresses)"); + +- /* As per API docs: We only care about error if its the first call, ++ /* As per API docs: We only care about error if it's the first call, + after that the enumerator is done. + + Note that we don't care about cancellation errors because +@@ -1873,19 +1932,11 @@ g_socket_client_enumerator_callback (GObject *object, + if ((data->enumerated_at_least_once && !data->connection_attempts && !data->connection_in_progress) || + !data->enumerated_at_least_once) + { +- g_debug ("GSocketClient: Address enumeration failed: %s", error ? error->message : NULL); +- if (data->last_error) +- { +- g_clear_error (&error); +- error = data->last_error; +- data->last_error = NULL; +- } +- else +- { +- g_assert (error); +- } +- +- complete_connection_with_error (data, error); ++ g_debug ("GSocketClient: Address enumeration failed: %s", ++ data->error_info->tmp_error ? data->error_info->tmp_error->message : NULL); ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_RESOLVING); ++ g_assert (data->error_info->best_error); ++ complete_connection_with_error (data, g_steal_pointer (&data->error_info->best_error)); + } + + /* Enumeration should never trigger again, drop our ref */ +@@ -1901,12 +1952,11 @@ g_socket_client_enumerator_callback (GObject *object, + data->enumerated_at_least_once = TRUE; + } + +- g_clear_error (&data->last_error); +- +- socket = create_socket (data->client, address, &data->last_error); ++ socket = create_socket (data->client, address, &data->error_info->tmp_error); + if (socket == NULL) + { + g_object_unref (address); ++ consider_tmp_error (data->error_info, G_SOCKET_CLIENT_CONNECTING); + enumerator_next_async (data, FALSE); + return; + } +@@ -1978,6 +2028,7 @@ g_socket_client_connect_async (GSocketClient *client, + data = g_slice_new0 (GSocketClientAsyncConnectData); + data->client = client; + data->connectable = g_object_ref (connectable); ++ data->error_info = socket_client_error_info_new (); + + if (can_use_proxy (client)) + { +-- +1.8.3.1 + diff --git a/backport-gsocketclient-set-IP-BIND-ADDRESS-NO-PORT-if-binding.patch b/backport-gsocketclient-set-IP-BIND-ADDRESS-NO-PORT-if-binding.patch new file mode 100644 index 0000000..6832679 --- /dev/null +++ b/backport-gsocketclient-set-IP-BIND-ADDRESS-NO-PORT-if-binding.patch @@ -0,0 +1,58 @@ +From 35bb69bc47fecdf54de887a0c29a0889b79663a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +Date: Wed, 29 Jul 2020 12:10:08 -0400 +Subject: [PATCH 0985/1095] gsocketclient: set IP_BIND_ADDRESS_NO_PORT if + binding to local address + +The linux kernel does not know that the socket will be used +for connect or listen and if you bind() to a local address it must +reserve a random port (if port == 0) at bind() time, making very easy +to exhaust the ~32k port range, setting IP_BIND_ADDRESS_NO_PORT tells +the kernel to choose random port at connect() time instead, when the +full 4-tuple is known. + +reason:gsocketclient: set IP_BIND_ADDRESS_NO_PORT if binding to local address + +Conflict:NA +Reference:https://github.com/GNOME/glib/commit/35bb69bc47fecdf54de887a0c29a0889b79663a1 +--- + gio/gsocketclient.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c +index c994330..ca01b68 100644 +--- a/gio/gsocketclient.c ++++ b/gio/gsocketclient.c +@@ -24,6 +24,10 @@ + #include "config.h" + #include "gsocketclient.h" + ++#ifndef G_OS_WIN32 ++#include ++#endif ++ + #include + #include + +@@ -39,6 +43,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -142,6 +147,10 @@ create_socket (GSocketClient *client, + + if (client->priv->local_address) + { ++#ifdef IP_BIND_ADDRESS_NO_PORT ++ g_socket_set_option (socket, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, 1, NULL); ++#endif ++ + if (!g_socket_bind (socket, + client->priv->local_address, + FALSE, +-- +1.8.3.1 + diff --git a/fix-accidentally-delete-temp-file-within-dtrace.patch b/fix-accidentally-delete-temp-file-within-dtrace.patch new file mode 100644 index 0000000..e3eea52 --- /dev/null +++ b/fix-accidentally-delete-temp-file-within-dtrace.patch @@ -0,0 +1,31 @@ +From c89133504b600c653d56e56648764e49f5f127cc Mon Sep 17 00:00:00 2001 +From: hexiujun +Date: Mon, 2 Mar 2020 10:49:04 +0800 +Subject: [PATCH] fix accidentally delete temp file within dtrace + +--- + meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index d1551bd..4e56f06 100644 +--- a/meson.build ++++ b/meson.build +@@ -2066,12 +2066,12 @@ if want_dtrace + # FIXME: autotools build also passes -fPIC -DPIC but is it needed in this case? + dtrace_obj_gen = generator(dtrace, + output : '@BASENAME@.o', +- arguments : ['-G', '-s', '@INPUT@', '-o', '@OUTPUT@']) ++ arguments : ['-G', '-k', '-s', '@INPUT@', '-o', '@OUTPUT@']) + # FIXME: $(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," + # -e "s,define _SDT_HAS_SEMAPHORES 1,undef _SDT_HAS_SEMAPHORES," + dtrace_hdr_gen = generator(dtrace, + output : '@BASENAME@.h', +- arguments : ['-h', '-s', '@INPUT@', '-o', '@OUTPUT@']) ++ arguments : ['-h', '-k', '-s', '@INPUT@', '-o', '@OUTPUT@']) + glib_conf.set('HAVE_DTRACE', 1) + enable_dtrace = true + endif +-- +1.8.3.1 + diff --git a/glib2.spec b/glib2.spec index 66440b3..bbc4a1b 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,18 +1,37 @@ Name: glib2 Version: 2.66.8 -Release: 2 +Release: 3 Summary: The core library that forms the basis for projects such as GTK+ and GNOME License: LGPLv2+ URL: http://www.gtk.org Source0: http://download.gnome.org/sources/glib/2.66/glib-%{version}.tar.xz -Patch6000: backport-fix-a-memory-leak.patch - -BuildRequires: chrpath gcc gcc-c++ gettext gtk-doc perl-interpreter +Patch9001: fix-accidentally-delete-temp-file-within-dtrace.patch + +Patch6001: backport-gsocketclient-set-IP-BIND-ADDRESS-NO-PORT-if-binding.patch +Patch6002: backport-gsocketclient-emit-RESOLVING-RESOLVED-events-only-once.patch +Patch6003: backport-gsocketclient-Crash-on-error-if-error-is-missing.patch +Patch6004: backport-gsocketclient-return-best-errors-possible.patch +Patch6005: backport-gsocketclient-fix-crash-when-async-connectio-step-fails.patch +Patch6006: backport-Correct-memory-leaks-of-error-in-completion-case.patch +Patch6007: backport-gapplication-Fix-a-memory-leak.patch +Patch6008: backport-gdbusauth-fix-error-leak.patch +Patch6009: backport-gdbusobjectmanagerservice-fix-leak-in-error-path.patch +Patch6010: backport-gfileenumerator-fix-leak-in-error-path.patch +Patch6011: backport-gsettings-Fix-a-minor-memory-leak-when-getting-GSettingsAction-state.patch +Patch6012: backport-fix-a-memory-leak.patch + +BuildRequires: chrpath gcc gcc-c++ gettext perl-interpreter +%ifnarch i686 +BUildRequires: gtk-doc +%endif BUildRequires: glibc-devel libattr-devel libselinux-devel meson BuildRequires: systemtap-sdt-devel pkgconfig(libelf) pkgconfig(libffi) BuildRequires: pkgconfig(libpcre) pkgconfig(mount) pkgconfig(zlib) BuildRequires: python3-devel gamin-devel +%ifarch i686 +BuildRequires: libxslt +%endif Provides: %{name}-fam = %{version}-%{release} Obsoletes: %{name}-fam < %{version}-%{release} @@ -39,6 +58,7 @@ Obsoletes: %{name}-tests < %{version}-%{release} %description devel Development and test files for the GLib library. +%ifnarch i686 %package help Summary: help document for the glib2 package Buildarch: noarch @@ -47,14 +67,20 @@ Obsoletes: %{name}-doc < %{version}-%{release} %description help help document for the glib2 package. +%endif %prep %autosetup -n glib-%{version} -p1 %build rm glib/pcre/*.[ch] -%meson --default-library=both -Dman=true -Ddtrace=true \ - -Dsystemtap=true -Dgtk_doc=true -Dfam=true -Dinstalled_tests=true +%meson --default-library=both -Ddtrace=true \ +%ifarch i686 + -Dman=false -Dgtk_doc=false \ +%else + -Dman=true -Dgtk_doc=true \ +%endif + -Dsystemtap=true -Dfam=true -Dinstalled_tests=true %meson_build @@ -72,6 +98,16 @@ mv %{buildroot}%{_bindir}/gio-querymodules %{buildroot}%{_bindir}/gio-querymodu touch %{buildroot}%{_libdir}/gio/modules/giomodule.cache %find_lang glib20 +#remove rpath +chrpath -d %{buildroot}%{_libexecdir}/installed-tests/glib/gdbus-peer + +mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d +echo %{_libexecdir}/installed-tests/glib > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf + +%ldconfig_scriptlets devel + + + %transfiletriggerin -- %{_libdir}/gio/modules gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules &> /dev/null || : @@ -108,6 +144,8 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_bindir}/gapplication %files devel +%defattr(-,root,root) +%config(noreplace) /etc/ld.so.conf.d/* %{_libdir}/lib*.so %{_libdir}/glib-2.0 %{_libdir}/pkgconfig/* @@ -135,13 +173,27 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_bindir}/glib-compile-resources %{_bindir}/gresource %attr (0755, root, root) %{_bindir}/gtester-report - +%ifarch i686 +%exclude %{_libexecdir}/installed-tests/glib/libgdbus-example-objectmanager.a +%exclude %{_datadir}/glib-2.0/codegen/__pycache__ +%exclude %{_datadir}/glib-2.0/gdb/__pycache__ +%exclude %{_datadir}/installed-tests/glib/static-link.test +%endif + +%ifnarch i686 %files help %defattr(-,root,root) %{_mandir}/man1/* %doc %{_datadir}/gtk-doc/html/* +%endif %changelog +* Fri Sep 17 2021 yangcheng - 2.66.8-3 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:fix the 2.66.8 version upgrade error + * Sat Aug 14 2021 liuyumeng - 2.66.8-2 - Type:bugfix - Id:NA -- Gitee