mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
Add device name property
Add GetProperties method, with a single "Name" properties into the hashtable. Use the device name property in the PAM module, and in the list test.
This commit is contained in:
committed by
Daniel Drake
parent
69c131f723
commit
924e08d2e8
@ -119,6 +119,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GArray *fingers;
|
||||
GHashTable *props;
|
||||
guint i;
|
||||
int fingernum;
|
||||
|
||||
@ -130,7 +131,10 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
|
||||
return;
|
||||
}
|
||||
|
||||
g_print("Fingerprints for user %s:\n", username);
|
||||
if (!net_reactivated_Fprint_Device_get_properties(dev, &props, &error))
|
||||
g_error("GetProperties failed: %s", error->message);
|
||||
|
||||
g_print("Fingerprints for user %s on %s:\n", username, (char *) g_hash_table_lookup (props, "Name"));
|
||||
for (i = 0; i < fingers->len; i++) {
|
||||
fingernum = g_array_index(fingers, guint32, i);
|
||||
g_print(" - #%d: %s\n", fingernum, fingerstr(fingernum));
|
||||
@ -138,6 +142,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
|
||||
|
||||
fingernum = g_array_index(fingers, guint32, 0);
|
||||
g_array_free(fingers, TRUE);
|
||||
g_hash_table_destroy (props);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
||||
Reference in New Issue
Block a user