aboutsummaryrefslogtreecommitdiff
path: root/src/mm-auth-request-polkit.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-20 13:13:55 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:28:15 +0100
commit5f167fd199ce7cc359aa1d884df9b332aa669a79 (patch)
tree54d51e3e67877eb198356652e52511d4209a461e /src/mm-auth-request-polkit.c
parent080d046e643a203b7f37c464e38108f6083943ed (diff)
Revert "core: avoid using DBusGMethodInvocation in auth API"
This reverts commit 013fd179f458d87bba9fd7657ffe1bd90169f231. We will start using GDBus-only based code from now on.
Diffstat (limited to 'src/mm-auth-request-polkit.c')
-rw-r--r--src/mm-auth-request-polkit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mm-auth-request-polkit.c b/src/mm-auth-request-polkit.c
index 4e7a07ca..2a96bfec 100644
--- a/src/mm-auth-request-polkit.c
+++ b/src/mm-auth-request-polkit.c
@@ -34,14 +34,14 @@ GObject *
mm_auth_request_polkit_new (PolkitAuthority *authority,
const char *authorization,
GObject *owner,
- gpointer context,
- const gchar *sender,
+ DBusGMethodInvocation *context,
MMAuthRequestCb callback,
gpointer callback_data,
GDestroyNotify notify)
{
GObject *obj;
MMAuthRequestPolkitPrivate *priv;
+ char *sender;
g_return_val_if_fail (authorization != NULL, NULL);
g_return_val_if_fail (owner != NULL, NULL);
@@ -59,7 +59,10 @@ mm_auth_request_polkit_new (PolkitAuthority *authority,
priv = MM_AUTH_REQUEST_POLKIT_GET_PRIVATE (obj);
priv->authority = authority;
priv->cancellable = g_cancellable_new ();
+
+ sender = dbus_g_method_get_sender (context);
priv->subject = polkit_system_bus_name_new (sender);
+ g_free (sender);
}
return obj;
@@ -98,7 +101,7 @@ pk_auth_cb (GObject *object, GAsyncResult *result, gpointer user_data)
g_signal_emit_by_name (self, "result");
}
-
+
g_object_unref (self);
}