From 807f2a6acb986274e8f0462c1bb62bd2fd2d9496 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:18:30 +0000 Subject: import glib2-2.46.2-4.el7 --- diff --git a/.gitignore b/.gitignore index 09403eb..19c81d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/glib-2.42.2.tar.xz +SOURCES/glib-2.46.2.tar.xz diff --git a/.glib2.metadata b/.glib2.metadata index 822f28b..6921364 100644 --- a/.glib2.metadata +++ b/.glib2.metadata @@ -1 +1 @@ -87113de4096377fab1129da44f38a0da0f7f0fb4 SOURCES/glib-2.42.2.tar.xz +2bd8f8d87668635f45ccac2e9166a4c4c3d65eac SOURCES/glib-2.46.2.tar.xz diff --git a/SOURCES/0001-GDBusProxy-Fix-a-memory-leak-during-initialization.patch b/SOURCES/0001-GDBusProxy-Fix-a-memory-leak-during-initialization.patch new file mode 100644 index 0000000..95b2986 --- /dev/null +++ b/SOURCES/0001-GDBusProxy-Fix-a-memory-leak-during-initialization.patch @@ -0,0 +1,25 @@ +From e98e1eff83c742c73a148dd7b75c00d77e0cee40 Mon Sep 17 00:00:00 2001 +From: Evangelos Foutras +Date: Wed, 25 Nov 2015 23:29:18 +0200 +Subject: [PATCH] GDBusProxy: Fix a memory leak during initialization + +https://bugzilla.gnome.org/show_bug.cgi?id=758641 +--- + gio/gdbusproxy.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c +index 52a22fb..7b1140f 100644 +--- a/gio/gdbusproxy.c ++++ b/gio/gdbusproxy.c +@@ -1720,6 +1720,7 @@ async_initable_init_second_finish (GAsyncInitable *initable, + if (result != NULL) + { + process_get_all_reply (proxy, result); ++ g_variant_unref (result); + } + + proxy->priv->initialized = TRUE; +-- +1.8.3.1 + diff --git a/SOURCES/0001-GVariant-text-fix-scan-of-positional-parameters.patch b/SOURCES/0001-GVariant-text-fix-scan-of-positional-parameters.patch new file mode 100644 index 0000000..8e537f0 --- /dev/null +++ b/SOURCES/0001-GVariant-text-fix-scan-of-positional-parameters.patch @@ -0,0 +1,63 @@ +From cc0b8bdf124c47090d0b794c9b6e2e3852c860d9 Mon Sep 17 00:00:00 2001 +From: Hanno Boeck +Date: Mon, 22 Feb 2016 07:46:17 -0500 +Subject: [PATCH] GVariant text: fix scan of positional parameters + +The scanning to find the end of a positional parameter designator in +GVariant text format (e.g. '%i') is currently broken in case the 'end' +pointer is not specified. + +The scan is controlled by a somewhat complicated loop that needs to deal +properly with cases like (123, %(ii)) [where '%(ii)' is to be taken +together, but the final ')' not]. + +This loop missed the case where a format string passed to +g_variant_new_parsed() ended immediately after such a conversion, with a +nul character. In this case the 'end' pointer is NULL, so the only way +we can find the end is by scanning for nul in the string. + +In case of g_variant_new_parsed() [which is what this code was designed +to be used for], the bug is somewhat unlikely in practice: the only way +that a valid text-form GVariant could ever contain a positional +parameter replacement at the end of the string is if this positional +parameter were the only thing being returned. In that case, the user +would likely have opted for a more direct approach. + +Unfortunately, this code is also active in the tokenisation phase of +g_variant_parse(), before positional parameters are rejected as invalid +for that case. Anyone who calls this function with a nul-terminated +string (and no end pointer) is vulnerable to a crash from malicious user +input. This can be seen, at the very least with many commandline tools: + + $ dconf write /x '%i' + Segmentation fault + +We fix this problem by searching for the nul character in this case, in +addition to comparing the end pointer. + +This problem is almost certainly limited to being able to cause crashes. +The loop in question only performs reads and, in the security-sensitive +case, the token will be quickly rejected after the loop is finished +(since it starts with '%' and the 'app' pointer is unset). This is +further mitigated by the fact that there are no known cases of GVariant +text format being used as part of a protocol at a privilege barrier. +--- + glib/gvariant-parser.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glib/gvariant-parser.c b/glib/gvariant-parser.c +index e7dab85..9f4bcc5 100644 +--- a/glib/gvariant-parser.c ++++ b/glib/gvariant-parser.c +@@ -237,7 +237,7 @@ token_stream_prepare (TokenStream *stream) + * Also: ] and > are never in format strings. + */ + for (end = stream->stream + 1; +- end != stream->end && *end != ',' && ++ end != stream->end && *end != '\0' && *end != ',' && + *end != ':' && *end != '>' && *end != ']' && !g_ascii_isspace (*end); + end++) + +-- +1.8.3.1 + diff --git a/SOURCES/0001-file-monitors-reorder-some-code-to-avoid-segfault.patch b/SOURCES/0001-file-monitors-reorder-some-code-to-avoid-segfault.patch new file mode 100644 index 0000000..d2dd6e6 --- /dev/null +++ b/SOURCES/0001-file-monitors-reorder-some-code-to-avoid-segfault.patch @@ -0,0 +1,39 @@ +From 30359e740953b596d6c3d980dba36dd131681a1f Mon Sep 17 00:00:00 2001 +From: Allison Ryan Lortie +Date: Mon, 30 Nov 2015 10:13:46 -0500 +Subject: [PATCH] file monitors: reorder some code to avoid segfault + +We must initialise '->source' before we use fields inside of it. + +https://bugzilla.gnome.org/show_bug.cgi?id=758823 +--- + gio/glocalfilemonitor.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gio/glocalfilemonitor.c b/gio/glocalfilemonitor.c +index dbd62ec..49a4dd2 100644 +--- a/gio/glocalfilemonitor.c ++++ b/gio/glocalfilemonitor.c +@@ -748,6 +748,9 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor, + + g_assert (!local_monitor->source); + ++ source = g_file_monitor_source_new (local_monitor, filename, is_directory, flags); ++ local_monitor->source = source; /* owns the ref */ ++ + if (is_directory && !class->mount_notify && (flags & G_FILE_MONITOR_WATCH_MOUNTS)) + { + #ifdef G_OS_WIN32 +@@ -771,9 +774,6 @@ g_local_file_monitor_start (GLocalFileMonitor *local_monitor, + #endif + } + +- source = g_file_monitor_source_new (local_monitor, filename, is_directory, flags); +- local_monitor->source = source; /* owns the ref */ +- + G_LOCAL_FILE_MONITOR_GET_CLASS (local_monitor)->start (local_monitor, + source->dirname, source->basename, source->filename, + source); +-- +2.7.4 + diff --git a/SOURCES/ffi-marshal-flags-like-enums.patch b/SOURCES/ffi-marshal-flags-like-enums.patch deleted file mode 100644 index cde22ac..0000000 --- a/SOURCES/ffi-marshal-flags-like-enums.patch +++ /dev/null @@ -1,36 +0,0 @@ -From cde19e1cf575d33f7cd34bc0b6a4daea5d91cdc5 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Wed, 16 Sep 2015 18:01:04 +0200 -Subject: [PATCH] ffi: Marshal flags like enums - -Flags are enums. -Fixes broken marshalling on BE 64bit architectures. - -https://bugzilla.gnome.org/show_bug.cgi?id=754882 ---- - gobject/gclosure.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/gobject/gclosure.c b/gobject/gclosure.c -index 014e40a..3c6894a 100644 ---- a/gobject/gclosure.c -+++ b/gobject/gclosure.c -@@ -1186,9 +1186,15 @@ value_to_ffi_type (const GValue *gvalue, - *value = enum_tmpval; - *tmpval_used = TRUE; - break; -+ case G_TYPE_FLAGS: -+ g_assert (enum_tmpval != NULL); -+ rettype = &ffi_type_uint; -+ *enum_tmpval = g_value_get_flags (gvalue); -+ *value = enum_tmpval; -+ *tmpval_used = TRUE; -+ break; - case G_TYPE_UCHAR: - case G_TYPE_UINT: -- case G_TYPE_FLAGS: - rettype = &ffi_type_uint; - *value = (gpointer)&(gvalue->data[0].v_uint); - break; --- -2.4.3 \ No newline at end of file diff --git a/SOURCES/gdbus-silence-exit-on-close.patch b/SOURCES/gdbus-silence-exit-on-close.patch deleted file mode 100644 index a689c5f..0000000 --- a/SOURCES/gdbus-silence-exit-on-close.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 66bc9660c44b71c8bff47b4f7e16a801169a9f23 Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Mon, 5 Jan 2015 09:40:37 -0500 -Subject: gdbusconnection: Don't g_printerr() when exiting - -exit-on-close for a DBus connection is a completely normal thing. On -a regular GNOME login, gdm retains the X server, but terminates the -session login bus and associated helpers like gnome-settings-dameon, -the a11y tools, etc. - -I've seen several downstream reports of confusion as to what these -apparent error messages mean in the system log. It doesn't help -that they're so obtuse. - -We're also printing them to stderr, when this is not an error. - -The reason this was introduced is presumably some people were confused -as to why their process exited when the system bus did. But the -solution for that I believe is documentation, not printing stuff to -everyone's system log in normal operation. - -https://bugzilla.gnome.org/show_bug.cgi?id=742386 - -diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c -index 7b71bd0..9824ad9 100644 ---- a/gio/gdbusconnection.c -+++ b/gio/gdbusconnection.c -@@ -804,17 +804,6 @@ g_dbus_connection_real_closed (GDBusConnection *connection, - (flags & FLAG_INITIALIZED) != 0 && - connection->initialization_error == NULL) - { -- if (error != NULL) -- { -- g_printerr ("%s: Remote peer vanished with error: %s (%s, %d). Exiting.\n", -- G_STRFUNC, -- error->message, -- g_quark_to_string (error->domain), error->code); -- } -- else -- { -- g_printerr ("%s: Remote peer vanished. Exiting.\n", G_STRFUNC); -- } - raise (SIGTERM); - } - } --- -cgit v0.10.2 - diff --git a/SPECS/glib2.spec b/SPECS/glib2.spec index 169ed82..fb2792e 100644 --- a/SPECS/glib2.spec +++ b/SPECS/glib2.spec @@ -1,7 +1,7 @@ Summary: A library of handy utility functions Name: glib2 -Version: 2.42.2 -Release: 5%{?dist} +Version: 2.46.2 +Release: 4%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -26,10 +26,14 @@ BuildRequires: libffi-devel BuildRequires: elfutils-libelf-devel BuildRequires: chrpath +# Avoid deprecating things introduced since the first version of glib +# built in RHEL7, as some projects use `-Werror` and such. Patch0: revert-g-source-remove-critical.patch Patch1: add-back-g-memmove.patch -Patch2: gdbus-silence-exit-on-close.patch -Patch3: ffi-marshal-flags-like-enums.patch +# Backports from glib-2-46 upstream +Patch2: 0001-GDBusProxy-Fix-a-memory-leak-during-initialization.patch +Patch3: 0001-GVariant-text-fix-scan-of-positional-parameters.patch +Patch4: 0001-file-monitors-reorder-some-code-to-avoid-segfault.patch # required for GIO content-type support Requires: shared-mime-info @@ -195,6 +199,16 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules %{_libdir}/gio/modules/libgiofam.so %changelog +* Wed Sep 14 2016 Kalev Lember - 2.46.2-4 +- Backport a patch to fix a segfault in file monitor code +- Resolves: #1375753 + +* Tue Mar 08 2016 Colin Walters - 2.46.2-3 +- Rebase to 2.46.2 +- Backport two additional notable+applicable patches from upstream + branch +- Resolves: #1305515 + * Tue Sep 29 2015 Colin Walters - 2.42.2-5 - Add patch to fix FFI marshaling on BE architectures - Resolves: #1260577