mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
Use dbus_g_proxy_new_from_proxy
Removes the need to have the dbus connection around.
This commit is contained in:
committed by
Daniel Drake
parent
b225947a56
commit
6fc861a154
@ -324,7 +324,7 @@ static gboolean verify_timeout_cb (gpointer user_data)
|
|||||||
return FALSE;
|
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;
|
GError *error = NULL;
|
||||||
GHashTable *props;
|
GHashTable *props;
|
||||||
@ -338,9 +338,7 @@ static int do_verify(DBusGConnection *connection, GMainLoop *loop, pam_handle_t
|
|||||||
data->loop = loop;
|
data->loop = loop;
|
||||||
|
|
||||||
/* Get some properties for the device */
|
/* Get some properties for the device */
|
||||||
p = dbus_g_proxy_new_for_name(connection,
|
p = dbus_g_proxy_new_from_proxy (dev, "org.freedesktop.DBus.Properties", NULL);
|
||||||
"net.reactivated.Fprint", dbus_g_proxy_get_path (dev),
|
|
||||||
"org.freedesktop.DBus.Properties");
|
|
||||||
|
|
||||||
if (dbus_g_proxy_call (p, "GetAll", NULL, G_TYPE_STRING, "net.reactivated.Fprint.Device", G_TYPE_INVALID,
|
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)) {
|
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);
|
g_object_unref (manager);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return PAM_AUTHINFO_UNAVAIL;
|
return PAM_AUTHINFO_UNAVAIL;
|
||||||
ret = do_verify(connection, loop, pamh, dev);
|
ret = do_verify(loop, pamh, dev);
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
release_device(pamh, dev);
|
release_device(pamh, dev);
|
||||||
g_object_unref (dev);
|
g_object_unref (dev);
|
||||||
|
|||||||
@ -55,9 +55,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = dbus_g_proxy_new_for_name(connection,
|
p = dbus_g_proxy_new_from_proxy(dev, "org.freedesktop.DBus.Properties", NULL);
|
||||||
"net.reactivated.Fprint", dbus_g_proxy_get_path (dev),
|
|
||||||
"org.freedesktop.DBus.Properties");
|
|
||||||
if (!dbus_g_proxy_call (p, "GetAll", &error, G_TYPE_STRING, "net.reactivated.Fprint.Device", G_TYPE_INVALID,
|
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))
|
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);
|
g_error("GetAll on the Properties interface failed: %s", error->message);
|
||||||
|
|||||||
Reference in New Issue
Block a user