1 - login will attempt to run if it has no read/write access to its terminal
2 - login's timeout can fail - needs to call siginterrupt(SIGALRM,1)
4 --- util-linux-2.13-pre2/login-utils/login.c.hang 2005-10-03 16:02:54.000000000 +0200
5 +++ util-linux-2.13-pre2/login-utils/login.c 2005-10-03 16:16:16.000000000 +0200
8 if (lstat(ttyn, &statbuf)
9 || !S_ISCHR(statbuf.st_mode)
10 - || (statbuf.st_nlink > 1 && strncmp(ttyn, "/dev/", 5))) {
11 + || (statbuf.st_nlink > 1 && strncmp(ttyn, "/dev/", 5))
12 + || (access(ttyn, R_OK | W_OK) != 0)) {
13 syslog(LOG_ERR, _("FATAL: bad tty"));
19 signal(SIGALRM, timedout);
20 + siginterrupt(SIGALRM,1); /* we have to interrupt syscalls like ioclt() */
21 alarm((unsigned int)timeout);
22 signal(SIGQUIT, SIG_IGN);
23 signal(SIGINT, SIG_IGN);