apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] inheriting pipes
Date Thu, 06 Mar 2003 01:19:59 GMT
At 04:53 PM 3/5/2003, Bjoern A. Zeeb wrote:
>On Wed, 5 Mar 2003, William A. Rowe, Jr. wrote:
>
>Hi,
>
>already been to bed but ...
>
>> We should do *either*;  if CLOEXEC is supported and can be toggled
>> per our API (_set/_unset) then that can be the preferred method, to protect
>> ourselves from non-apr callers of exec().  (This goes for files, too.)
>
>if it is possible FD_CLOEXEC should really be independed of
>inherit_(un)set. It should be applied to every fd opened by default
>(if available) apart from 012 which seem to already be handled their
>own way. One may have a flag (perhaps also use APR_FILE_NOCLEANUP) to
>supress usage.
>Why ? Because we had seen wrong usage of APR_IMPLEMENT_(UN)INHERIT_SET
>epanded macros at various files in the apache httpd code...

That's apache httpd's problem, not ours.  If they don't want those files
inherited they must communicate that fact.  All we can do is take it
a step further and set CLOEXEC appropriately.

And in their child_init they should be toggling the handles they wanted
inherited to one level of child process (e.g. files opened in the parent
prior to the httpd parent/child fork()).  

We don't redesign APR due to poor httpd implementation, we fix what
can't be implemented in the first place :-)  This isn't the case here.

Bill



Mime
View raw message