mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
utils/verify: Terminate with EXIT_FAILURE when enrollment failed
This commit is contained in:
@ -134,6 +134,7 @@ struct VerifyState
|
|||||||
GError *error;
|
GError *error;
|
||||||
gboolean started;
|
gboolean started;
|
||||||
gboolean completed;
|
gboolean completed;
|
||||||
|
gboolean match;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -142,6 +143,8 @@ verify_result (GObject *object, const char *result, gboolean done, void *user_da
|
|||||||
struct VerifyState *verify_state = user_data;
|
struct VerifyState *verify_state = user_data;
|
||||||
|
|
||||||
g_print ("Verify result: %s (%s)\n", result, done ? "done" : "not done");
|
g_print ("Verify result: %s (%s)\n", result, done ? "done" : "not done");
|
||||||
|
verify_state->match = g_str_equal (result, "verify-match");
|
||||||
|
|
||||||
if (done != FALSE)
|
if (done != FALSE)
|
||||||
verify_state->completed = TRUE;
|
verify_state->completed = TRUE;
|
||||||
}
|
}
|
||||||
@ -195,7 +198,7 @@ proxy_signal_cb (GDBusProxy *proxy,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
do_verify (FprintDBusDevice *dev)
|
do_verify (FprintDBusDevice *dev)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
@ -243,6 +246,8 @@ do_verify (FprintDBusDevice *dev)
|
|||||||
g_print ("VerifyStop failed: %s\n", error->message);
|
g_print ("VerifyStop failed: %s\n", error->message);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return verify_state.match;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -270,6 +275,7 @@ main (int argc, char **argv)
|
|||||||
g_autoptr(GError) err = NULL;
|
g_autoptr(GError) err = NULL;
|
||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
const char *username = NULL;
|
const char *username = NULL;
|
||||||
|
gboolean match;
|
||||||
|
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
|
|
||||||
@ -300,7 +306,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
dev = open_device (username);
|
dev = open_device (username);
|
||||||
find_finger (dev, username);
|
find_finger (dev, username);
|
||||||
do_verify (dev);
|
match = do_verify (dev);
|
||||||
release_device (dev);
|
release_device (dev);
|
||||||
return 0;
|
return match ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user