Check if 0, 1, 2 are valid tty file descriptors
This commit is contained in:
parent
6da76775cb
commit
2d45a04b92
4
login.c
4
login.c
@ -71,8 +71,8 @@ main(int argc, char *argv[])
|
|||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (isatty(STDIN_FILENO) == 0)
|
if (isatty(0) == 0 || isatty(1) == 0 || isatty(2) == 0)
|
||||||
eprintf("stdin is not a tty\n");
|
eprintf("no tty");
|
||||||
|
|
||||||
user = argv[0];
|
user = argv[0];
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user