Skip to content

Commit 5ec0e49

Browse files
committed
Argh.. Committed old patch.
Add safe_mode check and fix error code.
1 parent c71c8e7 commit 5ec0e49

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/posix/posix.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,10 @@ PHP_FUNCTION(posix_access)
660660

661661
path = expand_filepath(filename, NULL TSRMLS_CC);
662662

663-
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
663+
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
664+
(PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS)))) {
664665
efree(path);
665-
POSIX_G(last_error) = EACCES;
666+
POSIX_G(last_error) = EPERM;
666667
RETURN_FALSE;
667668
}
668669

0 commit comments

Comments
 (0)