Where the OS allows, we now proactively use the various _ex and magic cleanups to close fds (lock files, log files and sockets) to prevent them from leaking into 3rd party modules that don't call ap_cleanup_for_exec() before forking off subprocesses.
*) Added new ap_register_cleanup_ex() API function which allows for a "magic" cleanup function to be run at register time rather than at cleanup time. Also added the ap_note_cleanups_for_(socket|fd|file)_ex() API functions which allows for control over whether that magic cleanup should be called or not. This does not change the default behavior of the non-"ex" function (eg: ap_register_cleanup). At present, the magic cleanup is simply code that performs a CLOSEXEC, but that can be modified (hmmm... maybe an API issue?)
PR: Obtained from: Submitted by: Reviewed by: Martin