Commit 6fc861a1 authored by Bastien Nocera's avatar Bastien Nocera Committed by Daniel Drake

Use dbus_g_proxy_new_from_proxy

Removes the need to have the dbus connection around.
parent b225947a
......@@ -324,7 +324,7 @@ static gboolean verify_timeout_cb (gpointer user_data)
return FALSE;
}
static int do_verify(DBusGConnection *connection, GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev)
static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev)
{
GError *error = NULL;
GHashTable *props;
......@@ -338,9 +338,7 @@ static int do_verify(DBusGConnection *connection, GMainLoop *loop, pam_handle_t
data->loop = loop;
/* Get some properties for the device */
p = dbus_g_proxy_new_for_name(connection,
"net.reactivated.Fprint", dbus_g_proxy_get_path (dev),
"org.freedesktop.DBus.Properties");
p = dbus_g_proxy_new_from_proxy (dev, "org.freedesktop.DBus.Properties", NULL);
if (dbus_g_proxy_call (p, "GetAll", NULL, G_TYPE_STRING, "net.reactivated.Fprint.Device", G_TYPE_INVALID,
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &props, G_TYPE_INVALID)) {
......@@ -451,7 +449,7 @@ static int do_auth(pam_handle_t *pamh, const char *username)
g_object_unref (manager);
if (!dev)
return PAM_AUTHINFO_UNAVAIL;
ret = do_verify(connection, loop, pamh, dev);
ret = do_verify(loop, pamh, dev);
g_main_loop_unref (loop);
release_device(pamh, dev);
g_object_unref (dev);
......
......@@ -55,9 +55,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
return;
}
p = dbus_g_proxy_new_for_name(connection,
"net.reactivated.Fprint", dbus_g_proxy_get_path (dev),
"org.freedesktop.DBus.Properties");
p = dbus_g_proxy_new_from_proxy(dev, "org.freedesktop.DBus.Properties", NULL);
if (!dbus_g_proxy_call (p, "GetAll", &error, G_TYPE_STRING, "net.reactivated.Fprint.Device", G_TYPE_INVALID,
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &props, G_TYPE_INVALID))
g_error("GetAll on the Properties interface failed: %s", error->message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment