apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject RE: Bugs discovered by a research group at CWRU (2)
Date Thu, 20 Aug 2009 22:29:51 GMT
On Thu, 2009-08-20 at 17:49 -0400, Gang wrote:
> We are trying to understand this problem in the following way. In the
> file "file_io/unix/open.c", since there exists the codes (line 166 to
> 180) which have already set FD_CLOEXEC if APR_FOPEN_NOCLEANUP was not
> set, so the codes (line 214 to 218) do not have bugs.

That should be OK (i.e. no bug).

The reason we are setting FD_CLOEXEC is because people may not use APR
API to exec() a new program, therefore the cleanup may not get called.
In order to prevent use of file descriptors that were not explicitly
marked as without cleanup in such situations, we let exec() close them.

For normal situations, where people are using APR API, cleanup is
called, which closes the file descriptor.

-- 
Bojan


Mime
View raw message