check if write is allowed before writing to error log

This commit is contained in:
Stanislav Malyshev 2007-07-10 18:42:01 +00:00
parent 5d0a261394
commit 9993892a18

View file

@ -453,6 +453,9 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
return; return;
} }
#endif #endif
if (PG(open_basedir) && php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) {
return FAILURE;
}
fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644);
if (fd != -1) { if (fd != -1) {
char *tmp; char *tmp;