]> granicus.if.org Git - php/commitdiff
Nuke safe_mode from sapi/*
authorIlia Alshanetsky <iliaa@php.net>
Tue, 7 Mar 2006 14:43:16 +0000 (14:43 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 7 Mar 2006 14:43:16 +0000 (14:43 +0000)
# only main/ remains at this point, this is the next step

sapi/apache/mod_php5.c
sapi/apache/php_apache.c
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c
sapi/apache_hooks/php_apache.c
sapi/nsapi/nsapi.c

index 3fe6f0f0b3e37043b18aa2c0cbaaf238352b093f..24e68dd7a7fcac1191c18ea725c4f103ad7e7551 100644 (file)
@@ -514,7 +514,7 @@ static void init_request_info(TSRMLS_D)
        SG(request_info).auth_password = NULL;
        SG(request_info).auth_digest = NULL;
 
-       if (authorization && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) {
+       if (authorization) {
                char *p = getword(r->pool, &authorization, ' ');
                if (!strcasecmp(p, "Basic")) {
                        tmp = uudecode(r->pool, authorization);
index 854ea1840177bf674267d033dd957afba1da6ed1..ebc79025645d589877385a767d87b9b04076038a 100644 (file)
@@ -275,7 +275,7 @@ PHP_MINFO_FUNCTION(apache)
                env_arr = table_elts(r->headers_in);
                env = (table_entry *)env_arr->elts;
                for (i = 0; i < env_arr->nelts; ++i) {
-                       if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) {
+                       if (env[i].key) {
                                php_info_print_table_row(2, env[i].key, env[i].val);
                        }
                }
@@ -353,9 +353,7 @@ PHP_FUNCTION(apache_request_headers)
     env_arr = table_elts(((request_rec *) SG(server_context))->headers_in);
     tenv = (table_entry *)env_arr->elts;
     for (i = 0; i < env_arr->nelts; ++i) {
-               if (!tenv[i].key ||
-                       (PG(safe_mode) &&
-                        !strncasecmp(tenv[i].key, "authorization", 13))) {
+               if (!tenv[i].key) {
                        continue;
                }
                if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
@@ -541,11 +539,6 @@ PHP_FUNCTION(apache_get_modules)
    Reset the Apache write timer */
 PHP_FUNCTION(apache_reset_timeout)
 {
-       if (PG(safe_mode)) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot reset the Apache timeout in safe mode");
-               RETURN_FALSE;
-       }
-
        ap_reset_timeout((request_rec *)SG(server_context));
        RETURN_TRUE;
 }
index 060a8fd685a99327e87049d950b545038f40b779..ba3e50f362d1bdd993dd9fee7789340ea9b1d605 100644 (file)
@@ -406,13 +406,8 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
        apr_table_unset(f->r->headers_out, "Last-Modified");
        apr_table_unset(f->r->headers_out, "Expires");
        apr_table_unset(f->r->headers_out, "ETag");
-       if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) {
-               auth = apr_table_get(f->r->headers_in, "Authorization");
-               php_handle_auth_data(auth TSRMLS_CC);
-       } else {
-               SG(request_info).auth_user = NULL;
-               SG(request_info).auth_password = NULL;
-       }
+       auth = apr_table_get(f->r->headers_in, "Authorization");
+       php_handle_auth_data(auth TSRMLS_CC);
        php_request_startup(TSRMLS_C);
 }
 
index ce120f3544602a19963a1e2f6b32103bd23e6bc7..9cf3766fd78087cfe80e6282e2d49e276a59e82a 100644 (file)
@@ -427,14 +427,9 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
        apr_table_unset(r->headers_out, "Last-Modified");
        apr_table_unset(r->headers_out, "Expires");
        apr_table_unset(r->headers_out, "ETag");
-       if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) {
-               auth = apr_table_get(r->headers_in, "Authorization");
-               php_handle_auth_data(auth TSRMLS_CC);
-               ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
-       } else {
-               SG(request_info).auth_user = NULL;
-               SG(request_info).auth_password = NULL;
-       }
+       auth = apr_table_get(r->headers_in, "Authorization");
+       php_handle_auth_data(auth TSRMLS_CC);
+       ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);
        return php_request_startup(TSRMLS_C);
 }
 
index aaeaa76d6ca839c72f83ccd8792eff1cc5492086..0e9fc4d5f74b99191193d3ec16b6f8a92aa74446 100644 (file)
@@ -44,7 +44,7 @@ extern module **ap_loaded_modules;
 static int le_apachereq;
 static zend_class_entry *apacherequest_class_entry;
 
-static void apache_table_to_zval(table *, int safe_mode, zval *return_value);
+static void apache_table_to_zval(table *, zval *return_value);
 
 PHP_FUNCTION(virtual);
 PHP_FUNCTION(apache_request_headers);
@@ -1682,7 +1682,7 @@ PHP_MINFO_FUNCTION(apache)
                env_arr = table_elts(r->headers_in);
                env = (table_entry *)env_arr->elts;
                for (i = 0; i < env_arr->nelts; ++i) {
-                       if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) {
+                       if (env[i].key) {
                                php_info_print_table_row(2, env[i].key, env[i].val);
                        }
                }
@@ -1746,9 +1746,9 @@ PHP_FUNCTION(virtual)
 /* }}} */
 
 
-/* {{{ apache_table_to_zval(table *, int safe_mode, zval *return_value)
+/* {{{ apache_table_to_zval(table *, zval *return_value)
    Fetch all HTTP request headers */
-static void apache_table_to_zval(table *t, int safe_mode, zval *return_value)
+static void apache_table_to_zval(table *t, zval *return_value)
 {
     array_header *env_arr;
     table_entry *tenv;
@@ -1758,8 +1758,7 @@ static void apache_table_to_zval(table *t, int safe_mode, zval *return_value)
     env_arr = table_elts(t);
     tenv = (table_entry *)env_arr->elts;
     for (i = 0; i < env_arr->nelts; ++i) {
-               if (!tenv[i].key ||
-                       (safe_mode && !strncasecmp(tenv[i].key, "authorization", 13))) {
+               if (tenv[i].key) {
                        continue;
                }
                if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
@@ -1780,7 +1779,7 @@ static void apache_table_to_zval(table *t, int safe_mode, zval *return_value)
    Fetch all HTTP request headers */
 PHP_FUNCTION(apache_request_headers)
 {
-       apache_table_to_zval(((request_rec *)SG(server_context))->headers_in, PG(safe_mode), return_value);
+       apache_table_to_zval(((request_rec *)SG(server_context))->headers_in, return_value);
 }
 /* }}} */
 
index 811647f9a8715d0a9b3f64e0d19b924ceedce8dc..03d310e4d0c0bda33eaf6d46d3a5fe06a1cffbd7 100644 (file)
@@ -410,7 +410,7 @@ PHP_FUNCTION(nsapi_request_headers)
        for (i=0; i < rc->rq->headers->hsize; i++) {
                entry=rc->rq->headers->ht[i];
                while (entry) {
-                       if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) {
+                       if (strncasecmp(entry->param->name, "authorization", 13)) {
                                add_assoc_string(return_value, entry->param->name, entry->param->value, 1);
                        }
                        entry=entry->next;
@@ -602,7 +602,7 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D
        for (i=0; i < rc->rq->headers->hsize; i++) {
                entry=rc->rq->headers->ht[i];
                while (entry) {
-                       if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) {
+                       if (strncasecmp(entry->param->name, "authorization", 13)) {
                                if (strcasecmp(entry->param->name, "content-length")==0 || strcasecmp(entry->param->name, "content-type")==0) {
                                        strlcpy(buf, entry->param->name, NS_BUF_SIZE);
                                        pos = 0;
@@ -941,7 +941,7 @@ int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq)
        
        nsapi_php_ini_entries(NSLS_C TSRMLS_CC);
 
-       if (!PG(safe_mode)) php_handle_auth_data(pblock_findval("authorization", rq->headers) TSRMLS_CC);
+       php_handle_auth_data(pblock_findval("authorization", rq->headers) TSRMLS_CC);
 
        file_handle.type = ZEND_HANDLE_FILENAME;
        file_handle.filename = SG(request_info).path_translated;