httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Thu, 02 Aug 2001 05:27:06 GMT
rbb         01/08/01 22:27:06

  Modified:    .        CHANGES
               modules/filters mod_include.c
  Log:
  Add a handler to mod_includes.c.  This handler is designed to
  implement the XbitHack directive.  This can't be done with a
  fixup, because we need to check the content-type, which is
  only available in the handler phase.
  PR:     7751
  
  Revision  Changes    Path
  1.272     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.271
  retrieving revision 1.272
  diff -u -r1.271 -r1.272
  --- CHANGES	2001/08/02 04:59:50	1.271
  +++ CHANGES	2001/08/02 05:27:05	1.272
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.23-dev
   
  +  *) Add a handler to mod_includes.c.  This handler is designed to
  +     implement the XbitHack directive.  This can't be done with a
  +     fixup, because we need to check the content-type, which is
  +     only available in the handler phase.  [Ryan Bloom]
  +
     *) Make the includes filter check return codes from filters lower in
        the filter chain.  If a lower level filter returns an error, then
        the request needs to stop immediately.  This allows mod_include to
  
  
  
  1.118     +30 -0     httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- mod_include.c	2001/08/02 04:59:51	1.117
  +++ mod_include.c	2001/08/02 05:27:06	1.118
  @@ -2816,12 +2816,42 @@
       {NULL}
   };
   
  +static int xbithack_handler(request_rec *r)
  +{
  +#if defined(OS2) || defined(WIN32) || defined(NETWARE)
  +    /* OS/2 dosen't currently support the xbithack. This is being worked on. */
  +    return DECLINED;
  +#else
  +    enum xbithack *state;
  + 
  +    if (ap_strcmp_match(r->handler, "text/html")) {
  +        return DECLINED;
  +    }
  +    if (!(r->finfo.protection & APR_UEXECUTE)) {
  +        return DECLINED;
  +    }
  + 
  +    state = (enum xbithack *) ap_get_module_config(r->per_dir_config,
  +                                                &include_module);
  + 
  +    if (*state == xbithack_off) {
  +        return DECLINED;
  +    }
  +    /* We always return declined, because the default handler will actually
  +     * serve the file.  All we have to do is add the filter.
  +     */
  +    ap_add_output_filter("INCLUDES", NULL, r, r->connection);
  +    return DECLINED;
  +#endif
  +}
  +
   static void register_hooks(apr_pool_t *p)
   {
       APR_REGISTER_OPTIONAL_FN(ap_ssi_get_tag_and_value);
       APR_REGISTER_OPTIONAL_FN(ap_ssi_parse_string);
       APR_REGISTER_OPTIONAL_FN(ap_register_include_handler);
       ap_hook_post_config(include_post_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
  +    ap_hook_handler(xbithack_handler, NULL, NULL, APR_HOOK_MIDDLE);
       ap_register_output_filter("INCLUDES", includes_filter, AP_FTYPE_CONTENT);
   }
   
  
  
  

Mime
View raw message