Backport PR #505 to fix offline upgrading (#2002609)

This commit is contained in:
Adam Williamson 2021-09-10 12:53:01 -07:00
parent 0df35cb490
commit bff78d3abf
2 changed files with 66 additions and 1 deletions

56
505.patch Normal file
View File

@ -0,0 +1,56 @@
From 7c819714639fed3819b7f5b8ea3edd842e425feb Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Fri, 10 Sep 2021 09:53:14 +0200
Subject: [PATCH] pk-engine: Always allow user interaction for offline
update/upgrade
This partly reverts commit 9b7e083cf849c4ed4d66fe32250f1615ab577d94.
The offline update/upgrade triggers do need the user interaction, to
get the credentials from the polkit, otherwise the trigger cannot
do its job.
Closes https://github.com/PackageKit/PackageKit/issues/504
---
src/pk-engine.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/pk-engine.c b/src/pk-engine.c
index f4fe2805e..a8e9fef14 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1616,7 +1616,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.trigger-offline-update",
NULL,
- get_polkit_flags_for_dbus_invocation (invocation),
+ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
NULL,
pk_engine_offline_helper_cb,
helper);
@@ -1630,7 +1630,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.clear-offline-update",
NULL,
- get_polkit_flags_for_dbus_invocation (invocation),
+ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
NULL,
pk_engine_offline_helper_cb,
helper);
@@ -1657,7 +1657,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.trigger-offline-update",
NULL,
- get_polkit_flags_for_dbus_invocation (invocation),
+ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
NULL,
pk_engine_offline_helper_cb,
helper);
@@ -1684,7 +1684,7 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
polkit_authority_check_authorization (engine->priv->authority, subject,
"org.freedesktop.packagekit.trigger-offline-upgrade",
NULL,
- get_polkit_flags_for_dbus_invocation (invocation),
+ POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
NULL,
pk_engine_offline_helper_cb,
helper);

View File

@ -6,7 +6,7 @@
Summary: Package management service
Name: PackageKit
Version: 1.2.4
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+ and LGPLv2+
URL: http://www.freedesktop.org/software/PackageKit/
Source0: http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{version}.tar.xz
@ -21,6 +21,12 @@ Patch0: PackageKit-0.3.8-RHEL-Vendor.conf.patch
# https://github.com/PackageKit/PackageKit/pull/404
Patch1: package-remove-password-prompt.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2002609
# https://github.com/PackageKit/PackageKit/pull/505
# This patch will likely not be merged as-is, but we agreed it is fine
# as a downstream backport to address the bug urgently
Patch2: 505.patch
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: xmlto
BuildRequires: gtk-doc
@ -238,6 +244,9 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%{_datadir}/vala/vapi/packagekit-glib2.deps
%changelog
* Fri Sep 10 2021 Adam Williamson <awilliam@redhat.com> - 1.2.4-2
- Backport PR #505 to fix offline upgrading (#2002609)
* Fri Jul 30 2021 Richard Hughes <rhughes@redhat.com> - 1.2.4-1
- New upstream release
- Add specific error code when user declined interaction