--- thinkfinger-0.2.2/pam/pam_thinkfinger.c	2007-02-05 10:20:38.000000000 +0000
+++ thinkfinger-0.2.2_ugly/pam/pam_thinkfinger.c	2007-03-16 18:50:07.696031500 +0000
@@ -131,14 +131,14 @@
 {
 	struct pam_thinkfinger_s *pam_thinkfinger = data;
 	char *resp;
-
-	pam_prompt (pam_thinkfinger->pamh, PAM_PROMPT_ECHO_OFF, &resp, "Password or swipe finger: ");
-	pam_set_item (pam_thinkfinger->pamh, PAM_AUTHTOK, resp);
-	pthread_mutex_lock (&pam_thinkfinger->retval_mutex);
-	pam_thinkfinger->retval = PAM_SERVICE_ERR;
-	pthread_mutex_unlock (&pam_thinkfinger->retval_mutex);
-	pthread_cancel (pam_thinkfinger->t_thinkfinger);
-
+	if(pam_thinkfinger->isatty){
+		pam_prompt (pam_thinkfinger->pamh, PAM_PROMPT_ECHO_OFF, &resp, "Password or swipe finger: ");
+		pam_set_item (pam_thinkfinger->pamh, PAM_AUTHTOK, resp);
+		pthread_mutex_lock (&pam_thinkfinger->retval_mutex);
+		pam_thinkfinger->retval = PAM_SERVICE_ERR;
+		pthread_mutex_unlock (&pam_thinkfinger->retval_mutex);
+		pthread_cancel (pam_thinkfinger->t_thinkfinger);
+	}
 	pthread_exit (NULL);
 }
 
