]> granicus.if.org Git - php/commitdiff
Disallow PHP startup, in case some ext ext/standard sub-module is not initialized...
authorDmitry Stogov <dmitry@zend.com>
Thu, 24 Jan 2019 12:59:33 +0000 (15:59 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 24 Jan 2019 12:59:33 +0000 (15:59 +0300)
ext/standard/basic_functions.c

index 38949a6080028206d8d5dfab1cf298b65d91d5f4..4a5a98e3b4f220fae0fd262ca6db6fda889782da 100644 (file)
@@ -123,8 +123,6 @@ typedef struct _user_tick_function_entry {
 static void user_shutdown_function_dtor(zval *zv);
 static void user_tick_function_dtor(user_tick_function_entry *tick_function_entry);
 
-static HashTable basic_submodules;
-
 #undef sprintf
 
 /* {{{ arginfo */
@@ -3579,32 +3577,21 @@ PHPAPI double php_get_inf(void) /* {{{ */
 /* }}} */
 
 #define BASIC_MINIT_SUBMODULE(module) \
-       if (PHP_MINIT(module)(INIT_FUNC_ARGS_PASSTHRU) == SUCCESS) {\
-               BASIC_ADD_SUBMODULE(module); \
+       if (PHP_MINIT(module)(INIT_FUNC_ARGS_PASSTHRU) != SUCCESS) {\
+               return FAILURE; \
        }
 
-#define BASIC_ADD_SUBMODULE(module) \
-       zend_hash_str_add_empty_element(&basic_submodules, #module, strlen(#module));
-
 #define BASIC_RINIT_SUBMODULE(module) \
-       if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
-               PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU); \
-       }
+       PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU);
 
 #define BASIC_MINFO_SUBMODULE(module) \
-       if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
-               PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); \
-       }
+       PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
 
 #define BASIC_RSHUTDOWN_SUBMODULE(module) \
-       if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
-               PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \
-       }
+       PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
 
 #define BASIC_MSHUTDOWN_SUBMODULE(module) \
-       if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
-               PHP_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \
-       }
+       PHP_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
 
 PHP_MINIT_FUNCTION(basic) /* {{{ */
 {
@@ -3620,8 +3607,6 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
 #endif
 #endif
 
-       zend_hash_init(&basic_submodules, 0, NULL, NULL, 1);
-
        BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class();
 
        REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
@@ -3682,9 +3667,6 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
        register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
        register_string_constants(INIT_FUNC_ARGS_PASSTHRU);
 
-       BASIC_ADD_SUBMODULE(dl)
-       BASIC_ADD_SUBMODULE(mail)
-       BASIC_ADD_SUBMODULE(streams)
        BASIC_MINIT_SUBMODULE(file)
        BASIC_MINIT_SUBMODULE(pack)
        BASIC_MINIT_SUBMODULE(browscap)
@@ -3784,7 +3766,6 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
        BASIC_MSHUTDOWN_SUBMODULE(random)
        BASIC_MSHUTDOWN_SUBMODULE(password)
 
-       zend_hash_destroy(&basic_submodules);
        return SUCCESS;
 }
 /* }}} */