]> granicus.if.org Git - php/commitdiff
check if write is allowed before writing to error log
authorStanislav Malyshev <stas@php.net>
Tue, 10 Jul 2007 18:42:01 +0000 (18:42 +0000)
committerStanislav Malyshev <stas@php.net>
Tue, 10 Jul 2007 18:42:01 +0000 (18:42 +0000)
main/main.c

index 8a3b350bdb5ea44d03029df6a2d83e6bd443683d..84f51288d033ccdaefabc54329fadec36acc7a53 100644 (file)
@@ -453,6 +453,9 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
                        return;
                }
 #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);
                if (fd != -1) {
                        char *tmp;