--- /dev/null
+backport extension loading from 5.3
+
+this allows to load permanent modules with full path (eases make test code)
+
+--- php-5.2.14/ext/standard/dl.c~ 2010-10-31 17:07:21.000000000 +0200
++++ php-5.2.14/ext/standard/dl.c 2010-10-31 17:27:21.409467169 +0200
+@@ -114,6 +114,7 @@
+ zend_module_entry *(*get_module)(void);
+ int error_type;
+ char *extension_dir;
++ char *filename = Z_STRVAL_P(file);
+
+ if (type == MODULE_PERSISTENT) {
+ extension_dir = INI_STR("extension_dir");
+@@ -127,23 +128,24 @@
+ error_type = E_CORE_WARNING;
+ }
+
+- if (extension_dir && extension_dir[0]){
+- int extension_dir_len = strlen(extension_dir);
+-
++ /* Check if passed filename contains directory separators */
++ if (strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != NULL) {
++ /* Passing modules with full path is not supported for dynamically loaded extensions */
+ if (type == MODULE_TEMPORARY) {
+- if (strchr(Z_STRVAL_P(file), '/') != NULL || strchr(Z_STRVAL_P(file), DEFAULT_SLASH) != NULL) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Temporary module name should contain only filename");
+- RETURN_FALSE;
+- }
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Temporary module name should contain only filename");
++ return FAILURE;
+ }
++ libpath = estrdup(filename);
++ } else if (extension_dir && extension_dir[0]) {
++ int extension_dir_len = strlen(extension_dir);
+
+ if (IS_SLASH(extension_dir[extension_dir_len-1])) {
+- spprintf(&libpath, 0, "%s%s", extension_dir, Z_STRVAL_P(file));
++ spprintf(&libpath, 0, "%s%s", extension_dir, filename); /* SAFE */
+ } else {
+- spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, Z_STRVAL_P(file));
++ spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename); /* SAFE */
+ }
+ } else {
+- libpath = estrndup(Z_STRVAL_P(file), Z_STRLEN_P(file));
++ return FAILURE; /* Not full path given or extension_dir is not set */
+ }
+
+ /* load dynamic symbol */
Summary(uk.UTF-8): PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
Name: php
Version: 5.2.14
-Release: 4
+Release: 5
Epoch: 4
License: PHP
Group: Libraries
Patch53: %{name}-gmp.patch
Patch54: fix-test-run.patch
Patch55: %{name}-krb5.patch
+Patch56: php-php_dl.patch
URL: http://www.php.net/
%{?with_interbase:%{!?with_interbase_inst:BuildRequires: Firebird-devel >= 1.0.2.908-2}}
%{?with_pspell:BuildRequires: aspell-devel >= 2:0.50.0}
%patch53 -p1
%patch54 -p1
%patch55 -p1
+%patch56 -p1
# conflict seems to be resolved by recode patches
rm -f ext/recode/config9.m4