]> git.pld-linux.org Git - packages/php.git/commitdiff
- backport extension loading from 5.3, allows loading permanent modules with full...
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 31 Oct 2010 15:41:37 +0000 (15:41 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    php-php_dl.patch -> 1.1.2.1
    php.spec -> 1.805.2.74

php-php_dl.patch [new file with mode: 0644]
php.spec

diff --git a/php-php_dl.patch b/php-php_dl.patch
new file mode 100644 (file)
index 0000000..998961f
--- /dev/null
@@ -0,0 +1,49 @@
+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 */
index 2f4208e73cc823742389064537c517cce730a04b..b4b310173c5489debd023b42a81ed9a27c986a16 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -112,7 +112,7 @@ Summary(ru.UTF-8):  PHP Версии 5 - язык препроцессирова
 Summary(uk.UTF-8):     PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
 Name:          php
 Version:       5.2.14
-Release:       4
+Release:       5
 Epoch:         4
 License:       PHP
 Group:         Libraries
@@ -188,6 +188,7 @@ Patch52:    %{name}-libpng.patch
 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}
@@ -1862,6 +1863,7 @@ done
 %patch53 -p1
 %patch54 -p1
 %patch55 -p1
+%patch56 -p1
 
 # conflict seems to be resolved by recode patches
 rm -f ext/recode/config9.m4
This page took 0.486447 seconds and 4 git commands to generate.