Skip to content

Commit

Permalink
fix: pkexec fails with a GDBus.Error
Browse files Browse the repository at this point in the history
Backport from: polkit-org/polkit#423

Log:
  • Loading branch information
kamiyadm committed Nov 12, 2024
1 parent 7f1f65b commit 7bcff59
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
policykit-1 (123-3deepin6) unstable; urgency=medium

* fix: pkexec fails with GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed,
No session for cookie.
Backport from: https://github.com/polkit-org/polkit/pull/423

-- chenhuixing <[email protected]> Tue, 12 Nov 2024 17:28:38 +0800

policykit-1 (123-3deepin5) unstable; urgency=medium

* fix the problem that polkitd cannot translate properly
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From f93c7466039ea3403e0576928aeb620b806d0cce Mon Sep 17 00:00:00 2001
From: Jan Rybar <[email protected]>
Date: Fri, 9 Feb 2024 11:16:03 +0100
Subject: [PATCH 1/1] fix: pkexec fails with
"GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie"
(#423)

bug:https://gitlab.freedesktop.org/polkit/polkit/-/issues/17

Co-authored-by: huxd1532 <[email protected]>
---
src/polkitbackend/polkitbackendinteractiveauthority.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
index f4be303..9dab476 100644
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
@@ -2611,7 +2611,8 @@ polkit_backend_interactive_authority_register_authentication_agent (PolkitBacken
priv->agent_serial++;
agent = authentication_agent_new (priv->agent_serial,
subject,
- user_of_caller,
+ user_of_subject,/*fix pkexec fails with No session for cookie,
+ upstream issue:https://gitlab.freedesktop.org/polkit/polkit/issues/17*/
polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (caller)),
locale,
object_path,
--
2.20.1

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ deepin_018_fix_pkexec_wrong.patch
deepin_019_fix_change_deepin_auth_interface.patch
update-po.diff
deepin_020_fix_translate_error.patch
0001-fix-pkexec-fails-with-GDBus.Error-org.freedesktop.Po.patch

0 comments on commit 7bcff59

Please sign in to comment.