Blame SOURCES/0001-Do-not-set-JUST_REINSTALL-on-any-kind-of-auth-failur.patch

ae9e7b
From bb9f9a8fb451d7a2d81f7390993db75491224729 Mon Sep 17 00:00:00 2001
ae9e7b
From: Richard Hughes <richard@hughsie.com>
ae9e7b
Date: Mon, 9 Apr 2018 16:39:56 +0100
ae9e7b
Subject: [PATCH] Do not set JUST_REINSTALL on any kind of auth failure
ae9e7b
ae9e7b
If we try to continue the auth queue when it has been cancelled (or failed)
ae9e7b
then we fall upon the obscure JUST_REINSTALL transaction flag which only the
ae9e7b
DNF backend actually verifies.
ae9e7b
ae9e7b
Many thanks to Matthias Gerstner <mgerstner@suse.de> for spotting the problem.
ae9e7b
---
ae9e7b
 src/pk-transaction.c | 27 ++++++++-------------------
ae9e7b
 1 file changed, 8 insertions(+), 19 deletions(-)
ae9e7b
ae9e7b
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
ae9e7b
index 1d006c782..ffee29f6f 100644
ae9e7b
--- a/src/pk-transaction.c
ae9e7b
+++ b/src/pk-transaction.c
ae9e7b
@@ -2351,25 +2351,14 @@ pk_transaction_authorize_actions_finished_cb (GObject *source_object,
ae9e7b
 
ae9e7b
 	/* did not auth */
ae9e7b
 	if (!polkit_authorization_result_get_is_authorized (result)) {
ae9e7b
-		if (g_strcmp0 (action_id, "org.freedesktop.packagekit.package-install") == 0 &&
ae9e7b
-			       pk_bitfield_contain (priv->cached_transaction_flags,
ae9e7b
-						    PK_TRANSACTION_FLAG_ENUM_ALLOW_REINSTALL)) {
ae9e7b
-			g_debug ("allowing just reinstallation");
ae9e7b
-			pk_bitfield_add (priv->cached_transaction_flags,
ae9e7b
-					 PK_TRANSACTION_FLAG_ENUM_JUST_REINSTALL);
ae9e7b
-		} else {
ae9e7b
-			priv->waiting_for_auth = FALSE;
ae9e7b
-			/* emit an ::StatusChanged, ::ErrorCode() and then ::Finished() */
ae9e7b
-			pk_transaction_status_changed_emit (data->transaction, PK_STATUS_ENUM_FINISHED);
ae9e7b
-			pk_transaction_error_code_emit (data->transaction, PK_ERROR_ENUM_NOT_AUTHORIZED,
ae9e7b
-							"Failed to obtain authentication.");
ae9e7b
-			pk_transaction_finished_emit (data->transaction, PK_EXIT_ENUM_FAILED, 0);
ae9e7b
-
ae9e7b
-			syslog (LOG_AUTH | LOG_NOTICE,
ae9e7b
-				"uid %i failed to obtain auth",
ae9e7b
-				priv->uid);
ae9e7b
-			goto out;
ae9e7b
-		}
ae9e7b
+		priv->waiting_for_auth = FALSE;
ae9e7b
+		/* emit an ::StatusChanged, ::ErrorCode() and then ::Finished() */
ae9e7b
+		pk_transaction_status_changed_emit (data->transaction, PK_STATUS_ENUM_FINISHED);
ae9e7b
+		pk_transaction_error_code_emit (data->transaction, PK_ERROR_ENUM_NOT_AUTHORIZED,
ae9e7b
+						"Failed to obtain authentication.");
ae9e7b
+		pk_transaction_finished_emit (data->transaction, PK_EXIT_ENUM_FAILED, 0);
ae9e7b
+		syslog (LOG_AUTH | LOG_NOTICE, "uid %i failed to obtain auth", priv->uid);
ae9e7b
+		goto out;
ae9e7b
 	}
ae9e7b
 
ae9e7b
 	if (data->actions->len <= 1) {
ae9e7b
-- 
ae9e7b
2.17.0
ae9e7b