AlmaLinux changes

This commit is contained in:
Andrew Lukoshko 2021-09-14 09:28:50 +00:00
parent 0217cb9dcf
commit 7d6ca5db1d
2 changed files with 106 additions and 16 deletions

View File

@ -0,0 +1,88 @@
From 0f61c017f2d0c8a11b12abec774aa94d45ec8116 Mon Sep 17 00:00:00 2001
From: Daniil Leonov <dleonov@cloudlinux.com>
Date: Tue, 9 Feb 2021 15:17:59 +0300
Subject: [PATCH] Add GPG subkeys support.
---
src/daemon/rpm.c | 46 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/src/daemon/rpm.c b/src/daemon/rpm.c
index af9a7be..c28c047 100644
--- a/src/daemon/rpm.c
+++ b/src/daemon/rpm.c
@@ -24,6 +24,19 @@
#include <rpm/rpmcli.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmpgp.h>
+#include <rpm/rpmkeyring.h>
+
+struct rpmPubkey_s {
+ uint8_t *pkt;
+ size_t pktlen;
+ pgpKeyID_t keyid;
+ pgpDigParams pgpkey;
+ int nrefs;
+ pthread_rwlock_t lock;
+};
+
+typedef struct rpmPubkey_s * rpmPubkey;
+
#endif
/**
@@ -93,8 +106,13 @@ void rpm_destroy()
void rpm_load_gpgkey(const char* filename)
{
#ifdef HAVE_LIBRPM
+ rpmPubkey pubkey = NULL;
+ rpmPubkey *subkeys = NULL;
+ char *fingerprint = NULL;
+ int subkeysCount = 0;
uint8_t *pkt = NULL;
- size_t pklen;
+ size_t pklen = 0;
+
if (pgpReadPkts(filename, &pkt, &pklen) != PGPARMOR_PUBKEY)
{
free(pkt);
@@ -102,17 +120,29 @@ void rpm_load_gpgkey(const char* filename)
return;
}
- uint8_t keyID[8];
-#if 0
- if (pgpPubkeyFingerprint(pkt, pklen, keyID) == 0)
-#else
- if (pgpPubkeyKeyID(pkt, pklen, keyID) == 0)
-#endif
+ pubkey = rpmPubkeyNew(pkt, pklen);
+ if (pubkey != NULL)
{
- char *fingerprint = pgpHexStr(keyID, sizeof(keyID));
+ fingerprint = pgpHexStr(pubkey->keyid, sizeof(pubkey->keyid));
if (fingerprint != NULL)
list_fingerprints = g_list_append(list_fingerprints, fingerprint);
+
+ subkeys = rpmGetSubkeys(pubkey, &subkeysCount);
+ for (int i = 0; i < subkeysCount; i++)
+ {
+ rpmPubkey subkey = subkeys[i];
+ if (subkey != NULL)
+ {
+ fingerprint = pgpHexStr(subkey->keyid, sizeof(subkey->keyid));
+ if (fingerprint != NULL)
+ list_fingerprints = g_list_append(list_fingerprints, fingerprint);
+ }
+ rpmPubkeyFree(subkey);
+ }
+ free(subkeys);
}
+
+ rpmPubkeyFree(pubkey);
free(pkt);
#else
return;
--
2.25.1

View File

@ -55,7 +55,7 @@
Summary: Automatic bug detection and reporting tool Summary: Automatic bug detection and reporting tool
Name: abrt Name: abrt
Version: 2.10.9 Version: 2.10.9
Release: 20%{?dist} Release: 20%{?dist}.alma.1
License: GPLv2+ License: GPLv2+
URL: https://abrt.readthedocs.org/ URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
@ -88,9 +88,9 @@ Patch0009: 0009-lib-Correct-the-syntax-for-gdb-backtrace-command.patch
Patch0024: 0024-dbus-Add-configuration-for-Python3.patch Patch0024: 0024-dbus-Add-configuration-for-Python3.patch
Patch0025: 0025-daemon-Fix-double-closed-fd-race-condition.patch Patch0025: 0025-daemon-Fix-double-closed-fd-race-condition.patch
#git format-patch 1725bd258 -N --start-number 26 --topo-order #git format-patch 1725bd258 -N --start-number 26 --topo-order
Patch0026: 0026-cli-list-show-a-hint-about-creating-a-case-in-RHTS.patch #Patch0026: 0026-cli-list-show-a-hint-about-creating-a-case-in-RHTS.patch
Patch0027: 0027-cli-mark-the-suggestion-text-for-translation.patch #Patch0027: 0027-cli-mark-the-suggestion-text-for-translation.patch
Patch0028: 0028-cli-get-list-of-possible-workflows-for-problem_data_.patch #Patch0028: 0028-cli-get-list-of-possible-workflows-for-problem_data_.patch
#Patch0029: 0029-spec-Add-explicit-package-version-requirement-of-abr.patch #Patch0029: 0029-spec-Add-explicit-package-version-requirement-of-abr.patch
#git format-patch 2.10.9-10.el8 -N --start-number 30 --topo-order #git format-patch 2.10.9-10.el8 -N --start-number 30 --topo-order
#Patch030: 0030-testsuite-dbus-element-handling-Use-external-script.patch #Patch030: 0030-testsuite-dbus-element-handling-Use-external-script.patch
@ -161,6 +161,9 @@ Patch0087: 0087-plugins-abrt-action-install-debuginfo-Fix-reference.patch
# autogen.sh is need to regenerate all the Makefile files # autogen.sh is need to regenerate all the Makefile files
Patch1000: 1000-Add-autogen.sh.patch Patch1000: 1000-Add-autogen.sh.patch
# AlmaLinux: add support for GPG subkeys
Patch9100: 9100-add_gpg_subkeys_support.patch
BuildRequires: %{dbus_devel} BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel BuildRequires: gtk3-devel
BuildRequires: glib2-devel >= 2.43 BuildRequires: glib2-devel >= 2.43
@ -222,9 +225,6 @@ Requires: python3-dbus
Requires: dmidecode Requires: dmidecode
%endif %endif
Requires: libreport-plugin-ureport Requires: libreport-plugin-ureport
%if 0%{?rhel}
Requires: libreport-plugin-rhtsupport
%endif
%if 0%{?fedora} %if 0%{?fedora}
Requires: libreport-plugin-systemd-journal Requires: libreport-plugin-systemd-journal
%endif %endif
@ -533,10 +533,7 @@ Requires: python2-abrt-addon
Requires: python3-abrt-addon Requires: python3-abrt-addon
%endif # with python3 %endif # with python3
Requires: abrt-addon-xorg Requires: abrt-addon-xorg
%if 0%{?rhel} %if 0%{!?rhel}
Requires: libreport-rhel >= %{libreport_ver}
Requires: libreport-plugin-rhtsupport >= %{libreport_ver}
%else
Requires: abrt-retrace-client Requires: abrt-retrace-client
%if %{with bodhi} %if %{with bodhi}
Requires: abrt-plugin-bodhi Requires: abrt-plugin-bodhi
@ -577,10 +574,7 @@ Requires: abrt-addon-xorg
Requires: gdb-headless Requires: gdb-headless
Requires: abrt-gui Requires: abrt-gui
Requires: gnome-abrt Requires: gnome-abrt
%if 0%{?rhel} %if 0%{!?rhel}
Requires: libreport-rhel >= %{libreport_ver}
Requires: libreport-plugin-rhtsupport >= %{libreport_ver}
%else
Requires: abrt-retrace-client Requires: abrt-retrace-client
%if %{with bodhi} %if %{with bodhi}
Requires: abrt-plugin-bodhi Requires: abrt-plugin-bodhi
@ -730,7 +724,6 @@ CFLAGS="%{optflags} -Werror" %configure \
%endif %endif
%if 0%{?rhel} %if 0%{?rhel}
--enable-suggest-autoreporting \ --enable-suggest-autoreporting \
--enable-authenticated-autoreporting \
%endif %endif
%ifnarch %{arm} %ifnarch %{arm}
--enable-native-unwinder \ --enable-native-unwinder \
@ -1375,6 +1368,12 @@ killall abrt-dbus >/dev/null 2>&1 || :
%config(noreplace) %{_sysconfdir}/profile.d/abrt-console-notification.sh %config(noreplace) %{_sysconfdir}/profile.d/abrt-console-notification.sh
%changelog %changelog
* Tue Feb 09 2021 - Andrei Lukoshko <alukoshko@cloudlinux.com> - 2.10.9-20.alma.1
- Add support for GPG subkeys
* Wed Jan 27 2021 - Anatholy Scryabin <ascryabin@cloudlinux.com> - 2.10.9-20.alma
- Disable rhtsupport
* Wed Aug 19 2020 - Ernestas Kulik <ekulik@redhat.com> - 2.10.9-20 * Wed Aug 19 2020 - Ernestas Kulik <ekulik@redhat.com> - 2.10.9-20
- Something something patch for rhbz#1835388 - Something something patch for rhbz#1835388
@ -1409,6 +1408,9 @@ killall abrt-dbus >/dev/null 2>&1 || :
* Wed Mar 11 2020 Ernestas Kulik <ekulik@redhat.com> - 2.10.9-12 * Wed Mar 11 2020 Ernestas Kulik <ekulik@redhat.com> - 2.10.9-12
- Fix #1798494, #1805728, #1809949 - Fix #1798494, #1805728, #1809949
* Mon Dec 23 2019 Sergey Fokin <sfokin@cloudlinux.com> - 2.10.9-11.cloudlinux
- apply debranding
* Tue Jul 16 2019 Michal Fabik <mfabik@redhat.com> - 2.10.9-11 * Tue Jul 16 2019 Michal Fabik <mfabik@redhat.com> - 2.10.9-11
- a-a-list-dsos: Fix decoding of strings from rpm - a-a-list-dsos: Fix decoding of strings from rpm
Resolves: rhbz#1694970 Resolves: rhbz#1694970