This commit is contained in:
Nuno Lopes 2006-09-16 17:42:44 +00:00
parent c88dc5752d
commit 37a08a329c
2 changed files with 16 additions and 0 deletions

View File

@ -766,6 +766,10 @@ PHP_FUNCTION(posix_access)
}
path = expand_filepath(filename, NULL TSRMLS_CC);
if (!path) {
POSIX_G(last_error) = EIO;
RETURN_FALSE;
}
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
efree(path);

12
ext/posix/tests/001.phpt Normal file
View File

@ -0,0 +1,12 @@
--TEST--
posix_access() with bogus paths
--SKIPIF--
<?php if (!extension_loaded('posix')) echo 'skip'; ?>
--FILE--
<?php
var_dump(posix_access(str_repeat('bogus path', 1042)));
?>
--EXPECT--
bool(false)