mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
Fix screensaver unlock for some users
pam_fprintd is very careful to use its own main loop context (as it should) to prevent getting in the way of the gnome-screensaver. Unfortunately, there's a small bug in its logic where it ends up removing a random file descriptor from the default context. In the bug report that file descriptor is really important. It's what tells gnome-screensaver when to drop the dialog. The patch is as simple as: - g_source_remove (timeout_id); + g_source_destroy (source); (g_source_remove always operates on the default context) https://bugzilla.redhat.com/show_bug.cgi?id=614573
This commit is contained in:
committed by
Bastien Nocera
parent
4f30f39699
commit
7544102f2e
@ -298,11 +298,10 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev)
|
||||
|
||||
while (ret == PAM_AUTH_ERR && data->max_tries > 0) {
|
||||
GSource *source;
|
||||
guint timeout_id;
|
||||
|
||||
/* Set up the timeout on our non-default context */
|
||||
source = g_timeout_source_new_seconds (TIMEOUT);
|
||||
timeout_id = g_source_attach (source, g_main_loop_get_context (loop));
|
||||
g_source_attach (source, g_main_loop_get_context (loop));
|
||||
g_source_set_callback (source, verify_timeout_cb, data, NULL);
|
||||
|
||||
data->timed_out = FALSE;
|
||||
@ -311,14 +310,14 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev)
|
||||
D(pamh, "VerifyStart failed: %s", error->message);
|
||||
g_error_free (error);
|
||||
|
||||
g_source_remove (timeout_id);
|
||||
g_source_destroy (source);
|
||||
g_source_unref (source);
|
||||
break;
|
||||
}
|
||||
|
||||
g_main_loop_run (loop);
|
||||
|
||||
g_source_remove (timeout_id);
|
||||
g_source_destroy (source);
|
||||
g_source_unref (source);
|
||||
|
||||
/* Ignore errors from VerifyStop */
|
||||
|
||||
Reference in New Issue
Block a user