apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46425] Apr should set FD_CLOEXEC if APR_FOPEN_NOCLEANUP is not set
Date Fri, 20 Feb 2009 03:05:28 GMT

--- Comment #4 from Bojan Smojver <bojan@rexursive.com>  2009-02-19 19:05:27 PST ---
We really should be using O_CLOEXEC, dup3 and friends were available. As Ulrich
explains, there can be a race condition:

"There is a (possibly brief) period of time between the return of the open()
call or other function creating a file descriptor and the fcntl() call to set
the flag."

Using FD_CLOEXEC is better than nothing, but will miss the above.

> I haven't checked what happens if apr is compiled on a system with O_CLOEXEC and then
is used on a system without O_CLOEXEC.

Do we allow this kind of thing to be done at all? After all, we try to detect
what is available during configure time, so that we can reliably use that
later. All kinds of things will break if APR compiled on one system is used on
another that doesn't have those features available.

Take gethostbyname/getservbyname() stuff - we detect that during compile. If we
move such APR to another machine that is lacking what we detected, it won't
work. Same with O_CLOEXEC, dup3 etc.

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message