From: Ilia Alshanetsky Date: Tue, 16 Mar 2004 23:23:26 +0000 (+0000) Subject: MFH: Fixed bug #27498 (bogus safe_mode error on nonexistent directories for X-Git-Tag: php-4.3.5RC4~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5888fd40246a82a25a8857267b6e95e2ee3b9f60;p=php MFH: Fixed bug #27498 (bogus safe_mode error on nonexistent directories for chdir() and opendir() functions). --- diff --git a/NEWS b/NEWS index 14f5b98f46..d0f868558c 100644 --- 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) diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 1490aa3678..108caf0c04 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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); diff --git a/main/streams.c b/main/streams.c index da7f91635a..087deb2523 100755 --- a/main/streams.c +++ b/main/streams.c @@ -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; }