cvs: php4 /ext/ftp php_ftp.c
| From: | Sara Golemon | Date: | Sat, 17 May 2003 04:21:57 +0000 |
| Subject: | cvs: php4 /ext/ftp php_ftp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20983@lists.php.net to get a copy of this message | ||
pollita Sat May 17 00:21:57 2003 EDT
Modified files:
/php4/ext/ftp php_ftp.c
Log:
MFB(r-1.74.2.8) Bug #14369. ftp extension allows circumvention of safe_mode restrictions. HEAD
version of this patch uses the simpler open_wrapper approach to applying safe mode restrictions.
Also allows writting to/from wrappers this way.
Index: php4/ext/ftp/php_ftp.c
diff -u php4/ext/ftp/php_ftp.c:1.87 php4/ext/ftp/php_ftp.c:1.88
--- php4/ext/ftp/php_ftp.c:1.87 Wed Apr 2 19:55:56 2003
+++ php4/ext/ftp/php_ftp.c Sat May 17 00:21:57 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.c,v 1.87 2003/04/03 00:55:56 iliaa Exp $ */
+/* $Id: php_ftp.c,v 1.88 2003/05/17 04:21:57 pollita Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -649,9 +649,9 @@
}
if (ftp->autoseek && resumepos) {
- outstream = php_stream_fopen(local, "rb+", NULL);
+ outstream = php_stream_open_wrapper(local, "rb+", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
if (outstream == NULL) {
- outstream = php_stream_fopen(local, "wb", NULL);
+ outstream = php_stream_open_wrapper(local, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
}
if (outstream != NULL) {
/* if autoresume is wanted seek to end */
@@ -663,7 +663,7 @@
}
}
} else {
- outstream = php_stream_fopen(local, "wb", NULL);
+ outstream = php_stream_open_wrapper(local, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
}
if (outstream == NULL) {
@@ -707,9 +707,9 @@
}
if (ftp->autoseek && resumepos) {
- outstream = php_stream_fopen(local, "rb+", NULL);
+ outstream = php_stream_open_wrapper(local, "rb+", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
if (outstream == NULL) {
- outstream = php_stream_fopen(local, "wb", NULL);
+ outstream = php_stream_open_wrapper(local, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
}
if (outstream != NULL) {
/* if autoresume is wanted seek to end */
@@ -721,7 +721,7 @@
}
}
} else {
- outstream = php_stream_fopen(local, "wb", NULL);
+ outstream = php_stream_open_wrapper(local, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
}
if (outstream == NULL) {
@@ -902,7 +902,7 @@
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
XTYPE(xtype, mode);
- if (!(instream = php_stream_fopen(local, "rb", NULL))) {
+ if (!(instream = php_stream_open_wrapper(local, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL))) {
RETURN_FALSE;
}
@@ -955,7 +955,7 @@
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
XTYPE(xtype, mode);
- if (!(instream = php_stream_fopen(local, "rb", NULL))) {
+ if (!(instream = php_stream_open_wrapper(local, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL))) {
RETURN_FALSE;
}