From: Justin Erenkrantz Date: Sat, 22 Feb 2003 04:42:34 +0000 (+0000) Subject: Add xbithack support to apache2handler SAPI. X-Git-Tag: RELEASE_0_5~828 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7df9995cc4209ad45b3f25b11488bbb2025fb66;p=php Add xbithack support to apache2handler SAPI. (configuration doesn't work, but that's not something new apparently.) --- diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 23dda7a6f2..9918271aa4 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -481,13 +481,24 @@ static int php_handler(request_rec *r) request_rec *parent_req = NULL; TSRMLS_FETCH(); + conf = ap_get_module_config(r->per_dir_config, &php4_module); + apply_config(conf); + if (strcmp(r->handler, PHP_MAGIC_TYPE) && strcmp(r->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(r->handler, PHP_SCRIPT)) { - return DECLINED; + char *xbithack; + /* Check for xbithack in this case. */ + if (strcmp(r->handler, "text/html")) { + return DECLINED; + } + xbithack = get_php_config(conf, "xbithack", sizeof("xbithack")); + if (*xbithack == '\0' || *xbithack == '0' + || !(r->finfo.protection & APR_UEXECUTE)) { + return DECLINED; + } } - conf = ap_get_module_config(r->per_dir_config, &php4_module); enabled = get_php_config(conf, "engine", sizeof("engine")); /* handle situations where user turns the engine off */ @@ -515,7 +526,6 @@ static int php_handler(request_rec *r) ctx->brigade = brigade; php_apache_request_ctor(r, ctx TSRMLS_CC); - apply_config(conf); } else { parent_req = ctx->r;