From 087f290ff74e1d5564330d25f38564393aad7577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 28 Jun 2017 21:40:43 +0200 Subject: [PATCH] polkit-agent: Include subject PID in ::initiate It is not always clear what triggered a particular polkit request, so displaying more information to the user is desirable. Unfortunately the information provided by polkitd is rather sparse, and is usually limited to subject- and caller PID. Still that's better than nothing, so include the PID of the initiating process in the signal parameters. https://bugzilla.gnome.org/show_bug.cgi?id=688351 --- js/ui/components/polkitAgent.js | 2 +- src/shell-polkit-authentication-agent.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 7a0682c4b..58743e8a5 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -380,7 +380,7 @@ var AuthenticationAgent = new Lang.Class({ } }, - _onInitiate(nativeAgent, actionId, message, iconName, cookie, userNames) { + _onInitiate(nativeAgent, actionId, message, iconName, cookie, subjectPid, userNames) { // Don't pop up a dialog while locked if (Main.sessionMode.isLocked) { this._sessionUpdatedId = Main.sessionMode.connect('updated', () => { diff --git a/src/shell-polkit-authentication-agent.c b/src/shell-polkit-authentication-agent.c index 152c6e247..0ab8ca522 100644 --- a/src/shell-polkit-authentication-agent.c +++ b/src/shell-polkit-authentication-agent.c @@ -162,7 +162,8 @@ shell_polkit_authentication_agent_class_init (ShellPolkitAuthenticationAgentClas NULL, /* accumulator data */ NULL, /* marshaller */ G_TYPE_NONE, - 5, + 6, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, @@ -267,6 +268,7 @@ auth_request_initiate (AuthRequest *request) request->message, request->icon_name, request->cookie, + polkit_details_lookup (request->details, "polkit.subject-pid"), user_names); g_strfreev (user_names); }