mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
MFB: Fixed missing open_basedir check inside chdir() function.
This commit is contained in:
parent
f630127685
commit
4492d8f089
1 changed files with 3 additions and 1 deletions
|
@ -310,7 +310,9 @@ PHP_FUNCTION(chdir)
|
||||||
php_stream_path_param_encode(ppstr, &str, &str_len, REPORT_ERRORS, FG(default_context)) == FAILURE) {
|
php_stream_path_param_encode(ppstr, &str, &str_len, REPORT_ERRORS, FG(default_context)) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (php_check_open_basedir(str TSRMLS_CC)) {
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
ret = VCWD_CHDIR(str);
|
ret = VCWD_CHDIR(str);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue