Compare commits

...

77 Commits
f28 ... master

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
8 changed files with 4375 additions and 216 deletions

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,13 +0,0 @@
diff --git a/gio/gdbus-2.0/codegen/codegen_main.py b/gio/gdbus-2.0/codegen/codegen_main.py
index 9d9099f..1cfe7c1 100755
--- a/gio/gdbus-2.0/codegen/codegen_main.py
+++ b/gio/gdbus-2.0/codegen/codegen_main.py
@@ -209,7 +209,7 @@ def codegen_main():
print_error('Using --body requires --output')
c_file = args.output
- header_name = os.path.splitext(c_file)[0] + '.h'
+ header_name = os.path.splitext(os.path.basename(c_file))[0] + '.h'
all_ifaces = []
for fname in args.files + args.xml_files:

View File

@ -1,136 +0,0 @@
From d26b66e225d3f0d308b2ec1a862a505709076bf7 Mon Sep 17 00:00:00 2001
From: Arnaud Rebillout <elboulangero@gmail.com>
Date: Sun, 10 Jun 2018 20:56:12 +0700
Subject: [PATCH] gfdonotificationbackend: Fix possible invalid pointer in dbus
callback
The way things were before: a FreedesktopNotification struct is
allocated before the dbus call, and this same struct is possibly re-used
for other dbus calls. If the server becomes unavailable, the callback
will be invoked after the call times out, which leaves a long time where
other dbus calls can happen, re-using the same FreedesktopNotification
as user data. When the first call times out, the callback is invoked,
and the user data is freed. Subsequent calls that used the same user
data will time out later on, and try to free a pointer that was already
freed, hence segfaults.
This bug can be reproduced in Cinnamon 3.6.7, as mentioned in:
<https://github.com/linuxmint/Cinnamon/issues/7491>
This commit fixes that by always allocating a new
FreedesktopNotification before invoking dbus_call(), ensuring that the
callback always have a valid user data.
Signed-off-by: Arnaud Rebillout <elboulangero@gmail.com>
---
gio/gfdonotificationbackend.c | 55 ++++++++++++++++++++++++++-----------------
1 file changed, 34 insertions(+), 21 deletions(-)
diff --git a/gio/gfdonotificationbackend.c b/gio/gfdonotificationbackend.c
index a0d4814335be..ab5329497d1e 100644
--- a/gio/gfdonotificationbackend.c
+++ b/gio/gfdonotificationbackend.c
@@ -62,7 +62,6 @@ typedef struct
GVariant *default_action_target;
} FreedesktopNotification;
-
static void
freedesktop_notification_free (gpointer data)
{
@@ -76,6 +75,24 @@ freedesktop_notification_free (gpointer data)
g_slice_free (FreedesktopNotification, n);
}
+static FreedesktopNotification *
+freedesktop_notification_new (GFdoNotificationBackend *backend,
+ const gchar *id,
+ GNotification *notification)
+{
+ FreedesktopNotification *n;
+
+ n = g_slice_new0 (FreedesktopNotification);
+ n->backend = backend;
+ n->id = g_strdup (id);
+ n->notify_id = 0;
+ g_notification_get_default_action (notification,
+ &n->default_action,
+ &n->default_action_target);
+
+ return n;
+}
+
static FreedesktopNotification *
g_fdo_notification_backend_find_notification (GFdoNotificationBackend *backend,
const gchar *id)
@@ -319,8 +336,19 @@ notification_sent (GObject *source_object,
val = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source_object), result, &error);
if (val)
{
+ GFdoNotificationBackend *backend = n->backend;
+ FreedesktopNotification *match;
+
g_variant_get (val, "(u)", &n->notify_id);
g_variant_unref (val);
+
+ match = g_fdo_notification_backend_find_notification_by_notify_id (backend, n->notify_id);
+ if (match != NULL)
+ {
+ backend->notifications = g_slist_remove (backend->notifications, match);
+ freedesktop_notification_free (match);
+ }
+ backend->notifications = g_slist_prepend (backend->notifications, n);
}
else
{
@@ -331,9 +359,7 @@ notification_sent (GObject *source_object,
warning_printed = TRUE;
}
- n->backend->notifications = g_slist_remove (n->backend->notifications, n);
freedesktop_notification_free (n);
-
g_error_free (error);
}
}
@@ -378,7 +404,7 @@ g_fdo_notification_backend_send_notification (GNotificationBackend *backend,
GNotification *notification)
{
GFdoNotificationBackend *self = G_FDO_NOTIFICATION_BACKEND (backend);
- FreedesktopNotification *n;
+ FreedesktopNotification *n, *tmp;
if (self->notify_subscription == 0)
{
@@ -391,24 +417,11 @@ g_fdo_notification_backend_send_notification (GNotificationBackend *backend,
notify_signal, backend, NULL);
}
- n = g_fdo_notification_backend_find_notification (self, id);
- if (n == NULL)
- {
- n = g_slice_new0 (FreedesktopNotification);
- n->backend = self;
- n->id = g_strdup (id);
- n->notify_id = 0;
-
- n->backend->notifications = g_slist_prepend (n->backend->notifications, n);
- }
- else
- {
- /* Only clear default action. All other fields are still valid */
- g_clear_pointer (&n->default_action, g_free);
- g_clear_pointer (&n->default_action_target, g_variant_unref);
- }
+ n = freedesktop_notification_new (self, id, notification);
- g_notification_get_default_action (notification, &n->default_action, &n->default_action_target);
+ tmp = g_fdo_notification_backend_find_notification (self, id);
+ if (tmp)
+ n->notify_id = tmp->notify_id;
call_notify (backend->dbus_connection, backend->application, n->notify_id, notification, notification_sent, n);
}
--
2.14.4

View File

@ -1,33 +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.56.1
Release: 4%{?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.56/glib-%{version}.tar.xz
Source0: http://download.gnome.org/sources/glib/2.67/glib-%{version}.tar.xz
# Include upstream patch to fix gdbus-codegen when used with meson 0.46
# https://gitlab.gnome.org/GNOME/glib/commit/cd1f82d8fc741a2203582c12cc21b4dacf7e1872
Patch0: glib2-fix-gdbus-codegen.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/90
# https://gitlab.gnome.org/GNOME/glib/merge_requests/102
# https://bugzilla.redhat.com/show_bug.cgi?id=1584916
Patch1: glib2-gfdonotificationbackend-fix-possible-invalid-pointer.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: 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)
@ -35,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,
@ -73,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
@ -94,38 +100,47 @@ the functionality of the installed glib2 package.
%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_build
# 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
%make_install
# 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
touch -r gio/gdbus-2.0/codegen/config.py.in $RPM_BUILD_ROOT/%{_datadir}/glib-2.0/codegen/codegen_main.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}
mv $RPM_BUILD_ROOT%{_bindir}/gio-querymodules $RPM_BUILD_ROOT%{_bindir}/gio-querymodules-%{__isa_bits}
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
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
@ -151,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
@ -212,24 +228,218 @@ 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 (RH #1581067)
- 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.

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.56.1.tar.xz) = 7e96cc23f3fa42a41b1974ae8fa2a7b123449643f265763d464620afcb011668e2de013ed2a6e5f13b6bd1bf3ab8eab43c05bf4a8ee0d99b7808767ab4fa69f4
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