httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: For 1.1
Date Wed, 26 Jun 1996 17:40:22 GMT
On Wed, 26 Jun 1996, Robert S. Thau wrote:

>   It's probably not the best way of doing it, but it's a simple patch, and
>   it works well enough:
> 
> Unfortunately, not doing the cleanup_for_exec at all when running under
> inetd means those CGI scripts can still scribble on the log files, even if
> the webmaster was taking steps (run from inetd as 'root', with 'User' spec'ed
> in config files --- as of 1.1-late-beta, this even works!) to prevent it.

Hmm. You're right. Luckily, though, I've got a better patch. I was able to
(finally) trackdown exactly who was telling cleanup_for_exec to close
stdio and stdin (which, of course, makes it hard for CGI scripts to
work). The following patch is one I feel a lot more confident about,
especially because its changes are confined to the "inetd" portion of
http_main, and it doesn't need to go poking around in alloc.c. Thoughts

Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.41
diff -c -r1.41 http_main.c
*** http_main.c	1996/06/26 10:46:36	1.41
--- http_main.c	1996/06/26 17:38:50
***************
*** 1550,1556 ****
  	}
  	server_conf->port =ntohs(((struct sockaddr_in *)&sa_server)->sin_port);
  	cio = bcreate(ptrans, B_RDWR);
! 	bpushfd(cio, fileno(stdin), fileno(stdout));
  	conn = new_connection (ptrans, server_conf, cio,
  			       (struct sockaddr_in *)&sa_client,
  			       (struct sockaddr_in *)&sa_server,-1);
--- 1550,1557 ----
  	}
  	server_conf->port =ntohs(((struct sockaddr_in *)&sa_server)->sin_port);
  	cio = bcreate(ptrans, B_RDWR);
! 	cio->fd = fileno(stdout);
! 	cio->fd_in = fileno(stdin);
  	conn = new_connection (ptrans, server_conf, cio,
  			       (struct sockaddr_in *)&sa_client,
  			       (struct sockaddr_in *)&sa_server,-1);


-- Alexei Kosut <akosut@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/



Mime
View raw message