~ubuntu-branches/ubuntu/dapper/php5/dapper-updates

« back to all changes in this revision

Viewing changes to main/fopen_wrappers.c

  • Committer: Package Import Robot
  • Author(s): Steve Beattie
  • Date: 2011-01-12 08:00:02 UTC
  • Revision ID: package-import@ubuntu.com-20110112080002-14tli7k43g73lgg5
Tags: 5.1.2-1ubuntu3.21
* main/fopen_wrappers.c: update to include fix for open_basedir
  restriction regression (LP: #701896)
  - http://svn.php.net/viewvc?view=revision&revision=305698

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
                                resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR;
113
113
                                resolved_basedir[++resolved_basedir_len] = '\0';
114
114
                        }
 
115
                } else {
 
116
                                resolved_basedir[resolved_basedir_len++] = PHP_DIR_SEPARATOR;
 
117
                                resolved_basedir[resolved_basedir_len] = '\0';
115
118
                }
116
119
 
117
120
                if (path[strlen(path)-1] == PHP_DIR_SEPARATOR) {
129
132
                if (strncmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) {
130
133
#endif
131
134
                        if (resolved_name_len > resolved_basedir_len &&
132
 
                                resolved_name[resolved_basedir_len] != PHP_DIR_SEPARATOR) {
 
135
                                resolved_name[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) {
133
136
                                return -1;
134
137
                        } else {
135
138
                                /* File is in the right directory */