--- sysvinit-2.78/src/sulogin.c.foo Wed Jan 31 14:06:36 2001 +++ sysvinit-2.78/src/sulogin.c Wed Jan 31 15:37:18 2001 @@ -366,7 +366,8 @@ signal(SIGINT, SIG_IGN); signal(SIGTSTP, SIG_IGN); if (optind < argc) tty = argv[optind]; - if (tty) { + if (tty && (fd = open(tty, O_RDONLY)) >= 0 && isatty(fd)) { + close(fd); if ((fd = open(tty, O_RDWR)) >= 0) { /* @@ -400,6 +401,8 @@ close(fd); } else perror(tty); + } else { + if (fd>0) close(fd); } /*