cvs: php4 /main fopen-wrappers.c
| From: | Andi Gutmans | Date: | Wed, 30 Aug 2000 20:31:17 +0000 |
| Subject: | cvs: php4 /main fopen-wrappers.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1459@lists.php.net to get a copy of this message | ||
andi Wed Aug 30 13:31:17 2000 EDT
Modified files:
/php4/main fopen-wrappers.c
Log:
- Fix bug when using safe_mode and doc_root together
Index: php4/main/fopen-wrappers.c
diff -u php4/main/fopen-wrappers.c:1.82 php4/main/fopen-wrappers.c:1.83
--- php4/main/fopen-wrappers.c:1.82 Mon Aug 21 02:50:52 2000
+++ php4/main/fopen-wrappers.c Wed Aug 30 13:31:17 2000
@@ -16,7 +16,7 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.c,v 1.82 2000/08/21 09:50:52 sas Exp $ */
+/* $Id: fopen-wrappers.c,v 1.83 2000/08/30 20:31:17 andi Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -413,16 +413,12 @@
#else
if (IS_SLASH(*filename)) {
#endif
- if (PG(safe_mode)) {
- if(PG(doc_root)) {
- snprintf(trypath, MAXPATHLEN, "%s%s", PG(doc_root), filename);
- } else {
- strlcpy(trypath,filename,sizeof(trypath));
- }
+ if (PG(safe_mode)&& PG(doc_root)) {
+ snprintf(trypath, MAXPATHLEN, "%s%s", PG(doc_root), filename);
if (!php_checkuid(trypath, mode, 0)) {
return NULL;
}
- return php_fopen_and_set_opened_path(filename, mode, opened_path);
+ return php_fopen_and_set_opened_path(trypath, mode, opened_path);
} else {
return php_fopen_and_set_opened_path(filename, mode, opened_path);
}