Skip to content

Commit 530833e

Browse files
committed
MFH of chdir safe_mode bug fix - in case another RC is rolled then this
fix needs to be in there.
1 parent 7ed6553 commit 530833e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/standard/dir.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ PHP_FUNCTION(chdir)
281281
}
282282
convert_to_string_ex(arg);
283283

284+
if (PG(safe_mode) && !php_checkuid((*arg)->value.str.val, NULL, CHECKUID_ALLOW_ONLY_DIR)) {
285+
RETURN_FALSE;
286+
}
284287
ret = VCWD_CHDIR((*arg)->value.str.val);
285288

286289
if (ret != 0) {
@@ -364,4 +367,6 @@ PHP_NAMED_FUNCTION(php_if_readdir)
364367
* tab-width: 4
365368
* c-basic-offset: 4
366369
* End:
370+
* vim600: sw=4 ts=4 tw=78 fdm=marker
371+
* vim<600: sw=4 ts=4 tw=78
367372
*/

0 commit comments

Comments
 (0)