summaryrefslogtreecommitdiff
path: root/sapi/apache2handler/sapi_apache2.c
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@php.net>2003-02-22 04:42:34 +0000
committerJustin Erenkrantz <jerenkrantz@php.net>2003-02-22 04:42:34 +0000
commita7df9995cc4209ad45b3f25b11488bbb2025fb66 (patch)
treec3f5ae3e979ee76ab3f52111d47a044ca7da1bdf /sapi/apache2handler/sapi_apache2.c
parentaac74c71d80b6c9086abd779302667b7c19980d3 (diff)
downloadphp-git-a7df9995cc4209ad45b3f25b11488bbb2025fb66.tar.gz
Add xbithack support to apache2handler SAPI.
(configuration doesn't work, but that's not something new apparently.)
Diffstat (limited to 'sapi/apache2handler/sapi_apache2.c')
-rw-r--r--sapi/apache2handler/sapi_apache2.c16
1 files changed, 13 insertions, 3 deletions
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;