Mailing List Archive

B85 uploaded: close-on-exec on file descriptors
I've uploaded B85-cloexec.txt which sets close-on-exec on the access.log and
socket file descriptors. With this patch applied, I find the following
file descriptors open on calling a CGI script:
0 socket to client
1 fifo
2 error_log
3 error_log

David.
Re: B85 uploaded: close-on-exec on file descriptors [ In reply to ]
> I've uploaded B85-cloexec.txt which sets close-on-exec on the access.log and
> socket file descriptors. With this patch applied, I find the following
> file descriptors open on calling a CGI script:
> 0 socket to client
^^
I assume you mean "from", or am I missing something ?

> 1 fifo
> 2 error_log
> 3 error_log

Why are 2 & 3 the same ?

robh
Re: B85 uploaded: close-on-exec on file descriptors [ In reply to ]
> > I've uploaded B85-cloexec.txt which sets close-on-exec on the access.log
> > and socket file descriptors. With this patch applied, I find the following
> > file descriptors open on calling a CGI script:
> > 0 socket to client
> ^^
> I assume you mean "from", or am I missing something ?

I suppose so, yes. It is a bi-directional connection, but the script is only
supposed to read from it.

> > 1 fifo
> > 2 error_log
> > 3 error_log
>
> Why are 2 & 3 the same ?

Because httpd fopen's the error log, and then dup2()'s a copy of the error-log
file descriptor as file descriptor 2 if it isn't already fd 2.

David.