]>
Commit | Line | Data |
---|---|---|
5545a732 JR |
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) | |
3 | ||
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 | |
6 | @@ -223,7 +223,8 @@ | |
7 | ||
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")); | |
14 | sleep(1); | |
15 | exit(1); | |
16 | @@ -332,6 +333,7 @@ | |
17 | pid = getpid(); | |
18 | ||
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); |