Compare commits

...

107 Commits

Author SHA1 Message Date
Kalev Lember f9fbe5a4c8 Backport upstream patches to fix invalid use of volatile objects
This is needed for gcc 11.
2020-11-24 12:25:45 +01:00
Michael Catanzaro a6c366328b Make GnuTLS patch RHEL-specific, and make glib2-static subpackage Fedora-specific 2020-11-11 09:45:07 -06:00
Michael Catanzaro f52f413589 Use GnuTLS to implement GHmac (thanks to Colin Walters) 2020-11-10 16:52:14 -06:00
Michael Catanzaro 78bc3e5c67 Remove unused script 2020-11-09 15:51:23 -06:00
Michael Catanzaro 8f38a70fd6 Backport fix for GSocketClient crash 2020-11-04 08:03:37 -06:00
Kalev Lember 74300be378 Update to 2.67.0 2020-10-29 05:56:07 +01:00
Kalev Lember 9b1f9aa2f2 Drop gtk-doc patch as we finally have a new enough gtk-doc 2020-10-19 19:12:40 +02:00
Kalev Lember b5748c4edb Update to 2.66.2 2020-10-19 19:12:38 +02:00
Michael Catanzaro 6c5949a8ca Use smaller patches for the timezone issues
Someone just found a bug in the big version of the fix, so let's use a
smaller fix until these are both accepted upstream.
2020-10-14 15:31:02 -05:00
Michael Catanzaro 62d0b8f09a Fix yet another timezone bug 2020-10-14 15:03:56 -05:00
Michael Catanzaro ce0559a035 Fix timezone-related bugs in many applications caused by new glib timezone cache 2020-10-14 14:42:56 -05:00
Kalev Lember 22bd71a65a Update to 2.66.1 2020-10-01 19:43:57 +02:00
Kalev Lember 6248b5a00a Update to 2.66.0 2020-09-10 20:48:04 +02:00
Kalev Lember e1ea8b2fcf Update to 2.65.3 2020-09-02 18:52:53 +02:00
Adam Williamson c3df0e5227 Backport fix for GGO #2189 (error accessing some filesystems)
Upstream commit refers only to read-only filesystems, but the
bug also affects CIFS shares (and this patch fixes that case
too).
2020-08-25 11:55:46 -07:00
Jeff Law 683c99b0e4 Re-enable LTO 2020-08-20 22:01:12 -06:00
Kalev Lember 1d384aa8fb Update to 2.65.2 2020-08-18 15:59:19 +02:00
Kalev Lember b03aa2af4a Update to 2.65.1 2020-08-17 12:40:50 +02:00
Fedora Release Engineering 7a981e97c7 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 01:55:39 +00:00
Fedora Release Engineering ea83fb0237 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 20:13:29 +00:00
Jeff Law 06a3cf31cd Disable LTO 2020-06-30 14:05:05 -06:00
Kalev Lember ee2a246925 Update gio-2.0.pc with correct gio-querymodules name when renaming it
https://bugzilla.redhat.com/show_bug.cgi?id=1849441
2020-06-22 12:12:39 +02:00
Kalev Lember 6e6595e611 Avoid requiring a too new gtk-doc version for building glib
We don't have new enough gtk-doc in rawhide yet.
2020-06-22 11:57:28 +02:00
Kalev Lember fbd5247c7a Remove changelog trimming
Changelogs are now trimmed globally.
2020-06-22 10:40:07 +02:00
Kalev Lember 46f4926d2c Update to 2.65.0 2020-06-22 10:39:45 +02:00
Kalev Lember d43d0ce458 Update to 2.64.3 2020-05-20 13:15:37 +02:00
Tomas Popela ec78e22b1b Backport fix for a race condition in GCancellable (rhbz#1825230) 2020-04-28 08:20:28 +02:00
Kalev Lember ba78ee1988 Update to 2.64.2 2020-04-10 12:12:46 +02:00
Kalev Lember cf59eebaca Update to 2.64.1 2020-03-11 13:54:06 +01:00
Kalev Lember 1ac207bef9 Update to 2.64.0 2020-03-02 20:48:36 +01:00
Kalev Lember 898c00b2ad Update to 2.63.6 2020-02-24 23:09:56 +02:00
Kalev Lember a23372a417 Backport a patch to work around SELinux policies not allowing SYS_sched_setattr
https://bugzilla.redhat.com/show_bug.cgi?id=1795524
2020-02-12 20:50:27 +01:00
Michael Catanzaro fdfddfe804 Add patch for CVE-2020-6750 and related issues. 2020-02-07 15:09:22 -06:00
Kalev Lember 807f65d4bd Update to 2.63.5 2020-02-03 11:13:07 +01:00
Stephen Gallagher ab00509fe1
Fix GThreadPool initialization that is breaking createrepo_c (BZ #1795052)
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2020-01-29 10:11:54 -05:00
Fedora Release Engineering af14559f8f - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 22:10:02 +00:00
Kalev Lember e992d2d872 Update to 2.63.4 2020-01-24 05:28:49 +01:00
Kalev Lember 540aeada95 Update to 2.63.3 2019-12-16 15:20:37 +01:00
Kalev Lember cfb57c36bc Update to 2.63.2 2019-12-02 06:24:39 +01:00
Kalev Lember 348b2bb6ec Update to 2.63.0 2019-10-04 16:50:57 +02:00
Kalev Lember 0085371da8 Update to 2.62.1 2019-10-04 14:04:04 +02:00
Kalev Lember 927ce866ba Update to 2.62.0 2019-09-06 09:34:17 +02:00
Kalev Lember 3f77266cf6 Update to 2.61.3 2019-09-03 11:39:52 +02:00
Kalev Lember 80b2df57b6 Update to 2.61.2 2019-08-12 11:27:51 +02:00
Fedora Release Engineering 9558681601 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 03:41:12 +00:00
Kalev Lember dd3956be01 Drop bash completion permission changing hack
This has been fixed upstream.
2019-07-09 14:41:30 +03:00
David King f45e5da632 Consistently use buildroot macro
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_using_buildroot_and_optflags_vs_rpm_build_root_and_rpm_opt_flags
2019-06-11 09:06:50 +01:00
David King aafbdc7a3c Remove unused patch 2019-06-11 09:04:53 +01:00
David King e81b0cb6f7 Fix CVE-2019-12450 (#1719142) 2019-06-11 09:04:42 +01:00
Kalev Lember d40813ab05 Update to 2.61.1 2019-05-24 20:06:10 +02:00
Adam Williamson 0f797a67d7 Rebuild with Meson fix for #1699099 2019-04-16 10:02:44 -07:00
Kalev Lember 8b0b09cbeb Update to 2.61.0 2019-04-15 17:05:48 +02:00
Kalev Lember 46304cbb85 Update to 2.60.1 2019-04-15 16:14:33 +02:00
Zbigniew Jędrzejewski-Szmek 12007a228d Switch back to timestamp-based invalidation mode but fix seed
It turns out the hashed-based invalidation mode is buggy.
2019-03-13 10:13:50 +01:00
Zbigniew Jędrzejewski-Szmek de2e4aad98 Switch to explicit byte compilation to override invalidation mode 2019-03-06 15:44:10 +01:00
Zbigniew Jędrzejewski-Szmek 789d0acce0 Make sure all .py files have fixed timestamps 2019-03-06 13:33:00 +01:00
Kalev Lember 66f00fe02c Update to 2.60.0 2019-03-04 22:48:12 +01:00
Kalev Lember 8594386f06 Update to 2.59.3 2019-02-18 10:37:38 +01:00
Kalev Lember 0660fa0c94 Update to 2.59.2 2019-02-04 17:33:58 +01:00
Fedora Release Engineering b0612ed4ec - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 22:40:03 +00:00
Kalev Lember f877f72c6a Update to 2.59.1 2019-01-26 15:24:09 +01:00
Kalev Lember 1cc525296d Add a conflict with older gcr versions
glib 2.59.0 hash table changes broke gcr versions older than 3.28.1. Add
an explicit conflict to make sure dnf updates these in lock step.
2019-01-21 12:17:48 +01:00
Kalev Lember 9f7e13d0db Switch to the meson build system 2019-01-03 13:57:37 +01:00
Kalev Lember cbe7cdc693 Add missing gcc and gcc-c++ build deps 2019-01-03 13:30:29 +01:00
Kalev Lember 118876b458 Update to 2.59.0 2019-01-03 12:20:01 +01:00
Kalev Lember aedd1304a1 Update to 2.58.2 2018-12-18 15:30:27 +01:00
Miro Hrončok 6070ee78fb https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 2018-11-15 12:53:55 +01:00
Kalev Lember 4acd8adcda Fix multilib -devel installs
This time the issue was that the glib build system generates
bytecompiled python files during make install, so the 'touch -r' that's
after make install didn't take effect. Fix this by removing the
bytecompiled files after make install, and let rpmbuild brp scripts
regenerate them again afterwards.

https://bugzilla.redhat.com/show_bug.cgi?id=1634778
2018-10-05 09:54:32 +02:00
Kalev Lember 03b8b8e2e3 Update to 2.58.1 2018-09-21 16:45:27 +02:00
Kalev Lember 5d7683bd2f Merge branch 'master' into f29 2018-09-05 17:23:07 +02:00
Kalev Lember e17445b580 Sort %files list 2018-09-05 16:37:05 +02:00
Kalev Lember 8772f8141f Update to 2.58.0 2018-09-05 16:36:01 +02:00
Colin Walters 9a01b6006b Add --disable-silent-rules
To make it easier to debug build issues.
2018-08-27 09:39:30 -04:00
Ondrej Holy 96178709bd Update to 2.57.2 2018-08-02 11:13:04 +02:00
Ondrej Holy 61bd4d25e7 Update to 2.57.1 2018-07-20 15:50:57 +02:00
Fedora Release Engineering 38b0fc282d - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 02:34:01 +00:00
Miro Hrončok fdc1cc9df5 Rebuilt for Python 3.7 2018-06-19 10:43:50 +02:00
Debarshi Ray 9c3ca0aa8b Backport patch to fix possible invalid pointer in dbus callback
... in the FD.o notification backend

https://bugzilla.redhat.com/show_bug.cgi?id=1584916
https://gitlab.gnome.org/GNOME/glib/merge_requests/90
https://gitlab.gnome.org/GNOME/glib/merge_requests/102
2018-06-14 15:34:42 +02:00
Kalev Lember 6c43ffbb6e Rely on %make_install overriding INSTALL, instead of doing it ourselves 2018-05-27 14:18:20 +02:00
Kalev Lember dea8a050cc Fix multilib -devel installs (#1581067)
We are patching one of the .py files, which is causing the timestamp to
be slightly off in different builds, which in turn gets baked into .pyc
files. Work this around by using another file's timestamp for the
patched .py file.
2018-05-27 14:16:21 +02:00
Fabio Valentini 4c1e2ebdaa
include upstream patch to fix gdbus-codegen with meson 0.46 2018-05-13 15:06:56 +02:00
Kalev Lember 98d0423b58 Update to 2.56.1 2018-04-08 22:23:09 +02:00
Kalev Lember cda7784363 Update to 2.56.0 2018-03-12 22:36:00 +01:00
Igor Gnatenko 9b6973c83d
remove glib-compile-schemas for /app
It's not in Fedora guidelines and even if it would be there, it would
require separate trigger.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 17:36:39 +01:00
Igor Gnatenko 2bf83454cd
Undo disabling mangling
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-07 18:31:09 +01:00
Kalev Lember 2cdd991d06 Disable brp-mangle-shebangs shebangs
It suddenly started creating broken /usr/bin//usr/bin/python3 shebangs,
making glib2-devel uninstallable.
2018-02-07 04:26:11 +01:00
Kalev Lember fd6c7196f2 Drop ldconfig scriptlets 2018-02-07 03:24:24 +01:00
Kalev Lember ad56827ff1 Update to 2.55.2 2018-02-07 03:24:24 +01:00
Igor Gnatenko 14f6fc54a9 Switch to %ldconfig_scriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-01-31 17:34:41 +01:00
Kalev Lember 087ef3ba0f gmain: Partial revert of recent wakeup changes
https://bugzilla.gnome.org/show_bug.cgi?id=761102
2018-01-18 12:47:19 +01:00
Kalev Lember 903f77fb2d Drop upstreamed systemtap multilib fix 2018-01-08 21:43:21 +01:00
Kalev Lember acd3cbe4d5 Update to 2.55.1 2018-01-08 21:35:29 +01:00
Kalev Lember 0ce8af8d61 Update to 2.55.0 2017-12-19 10:26:26 +01:00
Kalev Lember 1267711fed Update to 2.54.2 2017-11-01 16:14:30 +01:00
Kalev Lember 9c81d716d8 Update to 2.54.1 2017-10-06 20:21:53 +02:00
Kalev Lember a462f9ad53 Update to 2.54.0 2017-09-11 07:15:36 +02:00
Kalev Lember a26ff7ab92 Update to 2.53.7 2017-09-05 22:24:42 +02:00
Kalev Lember bdba4a7a70 Update to 2.53.6 2017-08-19 18:08:12 +02:00
Igor Gnatenko d7233f80ab trivial: use better macro for make (install) provided by RPM
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-08-07 22:45:34 +02:00
Igor Gnatenko 78ad5e06b9 Update to 2.53.5
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-08-07 22:45:26 +02:00
Kalev Lember 7601a56f32 Backport glib-mkenums flags annotation parsing fixes 2017-08-01 22:54:29 +01:00
Fedora Release Engineering 52c8682ec3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 10:19:53 +00:00
Kalev Lember 8a2874adbc Revert a GKeyFile introspection ABI change 2017-07-21 19:00:31 +02:00
Kalev Lember 9d1a02789c Update to 2.53.4 2017-07-18 10:24:36 +02:00
Kalev Lember 712673e983 Update to 2.53.3 2017-06-22 17:53:14 +02:00
Owen W. Taylor a93430c4ec Make triggers also compile schemas in /app/share/glib-2.0/schemas 2017-06-08 21:46:35 -04:00
Florian Müllner c120a31c5c Update to 2.53.2 2017-05-24 23:19:47 +02:00
7 changed files with 4455 additions and 183 deletions

View File

@ -1,106 +0,0 @@
From 5d74233476d61771b4d67d50bec5420f551ef922 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue, 4 Apr 2017 09:56:47 +0200
Subject: [PATCH] gmain: only signal GWakeup right before or during a blocking
poll
Since commit e4ee307 ("Do not wake up main loop if change is from same
thread", bug 761102), GMainContext uses context->owner to decide if the
event loop is being run in the current thread. However, what really
matters is the phase in the prepare/query/poll/check/dispatch sequence.
Wakeups are only needed between the end of prepare and the end of poll,
and then only if prepare found that no sources were ready.
There is no need to take threads into account, because prepare, check
and all callers of conditional_wakeup all look at the new need_wakeup
flag inside LOCK_CONTEXT/UNLOCK_CONTEXT.
With this change, g_main_context_is_owner and g_main_context_wait are
the only functions for which acquire/release matters, just like before
commit e4ee307.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
---
glib/gmain.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/glib/gmain.c b/glib/gmain.c
index ab2908e52..af0a29ae5 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -277,7 +277,8 @@ struct _GMainContext
guint next_id;
GList *source_lists;
- gint in_check_or_prepare;
+ gboolean in_check_or_prepare;
+ gboolean need_wakeup;
GPollRec *poll_records;
guint n_poll_records;
@@ -651,6 +652,7 @@ g_main_context_new (void)
context->pending_dispatches = g_ptr_array_new ();
+ context->need_wakeup = FALSE;
context->time_is_fresh = FALSE;
context->wakeup = g_wakeup_new ();
@@ -1127,17 +1129,11 @@ source_remove_from_context (GSource *source,
static void
conditional_wakeup (GMainContext *context)
{
- /* We want to signal wakeups in two cases:
- * 1 When the context is owned by another thread
- * 2 When the context owner is NULL (two subcases)
- * 2a Possible if the context has never been acquired
- * 2b Or if the context has no current owner
- *
- * At least case 2a) is necessary to ensure backwards compatibility with
- * qemu's use of GMainContext.
- * https://bugzilla.gnome.org/show_bug.cgi?id=761102#c14
+ /* This flag is set if at the start of prepare() we have no other ready
+ * sources, and hence would wait in poll(). In that case, any other threads
+ * attaching sources will need to signal a wakeup.
*/
- if (context->owner != G_THREAD_SELF)
+ if (context->need_wakeup)
g_wakeup_signal (context->wakeup);
}
@@ -3469,6 +3465,10 @@ g_main_context_prepare (GMainContext *context,
LOCK_CONTEXT (context);
+ /* context->need_wakeup is protected by LOCK_CONTEXT/UNLOCK_CONTEXT,
+ * so need not set it yet.
+ */
+
context->time_is_fresh = FALSE;
if (context->in_check_or_prepare)
@@ -3594,6 +3594,8 @@ g_main_context_prepare (GMainContext *context,
}
}
g_source_iter_clear (&iter);
+ /* See conditional_wakeup() where this is used */
+ context->need_wakeup = (n_ready == 0);
TRACE (GLIB_MAIN_CONTEXT_AFTER_PREPARE (context, current_priority, n_ready));
@@ -3728,6 +3730,12 @@ g_main_context_check (GMainContext *context,
TRACE (GLIB_MAIN_CONTEXT_BEFORE_CHECK (context, max_priority, fds, n_fds));
+ /* We don't need to wakeup during check or dispatch, because
+ * all sources will be re-evaluated during prepare/query.
+ */
+ context->need_wakeup = FALSE;
+
+ /* And if we have a wakeup pending, acknowledge it */
for (i = 0; i < n_fds; i++)
{
if (fds[i].fd == context->wake_up_rec.fd)
--
2.12.2

3417
1719.patch Normal file

File diff suppressed because it is too large Load Diff

32
1728.patch Normal file
View File

@ -0,0 +1,32 @@
From c2b8fa8a34765d42be69e7eb9a4c44eeb970f775 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 28 Oct 2020 10:41:13 -0500
Subject: [PATCH] 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
---
gio/gsocketclient.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c
index ce3c186fb..373774682 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);
--
GitLab

View File

@ -1,26 +1,37 @@
%global _changelog_trimtime %(date +%s -d "1 year ago")
# See https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation
%global __python %{__python3}
Name: glib2
Version: 2.52.2
Release: 2%{?dist}
Version: 2.67.0
Release: 5%{?dist}
Summary: A library of handy utility functions
License: LGPLv2+
URL: http://www.gtk.org
Source0: http://download.gnome.org/sources/glib/2.52/glib-%{version}.tar.xz
Source0: http://download.gnome.org/sources/glib/2.67/glib-%{version}.tar.xz
Patch0: 0001-gmain-only-signal-GWakeup-right-before-or-during-a-b.patch
# Required for RHEL core crypto components policy.
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/903
Patch0: gnutls-hmac.patch
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1728
Patch1: 1728.patch
# gcc 11 support: Fix invalid use of volatile objects
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Patch2: 1719.patch
# For gnutls-hmac.patch
BuildRequires: pkgconfig(gnutls)
BuildRequires: chrpath
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: perl-generators
BuildRequires: gtk-doc
BuildRequires: perl-interpreter
# for sys/inotify.h
BuildRequires: glibc-devel
BuildRequires: libattr-devel
BuildRequires: libselinux-devel
BuildRequires: meson
# for sys/sdt.h
BuildRequires: systemtap-sdt-devel
BuildRequires: pkgconfig(libelf)
@ -28,14 +39,14 @@ BuildRequires: pkgconfig(libffi)
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(mount)
BuildRequires: pkgconfig(zlib)
# Bootstrap build requirements
BuildRequires: automake autoconf libtool
BuildRequires: gtk-doc
BuildRequires: python3-devel
# for GIO content-type support
Recommends: shared-mime-info
# glib 2.59.0 hash table changes broke older gcr versions / password prompts in gnome-shell
Conflicts: gcr < 3.28.1
%description
GLib is the low-level core library that forms the basis for projects
such as GTK+ and GNOME. It provides data structure handling for C,
@ -66,12 +77,14 @@ BuildRequires: gamin-devel
%description fam
The glib2-fam package contains the FAM (File Alteration Monitor) module for GIO.
%if 0%{?fedora}
%package static
Summary: glib static
Requires: %{name}-devel = %{version}-%{release}
%description static
The %{name}-static subpackage contains static libraries for %{name}.
%endif
%package tests
Summary: Tests for the glib2 package
@ -82,61 +95,55 @@ The glib2-tests package contains tests that can be used to verify
the functionality of the installed glib2 package.
%prep
%setup -q -n glib-%{version}
%patch0 -p1
%autosetup -n glib-%{version} -p1
%build
# Bug 1324770: Also explicitly remove PCRE sources since we use --with-pcre=system
rm glib/pcre/*.[ch]
# Support builds of both git snapshots and tarballs packed with autogoo
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
%configure $CONFIGFLAGS \
--with-python=%{__python3} \
--with-pcre=system \
--enable-systemtap \
--enable-static \
--enable-installed-tests
)
make %{?_smp_mflags}
# We cannot build with GnuTLS in Fedora since there is no gnutls-static
# subpackage. (glib2-static is needed by qemu in Fedora, but not in RHEL.)
# Accordingly, we can't build a usable glib2-static in RHEL.
%meson \
-Dman=true \
-Ddtrace=true \
-Dsystemtap=true \
-Dgtk_doc=true \
-Dfam=true \
-Dinstalled_tests=true \
%if 0%{?rhel}
-Dgnutls=true \
%endif
%if 0%{?fedora}
--default-library=both \
%endif
%{nil}
%meson_build
%install
# Use -p to preserve timestamps on .py files to ensure
# they're not recompiled with different timestamps
# to help multilib: https://bugzilla.redhat.com/show_bug.cgi?id=718404
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p -c"
# Also since this is a generated .py file, set it to a known timestamp,
# otherwise it will vary by build time, and thus break multilib -devel
# installs.
touch -r gio/gdbus-2.0/codegen/config.py.in $RPM_BUILD_ROOT/%{_datadir}/glib-2.0/codegen/config.py
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/*.so
%meson_install
# Since this is a generated .py file, set it to a known timestamp for
# better reproducibility.
# Also copy the timestamp for other .py files, because meson doesn't
# do this, see https://github.com/mesonbuild/meson/issues/5027.
touch -r gio/gdbus-2.0/codegen/config.py.in %{buildroot}%{_datadir}/glib-2.0/codegen/*.py
chrpath --delete %{buildroot}%{_libdir}/*.so
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gio/modules/*.{a,la}
rm -f $RPM_BUILD_ROOT%{_datadir}/glib-2.0/gdb/*.{pyc,pyo}
rm -f $RPM_BUILD_ROOT%{_datadir}/glib-2.0/codegen/*.{pyc,pyo}
# Perform byte compilation manually to avoid issues with
# irreproducibility of the default invalidation mode, see
# https://www.python.org/dev/peps/pep-0552/ and
# https://bugzilla.redhat.com/show_bug.cgi?id=1686078
export PYTHONHASHSEED=0
%py_byte_compile %{__python3} %{buildroot}%{_datadir}
# Multilib fixes for systemtap tapsets; see
# https://bugzilla.redhat.com/718404
for f in $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/*.stp; do
(dn=$(dirname ${f}); bn=$(basename ${f});
mv ${f} ${dn}/%{__isa_bits}-${bn})
done
mv %{buildroot}%{_bindir}/gio-querymodules %{buildroot}%{_bindir}/gio-querymodules-%{__isa_bits}
sed -i -e "/^gio_querymodules=/s/gio-querymodules/gio-querymodules-%{__isa_bits}/" %{buildroot}%{_libdir}/pkgconfig/gio-2.0.pc
mv $RPM_BUILD_ROOT%{_bindir}/gio-querymodules $RPM_BUILD_ROOT%{_bindir}/gio-querymodules-%{__isa_bits}
touch $RPM_BUILD_ROOT%{_libdir}/gio/modules/giomodule.cache
# bash-completion scripts need not be executable
chmod 644 $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/*
touch %{buildroot}%{_libdir}/gio/modules/giomodule.cache
%find_lang glib20
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%transfiletriggerin -- %{_libdir}/gio/modules
gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules &> /dev/null || :
@ -159,9 +166,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_libdir}/libgio-2.0.so.*
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/gdbus
%{_datadir}/bash-completion/completions/gsettings
%{_datadir}/bash-completion/completions/gapplication
%{_datadir}/bash-completion/completions/gdbus
%{_datadir}/bash-completion/completions/gio
%{_datadir}/bash-completion/completions/gsettings
%dir %{_datadir}/glib-2.0
%dir %{_datadir}/glib-2.0/schemas
%dir %{_libdir}/gio
@ -220,18 +228,290 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%files fam
%{_libdir}/gio/modules/libgiofam.so
%if 0%{?fedora}
%files static
%{_libdir}/libgio-2.0.a
%{_libdir}/libglib-2.0.a
%{_libdir}/libgmodule-2.0.a
%{_libdir}/libgobject-2.0.a
%{_libdir}/libgthread-2.0.a
%endif
%files tests
%{_libexecdir}/installed-tests
%{_datadir}/installed-tests
%changelog
* Tue Nov 24 2020 Kalev Lember <klember@redhat.com> - 2.67.0-5
- Backport upstream patches to fix invalid use of volatile objects
(gcc 11 support)
* Wed Nov 11 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.67.0-4
- Make GnuTLS patch RHEL-specific, and make glib2-static subpackage Fedora-specific
* Tue Nov 10 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.67.0-3
- Use GnuTLS to implement GHmac (thanks to Colin Walters)
* Wed Nov 04 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.67.0-2
- Backport fix for GSocketClient crash
* Thu Oct 29 2020 Kalev Lember <klember@redhat.com> - 2.67.0-1
- Update to 2.67.0
* Mon Oct 19 2020 Kalev Lember <klember@redhat.com> - 2.66.2-1
- Update to 2.66.2
- Drop gtk-doc patch as we finally have a new enough gtk-doc
* Wed Oct 14 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.66.1-3
- Fix yet another timezone bug
* Wed Oct 14 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.66.1-2
- Fix timezone-related bugs in many applications caused by new glib timezone cache
* Thu Oct 1 2020 Kalev Lember <klember@redhat.com> - 2.66.1-1
- Update to 2.66.1
* Thu Sep 10 2020 Kalev Lember <klember@redhat.com> - 2.66.0-1
- Update to 2.66.0
* Wed Sep 02 2020 Kalev Lember <klember@redhat.com> - 2.65.3-1
- Update to 2.65.3
* Tue Aug 25 2020 Adam Williamson <awilliam@redhat.com> - 2.65.2-3
- Backport fix for GGO #2189 (error accessing some filesystems)
* Thu Aug 20 2020 Jeff Law <law@redhat.com> - 2.65.2-2
- Re-enable LTO
* Tue Aug 18 2020 Kalev Lember <klember@redhat.com> - 2.65.2-1
- Update to 2.65.2
* Mon Aug 17 2020 Kalev Lember <klember@redhat.com> - 2.65.1-1
- Update to 2.65.1
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.65.0-5
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.65.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jun 30 2020 Jeff Law <aw@redhat.com> - 2.65.0-3
Disable LTO
* Mon Jun 22 2020 Kalev Lember <klember@redhat.com> - 2.65.0-2
- Update gio-2.0.pc with correct gio-querymodules name when renaming it
(#1849441)
* Mon Jun 22 2020 Kalev Lember <klember@redhat.com> - 2.65.0-1
- Update to 2.65.0
* Wed May 20 2020 Kalev Lember <klember@redhat.com> - 2.64.3-1
- Update to 2.64.3
* Tue Apr 28 2020 Tomas Popela <tpopela@redhat.com> - 2.64.2-2
- Backport fix for a race condition in GCancellable (rhbz#1825230)
* Fri Apr 10 2020 Kalev Lember <klember@redhat.com> - 2.64.2-1
- Update to 2.64.2
* Wed Mar 11 2020 Kalev Lember <klember@redhat.com> - 2.64.1-1
- Update to 2.64.1
* Mon Mar 02 2020 Kalev Lember <klember@redhat.com> - 2.64.0-1
- Update to 2.64.0
* Mon Feb 24 2020 Kalev Lember <klember@redhat.com> - 2.63.6-1
- Update to 2.63.6
* Wed Feb 12 2020 Kalev Lember <klember@redhat.com> - 2.63.5-3
- Backport a patch to work around SELinux policies not allowing
SYS_sched_setattr (#1795524)
* Fri Feb 07 2020 Michael Catanzaro <mcatanzaro@redhat.com> - 2.63.5-2
- Add patch for CVE-2020-6750 and related issues.
* Mon Feb 03 2020 Kalev Lember <klember@redhat.com> - 2.63.5-1
- Update to 2.63.5
* Wed Jan 29 2020 Stephen Gallagher <sgallagh@redhat.com> - 2.63.4-3
- Fix GThreadPool initialization that is breaking createrepo_c (BZ #1795052)
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.63.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jan 24 2020 Kalev Lember <klember@redhat.com> - 2.63.4-1
- Update to 2.63.4
* Mon Dec 16 2019 Kalev Lember <klember@redhat.com> - 2.63.3-1
- Update to 2.63.3
* Mon Dec 02 2019 Kalev Lember <klember@redhat.com> - 2.63.2-1
- Update to 2.63.2
* Fri Oct 04 2019 Kalev Lember <klember@redhat.com> - 2.63.0-1
- Update to 2.63.0
* Fri Oct 04 2019 Kalev Lember <klember@redhat.com> - 2.62.1-1
- Update to 2.62.1
* Fri Sep 06 2019 Kalev Lember <klember@redhat.com> - 2.62.0-1
- Update to 2.62.0
* Tue Sep 03 2019 Kalev Lember <klember@redhat.com> - 2.61.3-1
- Update to 2.61.3
* Mon Aug 12 2019 Kalev Lember <klember@redhat.com> - 2.61.2-1
- Update to 2.61.2
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.61.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jun 11 2019 David King <amigadave@amigadave.com> - 2.61.1-2
- Fix CVE-2019-12450 (#1719142)
- Consistently use buildroot macro
* Fri May 24 2019 Kalev Lember <klember@redhat.com> - 2.61.1-1
- Update to 2.61.1
* Tue Apr 16 2019 Adam Williamson <awilliam@redhat.com> - 2.61.0-2
- Rebuild with Meson fix for #1699099
* Mon Apr 15 2019 Kalev Lember <klember@redhat.com> - 2.61.0-1
- Update to 2.61.0
* Mon Apr 15 2019 Kalev Lember <klember@redhat.com> - 2.60.1-1
- Update to 2.60.1
* Wed Mar 13 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.60.0-3
- Switch back to timestamp-based pyc invalidation mode
* Wed Mar 6 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.60.0-2
- Make sure all .py files have fixed timestamps (fixes issue with
parallel installability of i686 and amd64 -devel packages)
- Switch to explicit byte compilation to override invalidation mode
* Mon Mar 04 2019 Kalev Lember <klember@redhat.com> - 2.60.0-1
- Update to 2.60.0
* Mon Feb 18 2019 Kalev Lember <klember@redhat.com> - 2.59.3-1
- Update to 2.59.3
* Mon Feb 04 2019 Kalev Lember <klember@redhat.com> - 2.59.2-1
- Update to 2.59.2
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.59.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jan 26 2019 Kalev Lember <klember@redhat.com> - 2.59.1-1
- Update to 2.59.1
* Thu Jan 03 2019 Kalev Lember <klember@redhat.com> - 2.59.0-1
- Update to 2.59.0
- Switch to the meson build system
* Tue Dec 18 2018 Kalev Lember <klember@redhat.com> - 2.58.2-1
- Update to 2.58.2
* Fri Oct 05 2018 Kalev Lember <klember@redhat.com> - 2.58.1-2
- Fix multilib -devel installs (#1634778)
* Fri Sep 21 2018 Kalev Lember <klember@redhat.com> - 2.58.1-1
- Update to 2.58.1
* Wed Sep 05 2018 Kalev Lember <klember@redhat.com> - 2.58.0-1
- Update to 2.58.0
* Thu Aug 2 2018 Ondrej Holy <oholy@redhat.com> - 2.57.2-1
- Update to 2.57.2
* Fri Jul 20 2018 Ondrej Holy <oholy@redhat.com> - 2.57.1-1
- Update to 2.57.1
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.56.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.56.1-5
- Rebuilt for Python 3.7
* Thu Jun 14 2018 Debarshi Ray <rishi@fedoraproject.org> - 2.56.1-4
- Backport patch to fix possible invalid pointer in dbus callback in the FD.o
notification backend (RH #1584916)
* Sun May 27 2018 Kalev Lember <klember@redhat.com> - 2.56.1-3
- Fix multilib -devel installs (#1581067)
* Sun May 13 2018 Fabio Valentini <decathorpe@gmail.com> - 2.56.1-2
- Include upstream patch to fix gdbus-codegen with meson 0.46.
* Sun Apr 08 2018 Kalev Lember <klember@redhat.com> - 2.56.1-1
- Update to 2.56.1
* Mon Mar 12 2018 Kalev Lember <klember@redhat.com> - 2.56.0-1
- Update to 2.56.0
* Wed Feb 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.55.2-3
- Undo disabling mangling
* Wed Feb 07 2018 Kalev Lember <klember@redhat.com> - 2.55.2-2
- Disable brp-mangle-shebangs shebangs
* Wed Feb 07 2018 Kalev Lember <klember@redhat.com> - 2.55.2-1
- Update to 2.55.2
- Drop ldconfig scriptlets
* Wed Jan 31 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.55.1-3
- Switch to %%ldconfig_scriptlets
* Thu Jan 18 2018 Kalev Lember <klember@redhat.com> - 2.55.1-2
- gmain: Partial revert of recent wakeup changes
* Mon Jan 08 2018 Kalev Lember <klember@redhat.com> - 2.55.1-1
- Update to 2.55.1
- Drop upstreamed systemtap multilib fix
* Tue Dec 19 2017 Kalev Lember <klember@redhat.com> - 2.55.0-1
- Update to 2.55.0
* Wed Nov 01 2017 Kalev Lember <klember@redhat.com> - 2.54.2-1
- Update to 2.54.2
* Fri Oct 06 2017 Kalev Lember <klember@redhat.com> - 2.54.1-1
- Update to 2.54.1
* Mon Sep 11 2017 Kalev Lember <klember@redhat.com> - 2.54.0-1
- Update to 2.54.0
* Tue Sep 05 2017 Kalev Lember <klember@redhat.com> - 2.53.7-1
- Update to 2.53.7
* Sat Aug 19 2017 Kalev Lember <klember@redhat.com> - 2.53.6-1
- Update to 2.53.6
* Mon Aug 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.53.5-1
- Update to 2.53.5
* Tue Aug 01 2017 Kalev Lember <klember@redhat.com> - 2.53.4-4
- Backport glib-mkenums flags annotation parsing fixes
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.53.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Jul 21 2017 Kalev Lember <klember@redhat.com> - 2.53.4-2
- Revert a GKeyFile introspection ABI change
* Tue Jul 18 2017 Kalev Lember <klember@redhat.com> - 2.53.4-1
- Update to 2.53.4
* Thu Jun 22 2017 Kalev Lember <klember@redhat.com> - 2.53.3-1
- Update to 2.53.3
* Thu Jun 8 2017 Owen Taylor <otaylor@redhat.com> - 2.53.2-2
- Make triggers also compile schemas in /app/share/glib-2.0/schemas
* Wed May 24 2017 Florian Müllner <fmuellner@redhat.com> - 2.53.2-1
- Update to 2.53.2
* Mon May 15 2017 Kalev Lember <klember@redhat.com> - 2.52.2-2
- Backport a gmain GWakeup patch to fix timedatex high CPU usage (#1450628)

668
gnutls-hmac.patch Normal file
View File

@ -0,0 +1,668 @@
From afb5735506e2ed1c638a8c916aa3748bf0615f32 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Fri, 7 Jun 2019 18:44:43 +0000
Subject: [PATCH 1/2] ghmac: Split off wrapper functions into ghmac-utils.c
Prep for adding a GnuTLS HMAC implementation; these are just
utility functions that call the "core" API.
---
glib/ghmac-utils.c | 145 +++++++++++++++++++++++++++++++++++++++++++++
glib/ghmac.c | 112 ----------------------------------
glib/meson.build | 1 +
3 files changed, 146 insertions(+), 112 deletions(-)
create mode 100644 glib/ghmac-utils.c
diff --git a/glib/ghmac-utils.c b/glib/ghmac-utils.c
new file mode 100644
index 000000000..a17359ff1
--- /dev/null
+++ b/glib/ghmac-utils.c
@@ -0,0 +1,145 @@
+/* ghmac.h - data hashing functions
+ *
+ * Copyright (C) 2011 Collabora Ltd.
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include "ghmac.h"
+
+#include "glib/galloca.h"
+#include "gatomic.h"
+#include "gslice.h"
+#include "gmem.h"
+#include "gstrfuncs.h"
+#include "gtestutils.h"
+#include "gtypes.h"
+#include "glibintl.h"
+
+/**
+ * g_compute_hmac_for_data:
+ * @digest_type: a #GChecksumType to use for the HMAC
+ * @key: (array length=key_len): the key to use in the HMAC
+ * @key_len: the length of the key
+ * @data: (array length=length): binary blob to compute the HMAC of
+ * @length: length of @data
+ *
+ * Computes the HMAC for a binary @data of @length. This is a
+ * convenience wrapper for g_hmac_new(), g_hmac_get_string()
+ * and g_hmac_unref().
+ *
+ * The hexadecimal string returned will be in lower case.
+ *
+ * Returns: the HMAC of the binary data as a string in hexadecimal.
+ * The returned string should be freed with g_free() when done using it.
+ *
+ * Since: 2.30
+ */
+gchar *
+g_compute_hmac_for_data (GChecksumType digest_type,
+ const guchar *key,
+ gsize key_len,
+ const guchar *data,
+ gsize length)
+{
+ GHmac *hmac;
+ gchar *retval;
+
+ g_return_val_if_fail (length == 0 || data != NULL, NULL);
+
+ hmac = g_hmac_new (digest_type, key, key_len);
+ if (!hmac)
+ return NULL;
+
+ g_hmac_update (hmac, data, length);
+ retval = g_strdup (g_hmac_get_string (hmac));
+ g_hmac_unref (hmac);
+
+ return retval;
+}
+
+/**
+ * g_compute_hmac_for_bytes:
+ * @digest_type: a #GChecksumType to use for the HMAC
+ * @key: the key to use in the HMAC
+ * @data: binary blob to compute the HMAC of
+ *
+ * Computes the HMAC for a binary @data. This is a
+ * convenience wrapper for g_hmac_new(), g_hmac_get_string()
+ * and g_hmac_unref().
+ *
+ * The hexadecimal string returned will be in lower case.
+ *
+ * Returns: the HMAC of the binary data as a string in hexadecimal.
+ * The returned string should be freed with g_free() when done using it.
+ *
+ * Since: 2.50
+ */
+gchar *
+g_compute_hmac_for_bytes (GChecksumType digest_type,
+ GBytes *key,
+ GBytes *data)
+{
+ gconstpointer byte_data;
+ gsize length;
+ gconstpointer key_data;
+ gsize key_len;
+
+ g_return_val_if_fail (data != NULL, NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ byte_data = g_bytes_get_data (data, &length);
+ key_data = g_bytes_get_data (key, &key_len);
+ return g_compute_hmac_for_data (digest_type, key_data, key_len, byte_data, length);
+}
+
+
+/**
+ * g_compute_hmac_for_string:
+ * @digest_type: a #GChecksumType to use for the HMAC
+ * @key: (array length=key_len): the key to use in the HMAC
+ * @key_len: the length of the key
+ * @str: the string to compute the HMAC for
+ * @length: the length of the string, or -1 if the string is nul-terminated
+ *
+ * Computes the HMAC for a string.
+ *
+ * The hexadecimal string returned will be in lower case.
+ *
+ * Returns: the HMAC as a hexadecimal string.
+ * The returned string should be freed with g_free()
+ * when done using it.
+ *
+ * Since: 2.30
+ */
+gchar *
+g_compute_hmac_for_string (GChecksumType digest_type,
+ const guchar *key,
+ gsize key_len,
+ const gchar *str,
+ gssize length)
+{
+ g_return_val_if_fail (length == 0 || str != NULL, NULL);
+
+ if (length < 0)
+ length = strlen (str);
+
+ return g_compute_hmac_for_data (digest_type, key, key_len,
+ (const guchar *) str, length);
+}
diff --git a/glib/ghmac.c b/glib/ghmac.c
index 49fd272f0..4f181f21f 100644
--- a/glib/ghmac.c
+++ b/glib/ghmac.c
@@ -329,115 +329,3 @@ g_hmac_get_digest (GHmac *hmac,
g_checksum_update (hmac->digesto, buffer, len);
g_checksum_get_digest (hmac->digesto, buffer, digest_len);
}
-
-/**
- * g_compute_hmac_for_data:
- * @digest_type: a #GChecksumType to use for the HMAC
- * @key: (array length=key_len): the key to use in the HMAC
- * @key_len: the length of the key
- * @data: (array length=length): binary blob to compute the HMAC of
- * @length: length of @data
- *
- * Computes the HMAC for a binary @data of @length. This is a
- * convenience wrapper for g_hmac_new(), g_hmac_get_string()
- * and g_hmac_unref().
- *
- * The hexadecimal string returned will be in lower case.
- *
- * Returns: the HMAC of the binary data as a string in hexadecimal.
- * The returned string should be freed with g_free() when done using it.
- *
- * Since: 2.30
- */
-gchar *
-g_compute_hmac_for_data (GChecksumType digest_type,
- const guchar *key,
- gsize key_len,
- const guchar *data,
- gsize length)
-{
- GHmac *hmac;
- gchar *retval;
-
- g_return_val_if_fail (length == 0 || data != NULL, NULL);
-
- hmac = g_hmac_new (digest_type, key, key_len);
- if (!hmac)
- return NULL;
-
- g_hmac_update (hmac, data, length);
- retval = g_strdup (g_hmac_get_string (hmac));
- g_hmac_unref (hmac);
-
- return retval;
-}
-
-/**
- * g_compute_hmac_for_bytes:
- * @digest_type: a #GChecksumType to use for the HMAC
- * @key: the key to use in the HMAC
- * @data: binary blob to compute the HMAC of
- *
- * Computes the HMAC for a binary @data. This is a
- * convenience wrapper for g_hmac_new(), g_hmac_get_string()
- * and g_hmac_unref().
- *
- * The hexadecimal string returned will be in lower case.
- *
- * Returns: the HMAC of the binary data as a string in hexadecimal.
- * The returned string should be freed with g_free() when done using it.
- *
- * Since: 2.50
- */
-gchar *
-g_compute_hmac_for_bytes (GChecksumType digest_type,
- GBytes *key,
- GBytes *data)
-{
- gconstpointer byte_data;
- gsize length;
- gconstpointer key_data;
- gsize key_len;
-
- g_return_val_if_fail (data != NULL, NULL);
- g_return_val_if_fail (key != NULL, NULL);
-
- byte_data = g_bytes_get_data (data, &length);
- key_data = g_bytes_get_data (key, &key_len);
- return g_compute_hmac_for_data (digest_type, key_data, key_len, byte_data, length);
-}
-
-
-/**
- * g_compute_hmac_for_string:
- * @digest_type: a #GChecksumType to use for the HMAC
- * @key: (array length=key_len): the key to use in the HMAC
- * @key_len: the length of the key
- * @str: the string to compute the HMAC for
- * @length: the length of the string, or -1 if the string is nul-terminated
- *
- * Computes the HMAC for a string.
- *
- * The hexadecimal string returned will be in lower case.
- *
- * Returns: the HMAC as a hexadecimal string.
- * The returned string should be freed with g_free()
- * when done using it.
- *
- * Since: 2.30
- */
-gchar *
-g_compute_hmac_for_string (GChecksumType digest_type,
- const guchar *key,
- gsize key_len,
- const gchar *str,
- gssize length)
-{
- g_return_val_if_fail (length == 0 || str != NULL, NULL);
-
- if (length < 0)
- length = strlen (str);
-
- return g_compute_hmac_for_data (digest_type, key, key_len,
- (const guchar *) str, length);
-}
diff --git a/glib/meson.build b/glib/meson.build
index aaf40a218..b3bf067c7 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -253,6 +253,7 @@ glib_sources = files(
'ggettext.c',
'ghash.c',
'ghmac.c',
+ 'ghmac-utils.c',
'ghook.c',
'ghostutils.c',
'giochannel.c',
--
2.28.0
From 703e63f9d8b3ea4f26f41f0d2287b301025a73cc Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Fri, 7 Jun 2019 19:36:54 +0000
Subject: [PATCH 2/2] Add a gnutls backend for GHmac
For RHEL we want apps to use FIPS-certified crypto libraries,
and HMAC apparently counts as "keyed" and hence needs to
be validated.
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1630260
Replaces: https://gitlab.gnome.org/GNOME/glib/merge_requests/897
This is a build-time option that backs the GHmac API with GnuTLS.
Most distributors ship glib-networking built with GnuTLS, and
most apps use glib-networking, so this isn't a net-new library
in most cases.
mcatanzaro note: I've updated Colin's original patch to implement
g_hmac_copy() using gnutls_hmac_copy(), which didn't exist when Colin
developed this patch.
---
glib/gchecksum.c | 9 ++-
glib/gchecksumprivate.h | 32 ++++++++
glib/ghmac-gnutls.c | 164 ++++++++++++++++++++++++++++++++++++++++
glib/ghmac.c | 3 +
glib/meson.build | 10 ++-
meson.build | 7 ++
meson_options.txt | 5 ++
7 files changed, 224 insertions(+), 6 deletions(-)
create mode 100644 glib/gchecksumprivate.h
create mode 100644 glib/ghmac-gnutls.c
diff --git a/glib/gchecksum.c b/glib/gchecksum.c
index f8a3f9ab8..b391a6264 100644
--- a/glib/gchecksum.c
+++ b/glib/gchecksum.c
@@ -20,7 +20,7 @@
#include <string.h>
-#include "gchecksum.h"
+#include "gchecksumprivate.h"
#include "gslice.h"
#include "gmem.h"
@@ -173,9 +173,9 @@ sha_byte_reverse (guint32 *buffer,
}
#endif /* G_BYTE_ORDER == G_BIG_ENDIAN */
-static gchar *
-digest_to_string (guint8 *digest,
- gsize digest_len)
+gchar *
+gchecksum_digest_to_string (guint8 *digest,
+ gsize digest_len)
{
gsize i, len = digest_len * 2;
gchar *retval;
@@ -194,6 +194,7 @@ digest_to_string (guint8 *digest,
return retval;
}
+#define digest_to_string gchecksum_digest_to_string
/*
* MD5 Checksum
diff --git a/glib/gchecksumprivate.h b/glib/gchecksumprivate.h
new file mode 100644
index 000000000..86c7a3b61
--- /dev/null
+++ b/glib/gchecksumprivate.h
@@ -0,0 +1,32 @@
+/* gstdioprivate.h - Private GLib stdio functions
+ *
+ * Copyright 2017 Руслан Ижбулатов
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_CHECKSUMPRIVATE_H__
+#define __G_CHECKSUMPRIVATE_H__
+
+#include "gchecksum.h"
+
+G_BEGIN_DECLS
+
+gchar *
+gchecksum_digest_to_string (guint8 *digest,
+ gsize digest_len);
+
+G_END_DECLS
+
+#endif
\ No newline at end of file
diff --git a/glib/ghmac-gnutls.c b/glib/ghmac-gnutls.c
new file mode 100644
index 000000000..f1a74a849
--- /dev/null
+++ b/glib/ghmac-gnutls.c
@@ -0,0 +1,164 @@
+/* ghmac.h - data hashing functions
+ *
+ * Copyright (C) 2011 Collabora Ltd.
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <gnutls/crypto.h>
+
+#include "ghmac.h"
+
+#include "glib/galloca.h"
+#include "gatomic.h"
+#include "gslice.h"
+#include "gmem.h"
+#include "gstrfuncs.h"
+#include "gchecksumprivate.h"
+#include "gtestutils.h"
+#include "gtypes.h"
+#include "glibintl.h"
+
+#ifndef HAVE_GNUTLS
+#error "build configuration error"
+#endif
+
+struct _GHmac
+{
+ int ref_count;
+ GChecksumType digest_type;
+ gnutls_hmac_hd_t hmac;
+ gchar *digest_str;
+};
+
+GHmac *
+g_hmac_new (GChecksumType digest_type,
+ const guchar *key,
+ gsize key_len)
+{
+ gnutls_mac_algorithm_t algo;
+ GHmac *hmac = g_slice_new0 (GHmac);
+ hmac->ref_count = 1;
+ hmac->digest_type = digest_type;
+
+ switch (digest_type)
+ {
+ case G_CHECKSUM_MD5:
+ algo = GNUTLS_MAC_MD5;
+ break;
+ case G_CHECKSUM_SHA1:
+ algo = GNUTLS_MAC_SHA1;
+ break;
+ case G_CHECKSUM_SHA256:
+ algo = GNUTLS_MAC_SHA256;
+ break;
+ case G_CHECKSUM_SHA384:
+ algo = GNUTLS_MAC_SHA384;
+ break;
+ case G_CHECKSUM_SHA512:
+ algo = GNUTLS_MAC_SHA512;
+ break;
+ default:
+ g_return_val_if_reached (NULL);
+ }
+
+ gnutls_hmac_init (&hmac->hmac, algo, key, key_len);
+
+ return hmac;
+}
+
+GHmac *
+g_hmac_copy (const GHmac *hmac)
+{
+ GHmac *copy;
+
+ g_return_val_if_fail (hmac != NULL, NULL);
+
+ copy = g_slice_new0 (GHmac);
+ copy->ref_count = 1;
+ copy->digest_type = hmac->digest_type;
+ copy->hmac = gnutls_hmac_copy (hmac->hmac);
+
+ return copy;
+}
+
+GHmac *
+g_hmac_ref (GHmac *hmac)
+{
+ g_return_val_if_fail (hmac != NULL, NULL);
+
+ g_atomic_int_inc (&hmac->ref_count);
+
+ return hmac;
+}
+
+void
+g_hmac_unref (GHmac *hmac)
+{
+ g_return_if_fail (hmac != NULL);
+
+ if (g_atomic_int_dec_and_test (&hmac->ref_count))
+ {
+ gnutls_hmac_deinit (hmac->hmac, NULL);
+ g_free (hmac->digest_str);
+ g_slice_free (GHmac, hmac);
+ }
+}
+
+
+void
+g_hmac_update (GHmac *hmac,
+ const guchar *data,
+ gssize length)
+{
+ g_return_if_fail (hmac != NULL);
+ g_return_if_fail (length == 0 || data != NULL);
+
+ gnutls_hmac (hmac->hmac, data, length);
+}
+
+const gchar *
+g_hmac_get_string (GHmac *hmac)
+{
+ guint8 *buffer;
+ gsize digest_len;
+
+ g_return_val_if_fail (hmac != NULL, NULL);
+
+ if (hmac->digest_str)
+ return hmac->digest_str;
+
+ digest_len = g_checksum_type_get_length (hmac->digest_type);
+ buffer = g_alloca (digest_len);
+
+ gnutls_hmac_output (hmac->hmac, buffer);
+ hmac->digest_str = gchecksum_digest_to_string (buffer, digest_len);
+ return hmac->digest_str;
+}
+
+
+void
+g_hmac_get_digest (GHmac *hmac,
+ guint8 *buffer,
+ gsize *digest_len)
+{
+ g_return_if_fail (hmac != NULL);
+
+ gnutls_hmac_output (hmac->hmac, buffer);
+ *digest_len = g_checksum_type_get_length (hmac->digest_type);
+}
diff --git a/glib/ghmac.c b/glib/ghmac.c
index 4f181f21f..c62d9ce4e 100644
--- a/glib/ghmac.c
+++ b/glib/ghmac.c
@@ -33,6 +33,9 @@
#include "gtypes.h"
#include "glibintl.h"
+#ifdef HAVE_GNUTLS
+#error "build configuration error"
+#endif
/**
* SECTION:hmac
diff --git a/glib/meson.build b/glib/meson.build
index b3bf067c7..3cdc3b573 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -252,7 +252,6 @@ glib_sources = files(
'gfileutils.c',
'ggettext.c',
'ghash.c',
- 'ghmac.c',
'ghmac-utils.c',
'ghook.c',
'ghostutils.c',
@@ -308,6 +307,7 @@ glib_sources = files(
'guriprivate.h',
'gutils.c',
'gutilsprivate.h',
+ 'gchecksumprivate.h',
'guuid.c',
'gvariant.c',
'gvariant-core.c',
@@ -352,6 +352,12 @@ else
glib_dtrace_hdr = []
endif
+if get_option('gnutls')
+ glib_sources += files('ghmac-gnutls.c')
+else
+ glib_sources += files('ghmac.c')
+endif
+
pcre_static_args = []
if use_pcre_static_flag
@@ -378,7 +384,7 @@ libglib = library('glib-2.0',
# intl.lib is not compatible with SAFESEH
link_args : [noseh_link_args, glib_link_flags, win32_ldflags],
include_directories : configinc,
- dependencies : pcre_deps + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + gnulib_libm_dependency + [libsysprof_capture_dep],
+ dependencies : pcre_deps + libgnutls_dep + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + gnulib_libm_dependency + [libsysprof_capture_dep],
c_args : glib_c_args,
objc_args : glib_c_args,
)
diff --git a/meson.build b/meson.build
index e0b308a25..70dd5355e 100644
--- a/meson.build
+++ b/meson.build
@@ -2056,6 +2056,13 @@ if host_system == 'linux'
glib_conf.set('HAVE_LIBMOUNT', libmount_dep.found())
endif
+# gnutls is used optionally by ghmac
+libgnutls_dep = []
+if get_option('gnutls')
+ libgnutls_dep = [dependency('gnutls', version : '>=3.6.9', required : true)]
+ glib_conf.set('HAVE_GNUTLS', 1)
+endif
+
if host_system == 'windows'
winsock2 = cc.find_library('ws2_32')
endif
diff --git a/meson_options.txt b/meson_options.txt
index af9645eda..2c4b2c37e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,6 +34,11 @@ option('libmount',
value : 'auto',
description : 'build with libmount support')
+option('gnutls',
+ type : 'boolean',
+ value : false,
+ description : 'build with gnutls support')
+
option('internal_pcre',
type : 'boolean',
value : false,
--
2.28.0

View File

@ -1 +1 @@
SHA512 (glib-2.52.2.tar.xz) = 3ea49b75b6f80d9974ebd3c40518d5aaffffd9d9d008c1ae3302690fa34899b91ae59c87f8235077129bbd8b01ef19211efb89bc7fdb08d0254b07735b1ba92d
SHA512 (glib-2.67.0.tar.xz) = 82d562bc80885c7e516e38f17a8830596b32b1e1a4b58454ca589be79e6ab27e0a2fe0a108cb02da21981c75474abed0263c0aa38c71ead45a68db675a1d2f80

View File

@ -1,19 +0,0 @@
#! /bin/sh
if test $# != 1; then
echo "usage: update-gio-modules host_triplet" 1>&2
exit 1
fi
echo "Warning: update-gio-modules is deprecated and will be removed in glib2-2.28.0"
umask 022
case "$host" in
alpha*|ia64*|powerpc64*|ppc64*|s390x*|sparc64*|x86_64*)
/usr/bin/gio-querymodules-64 /usr/lib64/gio/modules
;;
*)
/usr/bin/gio-querymodules-32 /usr/lib/gio/modules
;;
esac