httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steinar H. Gunderson" <>
Subject Re: mpm-itk and upstream Apache, once again
Date Sun, 05 Aug 2012 15:00:51 GMT
On Wed, Aug 01, 2012 at 01:58:16PM -0400, Jeff Trawick wrote:
> Your post-perdir-config patch has been committed to trunk with r1368121.


> Attached is a patch to trunk that allows you to hook in to the stat
> calls from directory walk.  Call apr_stat() like core_dirwalk_stat()
> but check for APR_STATUS_IS_EACCES(rv) and decide whether to run
> lingering close and exit.  Let us know how that goes.
> You still need the parse-htaccess patch for now.

I backported this to 2.4.2, and changed mpm-itk to hook into that function
with the following hook:

  static apr_status_t itk_dirwalk_stat(apr_finfo_t *finfo, request_rec *r,
                                       apr_int32_t wanted)
      apr_status_t status = apr_stat(finfo, r->filename, wanted, r->pool);
      if (ap_has_irreversibly_setuid && APR_STATUS_IS_EACCES(status)) {
           ap_log_rerror(APLOG_MARK, APLOG_WARNING, status, r,
                         "Couldn't read %s, closing connection.",
      return status;

Seems to work great, from my limited testing. As an extra bonus, I can easily
call clean_child_exit() (which runs more cleanup hooks) instead of exit(),
since this is in the MPM's own .c file.

/* Steinar */

View raw message