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-16 14:55:23 +0200
commitd5b7da193b99a8826027de7b961032091b48fa87 (patch)
tree7ed883e74e44b65726e8393c0d1931b159416487 /src/polkitmatelistener.c
parent20283f67a2d045f206d509853aeb0553682db58f (diff)
downloadmate-polkit-d5b7da193b99a8826027de7b961032091b48fa87.tar.bz2
mate-polkit-d5b7da193b99a8826027de7b961032091b48fa87.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);