- Fixed no bailout address error and posix tests
authorFelipe Pena <felipe@php.net>
Tue, 2 Nov 2010 18:06:39 +0000 (18:06 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 2 Nov 2010 18:06:39 +0000 (18:06 +0000)
ext/posix/tests/posix_access.phpt
ext/posix/tests/posix_access_error_modes.phpt
ext/posix/tests/posix_access_error_wrongparams.phpt
ext/posix/tests/posix_access_safemode.phpt
ext/posix/tests/posix_mkfifo_safemode.phpt
main/main.c

index 86093e26517f7ddbbe3a6361c8685c896385b74c..47b5e15f0b47443e736f60e969f5cc1567e2e61b 100644 (file)
@@ -17,8 +17,6 @@ if (PHP_VERSION_ID < 503099) {
     die('SKIP Safe mode is no longer available.');
 }
 ?>
---INI--
-safe_mode = 1
 --FILE--
 <?php
 $filename = dirname(__FILE__) . '/foo.test';
index afeb63e1e5c8cba1b78146939c55f5c962522bb1..fb04e34683e59847cdf853e9c8c5fed1b08da872 100644 (file)
@@ -17,8 +17,6 @@ if (PHP_VERSION_ID < 503099) {
     die('SKIP Safe mode is no longer available.');
 }
 ?>
---INI--
-safe_mode = 1
 --FILE--
 <?php
 $filename = dirname(__FILE__) . '/foo.test';
index 10c6883cc175b678c834212fa6f4203ec382423b..35556a13af1e53b8a2287c475fc48eb4aa33f1dd 100644 (file)
@@ -17,8 +17,6 @@ if (PHP_VERSION_ID < 503099) {
     die('SKIP Safe mode is no longer available.');
 }
 ?>
---INI--
-safe_mode = 1
 --FILE--
 <?php
 
index 0ce1e4c444ed7824615f4968fcf6496337e712cc..b726b4fdbb42be9847b89f12dc8eee163d4f3fec 100644 (file)
@@ -14,8 +14,6 @@ if (posix_geteuid() == 0) {
 if (PHP_VERSION_ID < 503099) {
     die('SKIP Safe mode is no longer available.');
 }
---INI--
-safe_mode = 1
 --FILE--
 <?php
 var_dump(posix_access('/tmp', POSIX_W_OK));
index 79c4fed57f99386cef03398e22ccde892446e819..1126c00df04be94c17b7d0864eac5d174aa4661e 100644 (file)
@@ -21,8 +21,6 @@ if (PHP_VERSION_ID < 503099) {
     die('SKIP Safe mode is no longer available.');
 }
 ?>
---INI--
-safe_mode = 1
 --FILE--
 <?php
 var_dump(posix_mkfifo('/tmp/foobar', 0644));
index d3edcdc1c50aa23462ebcd9da49d78a2111b9495..e6d7ab07e06d4de5f0769fb93ed51107de9c9c44 100644 (file)
@@ -1825,7 +1825,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
 {
        zend_utility_functions zuf;
        zend_utility_values zuv;
-       int module_number=0;    /* for REGISTER_INI_ENTRIES() */
+       int retval = SUCCESS, module_number=0;  /* for REGISTER_INI_ENTRIES() */
        char *php_os;
        zend_module_entry *module;
 #ifdef ZTS
@@ -2135,21 +2135,25 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
                };
 
                unsigned int i;
+               
+               zend_try {
+                       /* 2 = Count of deprecation structs */
+                       for (i = 0; i < 2; i++) {
+                               const char **p = directives[i].directives;
 
-               /* 2 = Count of deprecation structs */
-               for (i = 0; i < 2; i++) {
-                       const char **p = directives[i].directives;
+                               while(*p) {
+                                       long value;
 
-                       while(*p) {
-                               long value;
+                                       if (cfg_get_long((char*)*p, &value) == SUCCESS && value) {
+                                               zend_error(directives[i].error_level, directives[i].phrase, *p);
+                                       }
 
-                               if (cfg_get_long((char*)*p, &value) == SUCCESS && value) {
-                                       zend_error(directives[i].error_level, directives[i].phrase, *p);
+                                       ++p;
                                }
-
-                               ++p;
                        }
-               }
+               } zend_catch {
+                       retval = FAILURE;
+               } zend_end_try();
        }
        
        sapi_deactivate(TSRMLS_C);
@@ -2159,7 +2163,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
        zend_interned_strings_snapshot(TSRMLS_C);
 
        /* we're done */
-       return SUCCESS;
+       return retval;
 }
 /* }}} */