Skip to content

Commit 680a887

Browse files
committed
Cleanup
1 parent f368a31 commit 680a887

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Zend/zend_portability.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,11 @@
162162
# define PHP_RTLD_MODE RTLD_LAZY
163163
# endif
164164

165-
/* True global */
166-
static bool use_deepbind = false;
167-
168165
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
169166
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
170167
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer)
171168
# if defined(LM_ID_NEWLM)
169+
extern bool use_deepbind;
172170
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | (use_deepbind ? RTLD_DEEPBIND : 0))
173171
# else
174172
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)

main/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ static bool module_initialized = false;
845845
static bool module_startup = true;
846846
static bool module_shutdown = false;
847847

848+
bool use_deepbind = false;
849+
848850
/* {{{ php_during_module_startup */
849851
PHPAPI bool php_during_module_startup(void)
850852
{

sapi/apache2handler/sapi_apache2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static sapi_module_struct apache2_sapi_module = {
415415
php_apache_sapi_get_request_time, /* Request Time */
416416
NULL, /* Child Terminate */
417417

418-
STANDARD_SAPI_MODULE_PROPERTIES_WITH_FLAGS(SAPI_MODULE_FLAG_ISOLATE_SYMBOLS)
418+
STANDARD_SAPI_MODULE_PROPERTIES
419419
};
420420

421421
static apr_status_t php_apache_server_shutdown(void *tmp)
@@ -461,11 +461,14 @@ static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp
461461
return OK;
462462
}
463463

464+
extern bool use_deepbind;
465+
464466
static int
465467
php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
466468
{
467469
void *data = NULL;
468470
const char *userdata_key = "apache2hook_post_config";
471+
use_deepbind = true;
469472

470473
/* Apache will load, unload and then reload a DSO module. This
471474
* prevents us from starting PHP until the second load. */

0 commit comments

Comments
 (0)