~ubuntu-branches/ubuntu/natty/php5/natty

« back to all changes in this revision

Viewing changes to debian/patches/fix-open_basedir-with-separator-r305698.patch

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-01-07 22:44:56 UTC
  • mfrom: (0.3.17 sid)
  • Revision ID: package-import@ubuntu.com-20110107224456-rfnz8n46skjgr7nm
Tags: 5.3.3-7ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions 
      already in universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, sybase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
    * stop mysql instance on clean just in case we failed in tests
  - Dropped debian/patches/fix-upstream-bug53632.patch, used debian's instead.
  - Dropped debian/patches/mssql-fix-segfault.patch, use debian's instead.
  - debian/patches/configure-as-needed.patch. Work around suspicious
    configure macros to fix a build failure with --as-needed
  - debian/patches/php52389-pgsql-segfault.patch: removing, causes error
    handling to fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/main/fopen_wrappers.c
 
2
+++ b/main/fopen_wrappers.c
 
3
@@ -223,6 +223,9 @@ PHPAPI int php_check_specific_open_based
 
4
                                resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR;
 
5
                                resolved_basedir[++resolved_basedir_len] = '\0';
 
6
                        }
 
7
+               } else {
 
8
+                               resolved_basedir[resolved_basedir_len++] = PHP_DIR_SEPARATOR;
 
9
+                               resolved_basedir[resolved_basedir_len] = '\0';
 
10
                }
 
11
 
 
12
                resolved_name_len = strlen(resolved_name);
 
13
@@ -240,7 +243,7 @@ PHPAPI int php_check_specific_open_based
 
14
                if (strncmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) {
 
15
 #endif
 
16
                        if (resolved_name_len > resolved_basedir_len &&
 
17
-                               resolved_name[resolved_basedir_len] != PHP_DIR_SEPARATOR) {
 
18
+                               resolved_name[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) {
 
19
                                return -1;
 
20
                        } else {
 
21
                                /* File is in the right directory */