summaryrefslogtreecommitdiff
path: root/src/polkitmatelistener.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-09-12 12:03:15 +0200
committerinfirit <[email protected]>2015-09-12 12:03:15 +0200
commitb06d4ae63fc95f50870510ca0acbaf049ba6dbb2 (patch)
treeddb78b27eba1719843015ee5adafc57a9a008315 /src/polkitmatelistener.c
parent0160a96e5630d84b92e3e87fc072d3558b03baab (diff)
downloadmate-polkit-b06d4ae63fc95f50870510ca0acbaf049ba6dbb2.tar.bz2
mate-polkit-b06d4ae63fc95f50870510ca0acbaf049ba6dbb2.tar.xz
Return error when authentication dialog is dismissed
This allows PolicyKit applications to disambiguate between when the authentication dialog is dismissed versus when authentication fails (e.g. the wrong password has been entered). From polkit-gnome, commit: 2511afae6b72fe3b4714d07ab6373c93c2923a5e From: David Zeuthen <[email protected]> Gnome bug: https://bugs.freedesktop.org/show_bug.cgi?id=30653
Diffstat (limited to 'src/polkitmatelistener.c')
-rw-r--r--src/polkitmatelistener.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/polkitmatelistener.c b/src/polkitmatelistener.c
index 1b7c486..926fccd 100644
--- a/src/polkitmatelistener.c
+++ b/src/polkitmatelistener.c
@@ -23,6 +23,7 @@
#include "config.h"
#include <string.h>
+#include <glib/gi18n.h>
#include "polkitmatelistener.h"
#include "polkitmateauthenticator.h"
@@ -153,8 +154,9 @@ maybe_initiate_next_authenticator (PolkitMateListener *listener)
static void
authenticator_completed (PolkitMateAuthenticator *authenticator,
- gboolean gained_authorization,
- gpointer user_data)
+ gboolean gained_authorization,
+ gboolean dismissed,
+ gpointer user_data)
{
AuthData *data = user_data;
@@ -164,6 +166,14 @@ authenticator_completed (PolkitMateAuthenticator *authenticator,
g_object_unref (authenticator);
+ if (dismissed)
+ {
+ g_simple_async_result_set_error (data->simple,
+ POLKIT_ERROR,
+ POLKIT_ERROR_CANCELLED,
+ _("Authentication dialog was dismissed by the user"));
+ }
+
g_simple_async_result_complete (data->simple);
g_object_unref (data->simple);