]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #27498 (bogus safe_mode error on nonexistent directories for
authorIlia Alshanetsky <iliaa@php.net>
Tue, 16 Mar 2004 23:23:26 +0000 (23:23 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 16 Mar 2004 23:23:26 +0000 (23:23 +0000)
chdir() and opendir() functions).

NEWS
ext/standard/dir.c
main/streams.c

diff --git a/NEWS b/NEWS
index 14f5b98f46e91178f099ecd17e14e06357765b71..d0f868558cb942b3bb4c9d6d55d1a9afe339cd57 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ PHP 4                                                                      NEWS
 - Fixed bug #27509 (broken getaddrinfo() causes fsockopen() error). (Sara)
 - Fixed bug #27505 (htmlentities() does not handle BIG5 correctly). (Ilia, 
   ywliu at hotmail dot com)
+- Fixed bug #27498 (bogus safe_mode error on nonexistent directories for
+  chdir() and opendir() functions). (Ilia)
 - Fixed bug #27460 (base64_decode() does not handle extra padding).
   (Ilia, naish at klanen dot net)
 - Fixed bug #27443 (defined() returns wrong type). (Derick)
index 1490aa3678356e3fc33b23214c03bcc59de273f0..108caf0c0416d4004c90f8ddfbc56269e70b7cf9 100644 (file)
@@ -275,7 +275,7 @@ PHP_FUNCTION(chdir)
                RETURN_FALSE;
        }
 
-       if (PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_ALLOW_ONLY_FILE)) {
+       if (PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
                RETURN_FALSE;
        }
        ret = VCWD_CHDIR(str);
index da7f91635a420a8bbfbc02118d4154fdc4cd8961..087deb252310dd94459907cd6da33c12885e4004 100755 (executable)
@@ -2395,7 +2395,7 @@ static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, char
                return NULL;
        }
        
-       if (PG(safe_mode) &&(!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
+       if (PG(safe_mode) &&(!php_checkuid(path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
                return NULL;
        }