diff options
author | Stanislav Malyshev <stas@php.net> | 2007-07-10 18:35:13 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2007-07-10 18:35:13 +0000 |
commit | 98bc75b85db2adb40ce7da4e7eaee51af48d389b (patch) | |
tree | c86e579388d53298e03097a7a3c0720646186d76 | |
parent | f7c7f5df59686b172b7246e487c74d9ea85fed29 (diff) | |
download | php-git-98bc75b85db2adb40ce7da4e7eaee51af48d389b.tar.gz |
check if write is allowed before writing to error log
-rw-r--r-- | main/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c index bba551f75d..5a5a563fb8 100644 --- a/main/main.c +++ b/main/main.c @@ -384,6 +384,14 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) return; } #endif + if (PG(safe_mode) && (!php_checkuid(PG(error_log), NULL, CHECKUID_CHECK_FILE_AND_DIR|CHECKUID_NO_ERRORS))) { + return FAILURE; + } + + if (PG(open_basedir) && php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) { + return FAILURE; + } + log_file = VCWD_FOPEN(PG(error_log), "ab"); if (log_file != NULL) { time(&error_time); |