Bugzilla – Attachment 266122 Details for
Bug 441144
kdm freezes if fingerprintreader is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
patch for pam_fp.c, unified diff
pam_fp-0.1-11.5.patch (text/plain), 3.32 KB, created by
Mischa Salle
on 2009-01-20 09:10:25 UTC
(
hide
)
Description:
patch for pam_fp.c, unified diff
Filename:
MIME Type:
Creator:
Mischa Salle
Created:
2009-01-20 09:10:25 UTC
Size:
3.32 KB
patch
obsolete
>diff -ur pam_fp-0.1.old/src/pam_fp.c pam_fp-0.1/src/pam_fp.c >--- pam_fp-0.1.old/src/pam_fp.c 2008-11-06 11:31:54.000000000 +0100 >+++ pam_fp-0.1/src/pam_fp.c 2009-01-07 15:35:57.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,25 @@ > return retval; > } > >+static void pam_fp_libfprint_deinit (pam_fp_s *pam_fp) >+{ >+ pam_fp_libfprint_s *fprint = &pam_fp->fprint; >+ /* MISCHA added NULL checking, so that we can call deinit even if >+ * already done. Also necessary to call deinit just before the reclaim loop, >+ * otherwise device is taken. Hence have move deinit towards beginning. */ >+ if (fprint->data!=NULL) >+ fp_print_data_free (fprint->data); >+ if (fprint->dev!=NULL) >+ fp_dev_close (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,15 +403,20 @@ > } > > while (reclaim++ <= FP_RECLAIM_MAX) { >+ /* MISCHA added pam_fp_libfprint_deinit here, otherwise >+ * device cannot be reclaimed */ >+ 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) { >+ /* MISCHA added logging of return val of init (in else) */ >+ if ((init_ret=pam_fp_libfprint_init (pam_fp)) == 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) { > pam_fp_log (pam_fp, LOG_ERR, "Fingerprint reader did not return in time."); >@@ -412,13 +431,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 +457,7 @@ > static void pam_fp_prompt (pam_fp_s *pam_fp) > { > int ret = -1; >+ int stat_loc,wait_ret; /* for waitpid(), used to be wait() */ > char *resp = NULL; > > /* always returning from pam_prompt due to the CR sent by the keyboard or by uinput (child) */ >@@ -455,7 +468,13 @@ > /* password was given, authenticate based on the passwordD, 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); >+ /* MISCHA changed: wait(NULL) would hang because child had >+ * already disappeared (?); this caused kdm to crash; using >+ * WNOHANG seems to have solved it. For WNOHANG need waitpid() >+ * instead of wait() Also added LOG_NOTICE */ >+ wait_ret=waitpid((pid_t)-1,&stat_loc,WNOHANG); >+ pam_fp_log (pam_fp, LOG_NOTICE, "Waitpid() returned with: stat_loc=%d, return val=%d",stat_loc,wait_ret); >+ > 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