Bugzilla – Attachment 267710 Details for
Bug 441144
kdm freezes if fingerprintreader is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Mischa's patch, updated + changes required to fix bug 463557
pam_fp.patch (text/plain), 3.13 KB, created by
Timo Hoenig
on 2009-01-26 17:36:22 UTC
(
hide
)
Description:
Mischa's patch, updated + changes required to fix bug 463557
Filename:
MIME Type:
Creator:
Timo Hoenig
Created:
2009-01-26 17:36:22 UTC
Size:
3.13 KB
patch
obsolete
>--- src/pam_fp.c 2008-11-06 11:31:54.000000000 +0100 >+++ src/pam_fp.c 2009-01-26 19:30:49.000000000 +0100 >@@ -233,6 +233,7 @@ > pam_fp_log (pam_fp, LOG_NOTICE, "Aborting swipe (%s , %s).", driver_name, fstr); > goto out; > } >+ pam_fp_log (pam_fp, LOG_NOTICE, "Received swipe (%s, %s).", driver_name, fstr); > switch (ret) { > case FP_VERIFY_NO_MATCH: { > pam_fp_log (pam_fp, LOG_NOTICE, "%s: no match.", __FUNCTION__); >@@ -373,12 +374,34 @@ > return retval; > } > >+static void pam_fp_libfprint_deinit (pam_fp_s *pam_fp) >+{ >+ pam_fp_libfprint_s *fprint = &pam_fp->fprint; >+ if (fprint->data!=NULL) { >+ fp_print_data_free (fprint->data); >+ fprint->data = NULL; >+ } >+ if (fprint->dev!=NULL) { >+ fp_dev_close (fprint->dev); >+ fprint->dev = NULL; >+ } >+} >+ >+static void pam_fp_libfprint_reset (pam_fp_s *pam_fp) >+{ >+ pam_fp_libfprint_s *fprint = &pam_fp->fprint; >+ pam_fp_libfprint_deinit (pam_fp); >+ pam_fp_libfprint_init (pam_fp); >+ fp_dev_reset(fprint->dev); >+} >+ > static int pam_fp_libfprint_verify (pam_fp_s *pam_fp) > { > int ret = -1; > int retry = 0; > int reclaim = 0; > pam_fp_libfprint_s *fprint = &pam_fp->fprint; >+ int init_ret; > > while (retry++ <= FP_RETRY_MAX) { > ret = pam_fp_libfprint_user_swipe (pam_fp, fprint->data); >@@ -389,14 +412,18 @@ > } > > while (reclaim++ <= FP_RECLAIM_MAX) { >+ pam_fp_libfprint_deinit (pam_fp); > /* surprise removal, e.g. suspend */ > pam_fp_log (pam_fp, LOG_NOTICE, > "%s reclaim loop (#%i, retry %i).", __FUNCTION__, reclaim, retry); > usleep (250000); >- if (pam_fp_libfprint_init (pam_fp) == 0) { >+ init_ret = pam_fp_libfprint_init (pam_fp); >+ if (init_ret == 0) { > reclaim = 0; > pam_fp_log (pam_fp, LOG_NOTICE, "%s reclaim success.", __FUNCTION__); > break; >+ } else { >+ pam_fp_log (pam_fp, LOG_NOTICE, "%s returned %d", __FUNCTION__, init_ret); > } > > if (reclaim == FP_RECLAIM_MAX || retry == FP_RETRY_MAX) { >@@ -412,13 +439,6 @@ > return ret; > } > >-static void pam_fp_libfprint_deinit (pam_fp_s *pam_fp) >-{ >- pam_fp_libfprint_s *fprint = &pam_fp->fprint; >- fp_print_data_free (fprint->data); >- fp_dev_close (fprint->dev); >-} >- > static void pam_fp_swipe (pam_fp_s *pam_fp) > { > int ret = -1; >@@ -445,6 +465,8 @@ > static void pam_fp_prompt (pam_fp_s *pam_fp) > { > int ret = -1; >+ int ret_wait; >+ int stat_loc; > char *resp = NULL; > > /* always returning from pam_prompt due to the CR sent by the keyboard or by uinput (child) */ >@@ -452,10 +474,14 @@ > pam_set_item (pam_fp->pamh, PAM_AUTHTOK, resp); > > if (strlen (resp) > 0) { >- /* password was given, authenticate based on the passwordD, if any */ >+ /* password was given, authenticate based on the password, if any */ > pam_fp_log (pam_fp, LOG_NOTICE, "Password received, stopping child process (pid %i).", pam_fp->child); > kill (pam_fp->child, SIGKILL); >- wait (NULL); >+ ret_wait = waitpid ((pid_t) -1, &stat_loc, WNOHANG); >+ pam_fp_log (pam_fp, LOG_NOTICE, "waitpid(2) returned with: stat_loc=%d, return value=%d.", stat_loc, ret_wait); >+ /* the fingerprint USB device was busy, let's try to settle it */ >+ pam_fp_log (pam_fp, LOG_NOTICE, "Settle fingerprint reader device."); >+ pam_fp_libfprint_reset (pam_fp); > goto out; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 441144
:
255566
|
263084
|
263085
|
263921
|
266122
| 267710