Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Push
on:
push:
paths-ignore:
paths-ignore: &ignore_paths
- docs/**
- NEWS
- UPGRADING
Expand All @@ -18,16 +18,7 @@ on:
- PHP-8.4
- master
pull_request:
paths-ignore:
- docs/**
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
- '**/README.*'
- CONTRIBUTING.md
- CODING_STANDARDS.md
- .cirrus.yml
- .circleci/**
paths-ignore: *ignore_paths
branches:
- '**'
workflow_dispatch: ~
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ PHP NEWS
array). (ilutov)
. Fixed bug GH-19823 (register_argc_argv deprecation emitted twice when
using OPcache). (timwolla)
. Fixed bug GH-19480 (error_log php.ini cannot be unset when open_basedir is
configured). (nielsdos)

- Curl:
. Fix cloning of CURLOPT_POSTFIELDS when using the clone operator instead
Expand Down
4 changes: 1 addition & 3 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,10 +1988,8 @@ PHP_FUNCTION(ini_set)
/* open basedir check */
if (PG(open_basedir)) {
if (
zend_string_equals_literal(varname, "error_log")
|| zend_string_equals_literal(varname, "java.class.path")
zend_string_equals_literal(varname, "java.class.path")
|| zend_string_equals_literal(varname, "java.home")
|| zend_string_equals_literal(varname, "mail.log")
|| zend_string_equals_literal(varname, "java.library.path")
|| zend_string_equals_literal(varname, "vpopmail.directory")
) {
Expand Down
10 changes: 6 additions & 4 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,13 @@ static PHP_INI_MH(OnUpdateErrorLog)
{
/* Only do the open_basedir check at runtime */
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) &&
new_value && zend_string_equals_literal(new_value, "syslog")) {
new_value && !zend_string_equals_literal(new_value, "syslog") && ZSTR_LEN(new_value) > 0) {
if (PG(open_basedir) && php_check_open_basedir(ZSTR_VAL(new_value))) {
return FAILURE;
}
}
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
char **p = (char **) ZEND_INI_GET_ADDR();
*p = new_value && ZSTR_LEN(new_value) > 0 ? ZSTR_VAL(new_value) : NULL;
return SUCCESS;
}
/* }}} */
Expand All @@ -711,12 +712,13 @@ static PHP_INI_MH(OnUpdateErrorLog)
static PHP_INI_MH(OnUpdateMailLog)
{
/* Only do the open_basedir check at runtime */
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value) {
if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && ZSTR_LEN(new_value) > 0) {
if (PG(open_basedir) && php_check_open_basedir(ZSTR_VAL(new_value))) {
return FAILURE;
}
}
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
char **p = (char **) ZEND_INI_GET_ADDR();
*p = new_value && ZSTR_LEN(new_value) > 0 ? ZSTR_VAL(new_value) : NULL;
return SUCCESS;
}
/* }}} */
Expand Down
13 changes: 13 additions & 0 deletions tests/security/error_log_special_values.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
Setting error_log to special values with open_basedir enabled
--INI--
open_basedir=foo
error_log=
--FILE--
<?php
var_dump(ini_set("error_log", "syslog"));
var_dump(ini_set("error_log", ""));
?>
--EXPECT--
string(0) ""
string(6) "syslog"
2 changes: 1 addition & 1 deletion win32/build/phpize.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
SET PHP_BUILDCONF_PATH=%~dp0
cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %*
IF ERRORLEVEL 0 exit /b 3
IF %ERRORLEVEL% NEQ 0 exit /b 3
IF NOT EXIST configure.bat (
echo Error generating configure script, configure script was not copied
exit /b 3
Expand Down