Accepting request 1032476 from GNOME:Factory

OBS-URL: https://build.opensuse.org/request/show/1032476
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glib2?expand=0&rev=258
This commit is contained in:
Dominique Leuenberger 2022-11-01 12:41:03 +00:00 committed by Git OBS Bridge
commit 6fa237087e
8 changed files with 207 additions and 41 deletions

118
ca905744.patch Normal file
View File

@ -0,0 +1,118 @@
From ca905744dffb844663b5bd6b42f33e2d44f9b4cd Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 28 Oct 2022 11:21:04 -0400
Subject: [PATCH] Revert "Handling collision between standard i/o file
descriptors and newly created ones"
g_unix_open_pipe tries to avoid the standard io fd range
when getting pipe fds. This turns out to be a bad idea because
certain buggy programs rely on it using that range.
This reverts commit d9ba6150909818beb05573f54f26232063492c5b
and adds a test to ensure we don't inadvertently do it again later.
Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2795
---
glib/glib-unix.c | 24 ------------------------
glib/tests/unix.c | 29 +++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/glib/glib-unix.c b/glib/glib-unix.c
index 4710c51168..bc152d7663 100644
--- a/glib/glib-unix.c
+++ b/glib/glib-unix.c
@@ -108,17 +108,6 @@ g_unix_open_pipe (int *fds,
ecode = pipe2 (fds, pipe2_flags);
if (ecode == -1 && errno != ENOSYS)
return g_unix_set_error_from_errno (error, errno);
- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */
- else if (fds[0] < 3 || fds[1] < 3)
- {
- int old_fds[2] = { fds[0], fds[1] };
- gboolean result = g_unix_open_pipe (fds, flags, error);
- close (old_fds[0]);
- close (old_fds[1]);
-
- if (!result)
- g_unix_set_error_from_errno (error, errno);
- }
else if (ecode == 0)
return TRUE;
/* Fall through on -ENOSYS, we must be running on an old kernel */
@@ -127,19 +116,6 @@ g_unix_open_pipe (int *fds,
ecode = pipe (fds);
if (ecode == -1)
return g_unix_set_error_from_errno (error, errno);
- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */
- else if (fds[0] < 3 || fds[1] < 3)
- {
- int old_fds[2] = { fds[0], fds[1] };
- gboolean result = g_unix_open_pipe (fds, flags, error);
- close (old_fds[0]);
- close (old_fds[1]);
-
- if (!result)
- g_unix_set_error_from_errno (error, errno);
-
- return result;
- }
if (flags == 0)
return TRUE;
diff --git a/glib/tests/unix.c b/glib/tests/unix.c
index 2112cab6bf..5dde2b52cc 100644
--- a/glib/tests/unix.c
+++ b/glib/tests/unix.c
@@ -26,6 +26,7 @@
#include "glib-unix.h"
#include <string.h>
#include <pwd.h>
+#include <unistd.h>
static void
test_pipe (void)
@@ -52,6 +53,33 @@ test_pipe (void)
g_assert (g_str_has_prefix (buf, "hello"));
}
+static void
+test_pipe_stdio_overwrite (void)
+{
+ GError *error = NULL;
+ int pipefd[2], ret;
+ gboolean res;
+ int stderr_fd;
+
+ stderr_fd = dup (STDERR_FILENO);
+ g_assert_cmpint (stderr_fd, >, 0);
+ close (STDERR_FILENO);
+
+ res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error);
+ g_assert (res);
+ g_assert_no_error (error);
+
+ g_assert_cmpint (pipefd[0], ==, STDERR_FILENO);
+
+ close (pipefd[0]);
+ close (pipefd[1]);
+
+ ret = dup2 (stderr_fd, STDERR_FILENO);
+ g_assert_cmpint (ret, >=, 0);
+
+ close (stderr_fd);
+}
+
static void
test_error (void)
{
@@ -337,6 +365,7 @@ main (int argc,
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/glib-unix/pipe", test_pipe);
+ g_test_add_func ("/glib-unix/pipe-stdio-overwrite", test_pipe_stdio_overwrite);
g_test_add_func ("/glib-unix/error", test_error);
g_test_add_func ("/glib-unix/nonblocking", test_nonblocking);
g_test_add_func ("/glib-unix/sighup", test_sighup);
--
GitLab

View File

@ -1,14 +0,0 @@
diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c
index f17b3488b9b0e9a376dcd9e999062613ac580497..17b8606572385dca8453e7d5a6194db0706dad08 100644
--- a/gobject/gparamspecs.c
+++ b/gobject/gparamspecs.c
@@ -894,6 +894,9 @@ param_param_is_valid (GParamSpec *pspec,
{
GParamSpec *param = value->data[0].v_pointer;
+ if (param == NULL)
+ return FALSE;
+
return g_value_type_compatible (G_PARAM_SPEC_TYPE (param), G_PARAM_SPEC_VALUE_TYPE (pspec));
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3652c7f072d7b031a6b5edd623f77ebc5dcd2ae698598abcc89ff39ca75add30
size 5183072

3
glib-2.74.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0ab981618d1db47845e56417b0d7c123f81a3427b2b9c93f5a46ff5bbb964964
size 5189452

View File

@ -1,8 +1,8 @@
Index: glib-2.71.0/glib/gkeyfile.c
Index: glib-2.74.1/glib/gkeyfile.c
===================================================================
--- glib-2.71.0.orig/glib/gkeyfile.c
+++ glib-2.71.0/glib/gkeyfile.c
@@ -513,6 +513,7 @@ struct _GKeyFile
--- glib-2.74.1.orig/glib/gkeyfile.c
+++ glib-2.74.1/glib/gkeyfile.c
@@ -515,6 +515,7 @@ struct _GKeyFile
gboolean checked_locales; /* TRUE if @locales has been initialised */
gchar **locales; /* (nullable) */
@ -10,7 +10,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
gint ref_count; /* (atomic) */
};
@@ -639,6 +640,7 @@ g_key_file_init (GKeyFile *key_file)
@@ -641,6 +642,7 @@ g_key_file_init (GKeyFile *key_file)
key_file->parse_buffer = NULL;
key_file->list_separator = ';';
key_file->flags = 0;
@ -18,7 +18,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
}
static void
@@ -659,6 +661,12 @@ g_key_file_clear (GKeyFile *key_file)
@@ -661,6 +663,12 @@ g_key_file_clear (GKeyFile *key_file)
key_file->parse_buffer = NULL;
}
@ -31,7 +31,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
tmp = key_file->groups;
while (tmp != NULL)
{
@@ -879,6 +887,11 @@ g_key_file_load_from_fd (GKeyFile
@@ -881,6 +889,11 @@ g_key_file_load_from_fd (GKeyFile
return FALSE;
}
@ -43,7 +43,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
return TRUE;
}
@@ -991,6 +1004,11 @@ g_key_file_load_from_data (GKeyFile
@@ -993,6 +1006,11 @@ g_key_file_load_from_data (GKeyFile
return FALSE;
}
@ -55,7 +55,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
return TRUE;
}
@@ -2240,6 +2258,8 @@ g_key_file_get_locale_string (GKeyFile
@@ -2242,6 +2260,8 @@ g_key_file_get_locale_string (GKeyFile
GError *key_file_error;
gchar **languages;
gboolean free_languages = FALSE;
@ -64,7 +64,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
gint i;
g_return_val_if_fail (key_file != NULL, NULL);
@@ -2261,6 +2281,23 @@ g_key_file_get_locale_string (GKeyFile
@@ -2263,6 +2283,23 @@ g_key_file_get_locale_string (GKeyFile
free_languages = FALSE;
}
@ -88,7 +88,7 @@ Index: glib-2.71.0/glib/gkeyfile.c
for (i = 0; languages[i]; i++)
{
candidate_key = g_strdup_printf ("%s[%s]", key, languages[i]);
@@ -2274,6 +2311,39 @@ g_key_file_get_locale_string (GKeyFile
@@ -2276,6 +2313,39 @@ g_key_file_get_locale_string (GKeyFile
break;
}
@ -128,11 +128,11 @@ Index: glib-2.71.0/glib/gkeyfile.c
/* Fallback to untranslated key
*/
if (!translated_value)
Index: glib-2.71.0/glib/gkeyfile.h
Index: glib-2.74.1/glib/gkeyfile.h
===================================================================
--- glib-2.71.0.orig/glib/gkeyfile.h
+++ glib-2.71.0/glib/gkeyfile.h
@@ -320,6 +320,7 @@ gboolean g_key_file_remove_group
--- glib-2.74.1.orig/glib/gkeyfile.h
+++ glib-2.74.1/glib/gkeyfile.h
@@ -322,6 +322,7 @@ gboolean g_key_file_remove_group
#define G_KEY_FILE_DESKTOP_KEY_URL "URL"
#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
#define G_KEY_FILE_DESKTOP_KEY_ACTIONS "Actions"

View File

@ -1,8 +1,8 @@
Index: glib-2.70.0/gio/glib-compile-schemas.c
Index: glib-2.74.1/gio/glib-compile-schemas.c
===================================================================
--- glib-2.70.0.orig/gio/glib-compile-schemas.c
+++ glib-2.70.0/gio/glib-compile-schemas.c
@@ -1232,6 +1232,7 @@ parse_state_start_schema (ParseState *s
--- glib-2.74.1.orig/gio/glib-compile-schemas.c
+++ glib-2.74.1/gio/glib-compile-schemas.c
@@ -1234,6 +1234,7 @@ parse_state_start_schema (ParseState *s
return;
}
@ -10,7 +10,7 @@ Index: glib-2.70.0/gio/glib-compile-schemas.c
if (path && (g_str_has_prefix (path, "/apps/") ||
g_str_has_prefix (path, "/desktop/") ||
g_str_has_prefix (path, "/system/")))
@@ -1244,6 +1245,7 @@ parse_state_start_schema (ParseState *s
@@ -1246,6 +1247,7 @@ parse_state_start_schema (ParseState *s
g_printerr ("%s\n", message);
g_free (message);
}

View File

@ -1,3 +1,64 @@
-------------------------------------------------------------------
Mon Oct 31 12:18:51 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
- Add ca905744.patch: Revert "Handling collision between standard
i/o file descriptors and newly created ones". The user-visible
problem this solves is gnome-keyring-daemon eating 100% CPU.
-------------------------------------------------------------------
Wed Oct 26 12:07:15 UTC 2022 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 2.74.1:
+ Update Unicode data to version 15
+ Fix various build failures in different situations
+ Fix over-eager deprecated property warnings for construct
properties
+ Fix a crash calling `g_param_value_is_valid()` on a
`GParamSpecParam`
+ Fix floating `GVariant` leaks with GObject properties
+ Add inline optimised version of `g_str_equal()`
+ Fix `GVariant` type depths checks on text format variants
+ Fix regression with int64 and double hashing functions on
big-endian architectures
+ Build the API documentation only when building GLib as a shared
library
+ Ignore weird `/etc/localtime` configurations generated by
toolbx
+ Avoid `EINTR` races when closing FDs in `g_spawn_*()`
+ Bugs fixed: glgo#GNOME/GLib#16, glgo#GNOME/GLib#333,
glgo#GNOME/GLib#2735, glgo#GNOME/GLib#2740,
glgo#GNOME/GLib#2742, glgo#GNOME/GLib#2748,
glgo#GNOME/GLib#2758, glgo#GNOME/GLib#2759,
glgo#GNOME/GLib#2766, glgo#GNOME/GLib#2767,
glgo#GNOME/GLib#2770, glgo#GNOME/GLib#2774,
glgo#GNOME/GLib#2775, glgo#GNOME/GLib#2782,
glgo#GNOME/GLib#2787, glgo#GNOME/GLib#2788,
glgo#GNOME/GLib!2852, glgo#GNOME/GLib!2857,
glgo#GNOME/GLib!2864, glgo#GNOME/GLib!2866,
glgo#GNOME/GLib!2880, glgo#GNOME/GLib!2885,
glgo#GNOME/GLib!2892, glgo#GNOME/GLib!2896,
glgo#GNOME/GLib!2899, glgo#GNOME/GLib!2901,
glgo#GNOME/GLib!2903, glgo#GNOME/GLib!2904,
glgo#GNOME/GLib!2905, glgo#GNOME/GLib!2907,
glgo#GNOME/GLib!2911, glgo#GNOME/GLib!2913,
glgo#GNOME/GLib!2915, glgo#GNOME/GLib!2916,
glgo#GNOME/GLib!2920, glgo#GNOME/GLib!2922,
glgo#GNOME/GLib!2924, glgo#GNOME/GLib!2928,
glgo#GNOME/GLib!2931, glgo#GNOME/GLib!2933,
glgo#GNOME/GLib!2938, glgo#GNOME/GLib!2939,
glgo#GNOME/GLib!2946, glgo#GNOME/GLib!2948,
glgo#GNOME/GLib!2949, glgo#GNOME/GLib!2958,
glgo#GNOME/GLib!2960, glgo#GNOME/GLib!2973,
glgo#GNOME/GLib!2975, glgo#GNOME/GLib!2982,
glgo#GNOME/GLib!2983, glgo#GNOME/GLib!2988,
glgo#GNOME/GLib!2989, glgo#GNOME/GLib!2995,
glgo#GNOME/GLib!2996, glgo#GNOME/GLib!2998,
glgo#GNOME/GLib!3010.
+ Updated translations.
- Rebase patches with quilt.
- Drop f0dd96c28751f15d0703b384bfc7c314af01caa8.diff: Fixed
upstream.
-------------------------------------------------------------------
Fri Oct 7 01:25:03 UTC 2022 - Haochuan Chen <yjcoshc@mail.nankai.edu.cn>

View File

@ -30,7 +30,7 @@
%define libgthread libgthread-%{libver}
%bcond_without systemtap
Name: glib2%{psuffix}
Version: 2.74.0
Version: 2.74.1
Release: 0
Summary: General-Purpose Utility Library
License: LGPL-2.1-or-later
@ -58,8 +58,9 @@ Patch2: glib2-suppress-schema-deprecated-path-warning.patch
Patch3: glib2-dbus-socket-path.patch
# PATCH-FIX-OPENSUSE glib2-gdbus-codegen-version.patch olaf@aepfle.de -- Remove version string from files generated by gdbus-codegen
Patch4: glib2-gdbus-codegen-version.patch
# PATCH-FIX-UPSTREAM f0dd96c28751f15d0703b384bfc7c314af01caa8.diff glgo#GNOME/GLib!2770 Empty values are not valid GParamSpec
Patch99: f0dd96c28751f15d0703b384bfc7c314af01caa8.diff
# PATCH-FIX-UPSTREAM ca905744.patch dimstar@opensuse.org -- Revert "Handling collision between standard i/o file descriptors and newly created ones"
Patch5: https://gitlab.gnome.org/GNOME/glib/-/commit/ca905744.patch
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -262,7 +263,7 @@ the functionality of the installed glib2 package.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch99 -p1
%patch5 -p1
cp -a %{SOURCE1} %{SOURCE2} %{SOURCE5} .
cp -a %{SOURCE4} gnome_defaults.conf
# replace /usr/bin/env shebangs