cvs: php-src(PHP_5_2) /main main.c
| From: | Stanislav Malyshev | Date: | Tue, 10 Jul 2007 17:42:30 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /main main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-45179@lists.php.net to get a copy of this message | ||
stas Tue Jul 10 17:42:30 2007 UTC
Modified files: (Branch: PHP_5_2)
/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.640.2.23.2.39&r2=1.640.2.23.2.40&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.23.2.39 php-src/main/main.c:1.640.2.23.2.40
--- php-src/main/main.c:1.640.2.23.2.39 Mon Jul 9 17:27:23 2007
+++ php-src/main/main.c Tue Jul 10 17:42:29 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.640.2.23.2.39 2007/07/09 17:27:23 dmitry Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.40 2007/07/10 17:42:29 stas Exp $ */
/* {{{ includes
*/
@@ -356,6 +356,14 @@
return;
}
#endif
+ if (PG(safe_mode) && (!php_checkuid(PG(error_log), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ return FAILURE;
+ }
+
+ if (PG(open_basedir) && php_check_open_basedir(PG(error_log) TSRMLS_CC)) {
+ return FAILURE;
+ }
+
fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644);
if (fd != -1) {
char *tmp;