diff options
Diffstat (limited to 'src/mm-auth-provider-polkit.c')
-rw-r--r-- | src/mm-auth-provider-polkit.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/mm-auth-provider-polkit.c b/src/mm-auth-provider-polkit.c index 2cd4a8ab..58550f5b 100644 --- a/src/mm-auth-provider-polkit.c +++ b/src/mm-auth-provider-polkit.c @@ -55,20 +55,33 @@ static MMAuthRequest * real_create_request (MMAuthProvider *provider, const char *authorization, GObject *owner, - DBusGMethodInvocation *context, + gpointer context, MMAuthRequestCb callback, gpointer callback_data, GDestroyNotify notify) { MMAuthProviderPolkitPrivate *priv = MM_AUTH_PROVIDER_POLKIT_GET_PRIVATE (provider); + MMAuthRequest *auth_request; + gchar *sender; - return (MMAuthRequest *) mm_auth_request_polkit_new (priv->authority, - authorization, - owner, - context, - callback, - callback_data, - notify); + /* Ugly temporary hack... */ + if (G_IS_DBUS_METHOD_INVOCATION (context)) { + sender = g_strdup (g_dbus_method_invocation_get_sender (context)); + } else { + sender = dbus_g_method_get_sender (context); + } + + auth_request = (MMAuthRequest *)mm_auth_request_polkit_new (priv->authority, + authorization, + owner, + context, + sender, + callback, + callback_data, + notify); + g_free (sender); + + return auth_request; } /*****************************************************************************/ |