php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #47358
Patch open_basedir_error_fix revision 2011-10-09 17:08 UTC by pajoye@php.net
revision 2011-10-09 16:50 UTC by pajoye@php.net

Patch open_basedir_error_fix for Safe Mode/open_basedir Bug #47358

Patch version 2011-10-09 17:08 UTC

Return to Bug #47358 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2011-10-09 17:08 UTC | 2011-10-09 16:50 UTC

Developer: pajoye@php.net

Line 1 (now 1), was 19 lines, now 18 lines

  Index: ext/standard/dir.c
  ===================================================================
  --- ext/standard/dir.c	(revision 317752)
  +++ ext/standard/dir.c	(working copy)
 @@ -490,11 +490,11 @@
 @@ -490,11 +490,10 @@
   
   	/* now catch the FreeBSD style of "no matches" */
   	if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
  +
   no_results:
 +__debugbreak();
   		if (PG(open_basedir) && *PG(open_basedir)) {
  -			struct stat s;
  -
  -			if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) {
 +			if (php_check_open_basedir_ex(pattern, 1 TSRMLS_CC)) {
 +			if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
   				RETURN_FALSE;
   			}
   		}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC