mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
Don't hardcode username
We use the current user's username instead.
This commit is contained in:
committed by
Daniel Drake
parent
7f592dd2e4
commit
54583f4750
@ -146,7 +146,7 @@ static DBusGProxy *open_device(void)
|
|||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint32 find_finger(DBusGProxy *dev)
|
static guint32 find_finger(DBusGProxy *dev, const char *username)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GArray *fingers;
|
GArray *fingers;
|
||||||
@ -154,7 +154,7 @@ static guint32 find_finger(DBusGProxy *dev)
|
|||||||
int fingernum;
|
int fingernum;
|
||||||
guint32 print_id;
|
guint32 print_id;
|
||||||
|
|
||||||
if (!net_reactivated_Fprint_Device_list_enrolled_fingers_from_storage(dev, "anarsoul", &fingers, &error))
|
if (!net_reactivated_Fprint_Device_list_enrolled_fingers_from_storage(dev, username, &fingers, &error))
|
||||||
g_error("ListEnrolledFingers failed: %s", error->message);
|
g_error("ListEnrolledFingers failed: %s", error->message);
|
||||||
|
|
||||||
if (fingers->len == 0) {
|
if (fingers->len == 0) {
|
||||||
@ -226,13 +226,16 @@ int main(int argc, char **argv)
|
|||||||
GMainLoop *loop;
|
GMainLoop *loop;
|
||||||
DBusGProxy *dev;
|
DBusGProxy *dev;
|
||||||
guint32 print_id;
|
guint32 print_id;
|
||||||
|
const char *username;
|
||||||
|
|
||||||
g_type_init();
|
g_type_init();
|
||||||
loop = g_main_loop_new(NULL, FALSE);
|
loop = g_main_loop_new(NULL, FALSE);
|
||||||
create_manager();
|
create_manager();
|
||||||
|
|
||||||
|
username = g_get_user_name ();
|
||||||
|
|
||||||
dev = open_device();
|
dev = open_device();
|
||||||
print_id = find_finger(dev);
|
print_id = find_finger(dev, username);
|
||||||
do_verify(dev, print_id);
|
do_verify(dev, print_id);
|
||||||
unload_print(dev, print_id);
|
unload_print(dev, print_id);
|
||||||
release_device(dev);
|
release_device(dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user