stas Tue Jul 10 18:35:13 2007 UTC
Modified files: (Branch: PHP_4_4)
/php-src/main main.c
Log:
check if write is allowed before writing to error log
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.512.2.63.2.15&r2=1.512.2.63.2.16&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.512.2.63.2.15 php-src/main/main.c:1.512.2.63.2.16
--- php-src/main/main.c:1.512.2.63.2.15 Tue May 22 18:16:37 2007
+++ php-src/main/main.c Tue Jul 10 18:35:13 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.512.2.63.2.15 2007/05/22 18:16:37 stas Exp $ */
+/* $Id: main.c,v 1.512.2.63.2.16 2007/07/10 18:35:13 stas Exp $ */
/* {{{ includes
*/
@@ -384,6 +384,14 @@
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);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php