summaryrefslogtreecommitdiff
path: root/ext/ftp
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2003-05-17 04:21:57 +0000
committerSara Golemon <pollita@php.net>2003-05-17 04:21:57 +0000
commitc9651182c66b2490b2a7180b7844ec86705593c9 (patch)
treedebf57e53e6e065182d3b8cdcd92a72bd73d53b3 /ext/ftp
parent89243957203d8bfc14687225f24614798cb0e5f9 (diff)
downloadphp-git-c9651182c66b2490b2a7180b7844ec86705593c9.tar.gz
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.
Diffstat (limited to 'ext/ftp')
-rw-r--r--ext/ftp/php_ftp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index e2f19a4b47..cdd29e5a59 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -649,9 +649,9 @@ PHP_FUNCTION(ftp_get)
}
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 @@ PHP_FUNCTION(ftp_get)
}
}
} 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 @@ PHP_FUNCTION(ftp_nb_get)
}
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 @@ PHP_FUNCTION(ftp_nb_get)
}
}
} 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 @@ PHP_FUNCTION(ftp_put)
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 @@ PHP_FUNCTION(ftp_nb_put)
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;
}