mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
MFB
This commit is contained in:
parent
c88dc5752d
commit
37a08a329c
@ -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
12
ext/posix/tests/001.phpt
Normal 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)
|
Loading…
Reference in New Issue
Block a user