cvs: php4(PHP_4_2_0) /main fopen_wrappers.c
| From: | Rasmus Lerdorf | Date: | Sat, 11 May 2002 19:56:10 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /main fopen_wrappers.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11851@lists.php.net to get a copy of this message | ||
rasmus Sat May 11 15:56:10 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/main fopen_wrappers.c
Log:
Argh! Horrible logic here. The safemode include dir check defaulted
to letting stuff through if no safemode include dir was defined.
@ Another safe-mode fix related to the safemode incdir feature (Rasmus)
Index: php4/main/fopen_wrappers.c
diff -u php4/main/fopen_wrappers.c:1.142 php4/main/fopen_wrappers.c:1.142.2.1
--- php4/main/fopen_wrappers.c:1.142 Sat Feb 2 00:43:55 2002
+++ php4/main/fopen_wrappers.c Sat May 11 15:56:10 2002
@@ -16,7 +16,7 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen_wrappers.c,v 1.142 2002/02/02 05:43:55 sebastian Exp $ */
+/* $Id: fopen_wrappers.c,v 1.142.2.1 2002/05/11 19:56:10 rasmus Exp $ */
/* {{{ includes
*/
@@ -234,6 +234,8 @@
char *end;
char resolved_name[MAXPATHLEN];
+ php_printf("safe_mode_include_dir check for %s<br>\n",path);
+
/* Resolve the real path into resolved_name */
if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL)
return -1;
@@ -268,7 +270,7 @@
}
/* Nothing to check... */
- return 0;
+ return -1;
}
/* }}} */
@@ -441,7 +443,7 @@
}
filename_length = strlen(filename);
-
+
/* Relative path open */
if (*filename == '.') {
if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {