35b2031
--- util-linux-2.13-pre2/login-utils/login.c.hang	2005-10-03 16:02:54.000000000 +0200
35b2031
+++ util-linux-2.13-pre2/login-utils/login.c	2005-10-03 16:16:16.000000000 +0200
35b2031
@@ -223,7 +223,8 @@
35b2031
 
35b2031
 	if (lstat(ttyn, &statbuf)
35b2031
 	    || !S_ISCHR(statbuf.st_mode)
35b2031
-	    || (statbuf.st_nlink > 1 && strncmp(ttyn, "/dev/", 5))) {
35b2031
+	    || (statbuf.st_nlink > 1 && strncmp(ttyn, "/dev/", 5))
35b2031
+	    || (access(ttyn, R_OK | W_OK) != 0)) {
35b2031
 		syslog(LOG_ERR, _("FATAL: bad tty"));
35b2031
 		sleep(1);
35b2031
 		exit(1);
35b2031
@@ -332,6 +333,7 @@
35b2031
     pid = getpid();
35b2031
 
35b2031
     signal(SIGALRM, timedout);
35b2031
+    siginterrupt(SIGALRM,1);		/* we have to interrupt syscalls like ioclt() */
35b2031
     alarm((unsigned int)timeout);
35b2031
     signal(SIGQUIT, SIG_IGN);
35b2031
     signal(SIGINT, SIG_IGN);