diff options
author | fjoe <fjoe@FreeBSD.org> | 2004-11-05 10:18:05 +0000 |
---|---|---|
committer | fjoe <fjoe@FreeBSD.org> | 2004-11-05 10:18:05 +0000 |
commit | 9428ecfc37e4b963361e090d5216345172fe9bb0 (patch) | |
tree | e729eddbeebe79ba80fc894773231b0ca052b20c /usr.bin/ee | |
parent | d0890a743f87d1d7deac22426dce80d425c91527 (diff) | |
download | FreeBSD-src-9428ecfc37e4b963361e090d5216345172fe9bb0.zip FreeBSD-src-9428ecfc37e4b963361e090d5216345172fe9bb0.tar.gz |
Check that ee's standard input and output is a terminal.
Do not ignore all the signals in range [1..24].
PR: 65892
MFC after: 2 weeks
Diffstat (limited to 'usr.bin/ee')
-rw-r--r-- | usr.bin/ee/ee.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c index 65ca72d..0284b7f 100644 --- a/usr.bin/ee/ee.c +++ b/usr.bin/ee/ee.c @@ -544,10 +544,11 @@ main(argc, argv) /* beginning of main program */ int argc; char *argv[]; { - int counter; - - for (counter = 1; counter < 24; counter++) - signal(counter, SIG_IGN); + /* Always read from (and write to) a terminal. */ + if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) { + fprintf(stderr, "ee's standard input and output must be a terminal\n"); + exit(1); + } signal(SIGCHLD, SIG_DFL); signal(SIGSEGV, SIG_DFL); |