Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2004 21:40:27 GMT
From:      Alex Vasylenko <lxv@omut.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/65892: ee(1) endless loop
Message-ID:  <200406232140.i5NLeRUP002315@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/65892; it has been noted by GNATS.

From: Alex Vasylenko <lxv@omut.org>
To: freebsd-gnats-submit@FreeBSD.org, eugen@grosbein.pp.ru
Cc:  
Subject: Re: bin/65892: ee(1) endless loop
Date: Wed, 23 Jun 2004 17:34:36 -0400

 This is a multi-part message in MIME format.
 --------------090303020200050609060303
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Eugene Grosbein wrote:
  > There are situations when ee(1) starts to eat all CPU cycles.
  > ee /tmp/file &
 
 - the code sets to ignore (SIG_IGN) first 23 signals including SIGTTIN, 
 SIGTTOU;
 
  > ee </dev/null
 
 - the code doesn't check STDIN_FILENO, STDOUT_FILENO for isatty;
 
 Please see the patch.
 
 -- 
 Alex.
 
 
 --------------090303020200050609060303
 Content-Type: text/plain;
  name="ee.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="ee.c.diff"
 
 --- ee.c.orig	Mon Jun 30 07:51:21 2003
 +++ ee.c	Wed Jun 23 17:02:28 2004
 @@ -544,10 +544,11 @@ main(argc, argv)		/* beginning of main p
  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);
 
 --------------090303020200050609060303--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406232140.i5NLeRUP002315>