]> granicus.if.org Git - php/commitdiff
- Get rid of using ENFORCE_SAFE_MODE.
authorAndi Gutmans <andi@php.net>
Sun, 19 Feb 2006 04:29:42 +0000 (04:29 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 19 Feb 2006 04:29:42 +0000 (04:29 +0000)
34 files changed:
ext/bz2/bz2.c
ext/dba/dba.c
ext/exif/exif.c
ext/ftp/php_ftp.c
ext/gd/gd.c
ext/hash/hash.c
ext/hash/hash_md.c
ext/hash/hash_sha.c
ext/imap/php_imap.c
ext/libxml/libxml.c
ext/mime_magic/mime_magic.c
ext/ming/ming.c
ext/oci8/oci8_interface.c
ext/pdo/pdo_dbh.c
ext/pgsql/pgsql.c
ext/soap/php_http.c
ext/soap/php_xml.c
ext/spl/spl_directory.c
ext/standard/basic_functions.c
ext/standard/dir.c
ext/standard/file.c
ext/standard/fsock.c
ext/standard/http_fopen_wrapper.c
ext/standard/image.c
ext/standard/md5.c
ext/standard/proc_open.c
ext/standard/sha1.c
ext/standard/streamsfuncs.c
ext/tidy/tidy.c
ext/xmlwriter/php_xmlwriter.c
ext/zlib/zlib.c
main/main.c
main/network.c
main/streams/streams.c

index a063f21c5676a4d55c17ae3621b404ce4be9fbb0..07296d2daad757bbf06d276800153363d58ce910 100644 (file)
@@ -327,7 +327,7 @@ PHP_FUNCTION(bzopen)
                stream = php_stream_bz2open(NULL,
                                                                        Z_STRVAL_PP(file), 
                                                                        Z_STRVAL_PP(mode), 
-                                                                       ENFORCE_SAFE_MODE | REPORT_ERRORS, 
+                                                                       REPORT_ERRORS, 
                                                                        NULL);
        } else {
                /* If it is a resource, than its a stream resource */
index 4a4a621e72908cea635aab4c5943c3bc88f39777..43a371ed0041b7a27c3940980928d4c24204b687 100644 (file)
@@ -753,7 +753,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                                /* when in read only mode try to use existing .lck file first */
                                /* do not log errors for .lck file while in read ony mode on .lck file */
                                lock_file_mode = "rb";
-                               info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, &opened_path);
+                               info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|persistent_flag, &opened_path);
                        }
                        if (!info->lock.fp) {
                                /* when not in read mode or failed to open .lck file read only. now try again in create(write) mode and log errors */
@@ -768,7 +768,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        }
                }
                if (!info->lock.fp) {
-                       info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, &opened_path);
+                       info->lock.fp = php_stream_open_wrapper(lock_name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|persistent_flag, &opened_path);
                        if (info->lock.fp) {
                                if (lock_dbf) {
                                        /* replace the path info with the real path of the opened file */
@@ -806,7 +806,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                if (info->lock.fp && lock_dbf) {
                        info->fp = info->lock.fp; /* use the same stream for locking and database access */
                } else {
-                       info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL);
+                       info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|persistent_flag, NULL);
                }
                if (!info->fp) {
                        dba_close(info TSRMLS_CC);
index 7c46f364a4d91fc33b23734ddc60745bb1e0e6ec..78b9108bcd69c7a5b648efe61d8ca019445ea029 100644 (file)
@@ -3729,7 +3729,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
 
        ImageInfo->motorola_intel = -1; /* flag as unknown */
 
-       ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
+       ImageInfo->infile = php_stream_open_wrapper(FileName, "rb", STREAM_MUST_SEEK|IGNORE_PATH, NULL);
        if (!ImageInfo->infile) {
                exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Unable to open file");
                return FALSE;
@@ -4047,7 +4047,7 @@ PHP_FUNCTION(exif_imagetype)
                WRONG_PARAM_COUNT;
 
        convert_to_string_ex(arg1);
-       stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
+       stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|REPORT_ERRORS, NULL);
 
        if (stream == NULL) {
                RETURN_FALSE;
index 0c90ba491f6c0cf0f4d867a6a0cc04b0fb97533b..3965794f4479f80bb612a309c0297f90e8838ed5 100644 (file)
@@ -684,9 +684,9 @@ PHP_FUNCTION(ftp_get)
 #endif
 
        if (ftp->autoseek && resumepos) {
-               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", REPORT_ERRORS, NULL);
                if (outstream == NULL) {
-                       outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+                       outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", REPORT_ERRORS, NULL);
                }
                if (outstream != NULL) {
                        /* if autoresume is wanted seek to end */
@@ -698,7 +698,7 @@ PHP_FUNCTION(ftp_get)
                        }
                }
        } else {
-               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", REPORT_ERRORS, NULL);
        }
 
        if (outstream == NULL)  {
@@ -745,9 +745,9 @@ PHP_FUNCTION(ftp_nb_get)
        mode = FTPTYPE_IMAGE;
 #endif
        if (ftp->autoseek && resumepos) {
-               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", REPORT_ERRORS, NULL);
                if (outstream == NULL) {
-                       outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+                       outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", REPORT_ERRORS, NULL);
                }
                if (outstream != NULL) {
                        /* if autoresume is wanted seek to end */
@@ -759,7 +759,7 @@ PHP_FUNCTION(ftp_nb_get)
                        }
                }
        } else {
-               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+               outstream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "wt" : "wb", REPORT_ERRORS, NULL);
        }
 
        if (outstream == NULL)  {
@@ -941,7 +941,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_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL))) {
+       if (!(instream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", REPORT_ERRORS, NULL))) {
                RETURN_FALSE;
        }
 
@@ -994,7 +994,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_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL))) {
+       if (!(instream = php_stream_open_wrapper(local, mode == FTPTYPE_ASCII ? "rt" : "rb", REPORT_ERRORS, NULL))) {
                RETURN_FALSE;
        }
 
index 289540a4999979a3fc7a830426048ed2813957d1..42879b253ff665286fb69cd0b27aa41e1d4102be 100644 (file)
@@ -607,7 +607,7 @@ PHP_FUNCTION(imageloadfont)
 
        convert_to_string_ex(file);
 
-       stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", ENFORCE_SAFE_MODE | IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL);
+       stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL);
        if (stream == NULL) {
                RETURN_FALSE;
        }
@@ -1400,7 +1400,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
 
        fn = Z_STRVAL_PP(file);
 
-       stream = php_stream_open_wrapper(fn, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
+       stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
        if (stream == NULL)     {
                RETURN_FALSE;
        }
index 64614046fdb3ba7b0c963ccdb0dff46619c47fdc..25382eaf4dc13337b5c643f8f17a02673fbeebe9 100644 (file)
@@ -82,7 +82,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
                RETURN_FALSE;
        }
        if (isfilename) {
-               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL, DEFAULT_CONTEXT);
+               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
                if (!stream) {
                        /* Stream will report errors opening file */
                        RETURN_FALSE;
@@ -157,7 +157,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
                RETURN_FALSE;
        }
        if (isfilename) {
-               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL, DEFAULT_CONTEXT);
+               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
                if (!stream) {
                        /* Stream will report errors opening file */
                        RETURN_FALSE;
@@ -388,7 +388,7 @@ PHP_FUNCTION(hash_update_file)
        ZEND_FETCH_RESOURCE(hash, php_hash_data*, &zhash, -1, PHP_HASH_RESNAME, php_hash_le_hash);
        context = php_stream_context_from_zval(zcontext, 0);
 
-       stream = php_stream_open_wrapper_ex(filename, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL, context);
+       stream = php_stream_open_wrapper_ex(filename, "rb", REPORT_ERRORS, NULL, context);
        if (!stream) {
                /* Stream will report errors opening file */
                RETURN_FALSE;
index 530b9e8db0be5b719b08f8e963cd8f5245f6a7b6..1ff0eba63a9eee5131bae8b97bdcffcf5a914108 100644 (file)
@@ -136,7 +136,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
                return;
        }
        
-       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
        if (!stream) {
                RETURN_FALSE;
        }
index 3a21fe37d5faf0e29936046f08c8393b5d26987e..3b1156d5bd319dae473e93d84bb1fb84b59b0490 100644 (file)
@@ -131,7 +131,7 @@ PHP_FUNCTION(sha1_file)
                return;
        }
        
-       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
        if (!stream) {
                RETURN_FALSE;
        }
index 67be96b8e3dff0de512037e54557520551b7aab8..3f58f11b379b36e767c57c8df9b463cb360d6a56 100644 (file)
@@ -1886,7 +1886,7 @@ PHP_FUNCTION(imap_savebody)
 
                default:
                        convert_to_string_ex(&out);
-                       writer = php_stream_open_wrapper(Z_STRVAL_P(out), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+                       writer = php_stream_open_wrapper(Z_STRVAL_P(out), "wb", REPORT_ERRORS, NULL);
                break;
        }
        
index 08da6a2ace959ca435b553fc11c3ac1f54762a9f..9db4d5419298be84292f93a502aff00fd43cc4b6 100644 (file)
@@ -283,7 +283,7 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode,
           that the streams layer puts out at times, but for libxml we
           may try to open files that don't exist, but it is not a failure
           in xml processing (eg. DTD files)  */
-       wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC);
+       wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, 0 TSRMLS_CC);
        if (wrapper && read_only && wrapper->wops->url_stat) {
                if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL TSRMLS_CC) == -1) {
                        if (isescaped) {
@@ -297,7 +297,7 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode,
                context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context());
        }
 
-       ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context);
+       ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
        if (isescaped) {
                xmlFree(resolved_path);
        }
index 9e76feb16ad9fb2b4aa0cc3e2723e464bd6e28d4..b071f68515dcd0a66c9a14c9b33e26bba88be339 100644 (file)
@@ -1060,7 +1060,7 @@ static int magic_process(zval *what TSRMLS_DC)
 
        switch (Z_TYPE_P(what)) {
        case IS_STRING:
-               stream = php_stream_open_wrapper(Z_STRVAL_P(what), "rb", IGNORE_PATH | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+               stream = php_stream_open_wrapper(Z_STRVAL_P(what), "rb", IGNORE_PATH | REPORT_ERRORS, NULL);
                if (stream == NULL) {
                        /* We can't open it, but we were able to stat it. */
                        if(MIME_MAGIC_G(debug))
index 5cad69f83bb31fd2edb4437d758ed0bdc9f6f50f..d2df70129c3fa863889c15b13125630aa3a40acb 100644 (file)
@@ -1422,7 +1422,7 @@ PHP_METHOD(swffont, __construct)
                php_stream * stream;
                FILE * file;
        
-               stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+               stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), "rb", REPORT_ERRORS, NULL);
 
                if (stream == NULL) {
                        RETURN_FALSE;
@@ -2387,7 +2387,7 @@ PHP_METHOD(swfmovie, save)
        }
 
        convert_to_string_ex(x);
-       stream = php_stream_open_wrapper(Z_STRVAL_PP(x), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(Z_STRVAL_PP(x), "wb", REPORT_ERRORS, NULL);
 
        if (stream == NULL) {
                RETURN_FALSE;
index 4221c7459ebc50f879dcc1fd23bec1bed1671671..0d6f8ae691142f38c67ed73e7b1dfa7fbe317bdb 100644 (file)
@@ -913,7 +913,7 @@ PHP_FUNCTION(oci_lob_export)
                RETURN_FALSE;
        }
 
-       stream = php_stream_open_wrapper_ex(filename, "w", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL);
+       stream = php_stream_open_wrapper_ex(filename, "w", REPORT_ERRORS, NULL, NULL);
 
        block_length = PHP_OCI_LOB_BUFFER_SIZE;
        if (block_length > length) {
index 83b4e30ca35297fef2cc65eaf0bb6b9efb35732c..c72b6218de3fb654808647f09eefd12467bb178b 100755 (executable)
@@ -183,7 +183,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC)
        php_stream *stream;
        char *dsn = NULL;
 
-       stream = php_stream_open_wrapper(uri, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
+       stream = php_stream_open_wrapper(uri, "rb", REPORT_ERRORS, NULL);
        if (stream) {
                dsn = php_stream_get_line(stream, buf, buflen, NULL);
                php_stream_close(stream);
index 4085405dadcd3aca17d46d28781e5dfa80b26118..d1233cff8b26be28dfd7569c1614fd99a08a9f2d 100644 (file)
@@ -2354,7 +2354,7 @@ PHP_FUNCTION(pg_trace)
        ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
        convert_to_string_ex(z_filename);
 
-       stream = php_stream_open_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
+       stream = php_stream_open_wrapper(Z_STRVAL_PP(z_filename), mode, REPORT_ERRORS, NULL);
 
        if (!stream) {
                RETURN_FALSE;
index 072c812e5d28a763c5eb787d49b5eea743076447..1652853bcfb2c58e01392db63362db5e36a89042 100644 (file)
@@ -147,7 +147,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, in
        namelen = spprintf(&name, 0, "%s://%s:%d", (use_ssl && !*use_proxy)? "ssl" : "tcp", host, port);
 
        stream = php_stream_xport_create(name, namelen,
-               ENFORCE_SAFE_MODE | REPORT_ERRORS,
+               REPORT_ERRORS,
                STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT,
                NULL /*persistent_id*/,
                timeout,
index 7c8ea081e9d070332fb71038e7eb68eee8718a29..760d02abcd4b26a1533552355316a15bfa8f7b8b 100644 (file)
@@ -176,7 +176,7 @@ int php_stream_xmlIO_match_wrapper(const char *filename)
 void *php_stream_xmlIO_open_wrapper(const char *filename)
 {
        TSRMLS_FETCH();
-       return php_stream_open_wrapper((char*)filename, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
+       return php_stream_open_wrapper((char*)filename, "rb", REPORT_ERRORS, NULL);
 }
 
 int php_stream_xmlIO_read(void *context, char *buffer, int len)
index 04f72be878cbea88c17a5a11bf24d20f8ac33e35..a5d093bf15a9edd2eafda3c97591a69446a19c1e 100755 (executable)
@@ -174,7 +174,7 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS
 {
        intern->type = SPL_FS_DIR;
        intern->path_len = strlen(path);
-       intern->u.dir.dirp = php_stream_opendir(path, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
+       intern->u.dir.dirp = php_stream_opendir(path, REPORT_ERRORS, NULL);
 
        if (intern->path_len && (path[intern->path_len-1] == '/'
 #if defined(PHP_WIN32) || defined(NETWARE)
@@ -202,7 +202,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
 {
        intern->type = SPL_FS_FILE;
        intern->u.file.context = php_stream_context_from_zval(intern->u.file.zcontext, 0);
-       intern->u.file.stream = php_stream_open_wrapper_ex(intern->file_name, intern->u.file.open_mode, (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, intern->u.file.context);
+       intern->u.file.stream = php_stream_open_wrapper_ex(intern->file_name, intern->u.file.open_mode, (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, intern->u.file.context);
 
        if (intern->u.file.stream == NULL) {
                if (!EG(exception)) {
index 3451c26ebae013ed941726013627afaa423418a6..2548a5c045c026b702edceace15901f5640112ab 100644 (file)
@@ -2033,7 +2033,7 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
                        break;
 
                case 3:         /*save to a file */
-                       stream = php_stream_open_wrapper(opt, "a", IGNORE_URL | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+                       stream = php_stream_open_wrapper(opt, "a", IGNORE_URL | REPORT_ERRORS, NULL);
                        if (!stream)
                                return FAILURE;
                        php_stream_write(stream, message, strlen(message));
index 09a5beb482df9d76c2a13d0c1868d9bc16ca4f31..dacdbe72347e01248f7199ad927236cfb17d41b3 100644 (file)
@@ -192,7 +192,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
                context = php_stream_context_from_zval(zcontext, 0);
        }
        
-       dirp = php_stream_opendir(dirname, ENFORCE_SAFE_MODE|REPORT_ERRORS, context);
+       dirp = php_stream_opendir(dirname, REPORT_ERRORS, context);
 
        if (dirp == NULL) {
                RETURN_FALSE;
index 81bd0f2b776748f458798be1601add9f8e2a0f46..c9bf705a7d61cfa005bb55e0fc43ed9996f49a4d 100644 (file)
@@ -379,7 +379,7 @@ PHP_FUNCTION(get_meta_tags)
        }
 
        md.stream = php_stream_open_wrapper(filename, "rb",
-                       (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+                       (use_include_path ? USE_PATH : 0) | REPORT_ERRORS,
                        NULL);
 
        if (!md.stream) {
@@ -531,7 +531,7 @@ PHP_FUNCTION(file_get_contents)
        context = php_stream_context_from_zval(zcontext, 0);
 
        stream = php_stream_open_wrapper_ex(filename, "rb", 
-                               (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+                               (use_include_path ? USE_PATH : 0) | REPORT_ERRORS,
                                NULL, context);
        if (!stream) {
                RETURN_FALSE;
@@ -592,7 +592,7 @@ PHP_FUNCTION(file_put_contents)
                mode[1] = 't';
        }
        stream = php_stream_open_wrapper_ex(filename, mode, 
-                       ((flags & PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+                       ((flags & PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
        if (stream == NULL) {
                RETURN_FALSE;
        }
@@ -751,7 +751,7 @@ PHP_FUNCTION(file)
 
        context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
 
-       stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+       stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
        if (!stream) {
                RETURN_FALSE;
        }
@@ -893,7 +893,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
 
        context = php_stream_context_from_zval(zcontext, 0);
        
-       stream = php_stream_open_wrapper_ex(filename, mode, (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+       stream = php_stream_open_wrapper_ex(filename, mode, (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
        if (stream == NULL) {
                RETURN_FALSE;
        }
@@ -1491,7 +1491,7 @@ PHP_FUNCTION(readfile)
 
        context = php_stream_context_from_zval(zcontext, 0);
 
-       stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+       stream = php_stream_open_wrapper_ex(filename, "rb", (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
        if (stream) {
                size = php_stream_passthru(stream);
                php_stream_close(stream);
@@ -1612,7 +1612,7 @@ PHP_FUNCTION(unlink)
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper");
                RETURN_FALSE;
        }
-       RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, ENFORCE_SAFE_MODE | REPORT_ERRORS, context TSRMLS_CC));
+       RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context TSRMLS_CC));
 }
 /* }}} */
 
@@ -1817,7 +1817,7 @@ safe_to_copy:
                return ret;
        }
 
-       deststream = php_stream_open_wrapper(dest, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+       deststream = php_stream_open_wrapper(dest, "wb", REPORT_ERRORS, NULL);
 
        if (srcstream && deststream) {
                ret = php_stream_copy_to_stream(srcstream, deststream, PHP_STREAM_COPY_ALL) == 0 ? FAILURE : SUCCESS;
index b1dce06b48059cf4a48e99cd7ca3fcaa7b7b95e9..6970c038a430137bb405fbe0e7459a34388522b2 100644 (file)
@@ -76,7 +76,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                ZVAL_STRING(zerrstr, "", 1);
        }
 
-       stream = php_stream_xport_create(hostname, hostname_len, ENFORCE_SAFE_MODE | REPORT_ERRORS,
+       stream = php_stream_xport_create(hostname, hostname_len, REPORT_ERRORS,
                        STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, hashkey, &tv, NULL, &errstr, &err);
 
        if (port > 0) {
index ade1652928b54ea5eab3755f3113e4fccb7cf714..8cd1517bc62135fae122e0ee265039fbe5c1c5d1 100644 (file)
@@ -123,7 +123,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
                        Z_TYPE_PP(tmpzval) != IS_STRING ||
                        Z_STRLEN_PP(tmpzval) <= 0) {
                        php_url_free(resource);
-                       return php_stream_open_wrapper_ex(path, mode, ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+                       return php_stream_open_wrapper_ex(path, mode, REPORT_ERRORS, NULL, context);
                }
                /* Called from a non-http wrapper with http proxying requested (i.e. ftp) */
                request_fulluri = 1;
index 8b751deed8336625e7a2acbb723965a7cb400655..f767d14ba42d50582ae01d2932b3cf618ab7c2c7 100644 (file)
@@ -1291,7 +1291,7 @@ PHP_FUNCTION(getimagesize)
                WRONG_PARAM_COUNT;
        }
 
-       stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH, NULL);
 
        if (!stream) {
                RETURN_FALSE;
index bf3902484bf8eb9870a663d483ca515e7a8ea0ef..add962620011b4ad571605f971a8198e3df35e10 100644 (file)
@@ -85,7 +85,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
                return;
        }
        
-       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
        if (!stream) {
                RETURN_FALSE;
        }
index 6ab5ec44fcc7ece49f6924b0e59b1f4cb4abdfcf..4225cf7329e1dde98bc0fcb8dfcb56beca50a50a 100644 (file)
@@ -660,7 +660,7 @@ PHP_FUNCTION(proc_open)
 
                                /* try a wrapper */
                                stream = php_stream_open_wrapper(Z_STRVAL_PP(zfile), Z_STRVAL_PP(zmode),
-                                               ENFORCE_SAFE_MODE|REPORT_ERRORS|STREAM_WILL_CAST, NULL);
+                                               REPORT_ERRORS|STREAM_WILL_CAST, NULL);
 
                                /* force into an fd */
                                if (stream == NULL || FAILURE == php_stream_cast(stream,
index 85c85284a27dae0a938c7bcd1c130b8ceabff16b..75295b5c8cf1eab6b30be24cb9490aa915a21352 100644 (file)
@@ -85,7 +85,7 @@ PHP_FUNCTION(sha1_file)
                return;
        }
        
-       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS | ENFORCE_SAFE_MODE, NULL);
+       stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL);
        if (!stream) {
                RETURN_FALSE;
        }
index dbbef296328d2f53222bb43b27c01b693b8c5ede..4dd1dda5be4a2ac6853c175738fd60ee0e8417a7 100644 (file)
@@ -116,7 +116,7 @@ PHP_FUNCTION(stream_socket_client)
                ZVAL_STRING(zerrstr, "", 1);
        }
 
-       stream = php_stream_xport_create(host, host_len, ENFORCE_SAFE_MODE | REPORT_ERRORS,
+       stream = php_stream_xport_create(host, host_len, REPORT_ERRORS,
                        STREAM_XPORT_CLIENT | (flags & PHP_STREAM_CLIENT_CONNECT ? STREAM_XPORT_CONNECT : 0) |
                        (flags & PHP_STREAM_CLIENT_ASYNC_CONNECT ? STREAM_XPORT_CONNECT_ASYNC : 0),
                        hashkey, &tv, context, &errstr, &err);
@@ -190,7 +190,7 @@ PHP_FUNCTION(stream_socket_server)
                ZVAL_STRING(zerrstr, "", 1);
        }
 
-       stream = php_stream_xport_create(host, host_len, ENFORCE_SAFE_MODE | REPORT_ERRORS,
+       stream = php_stream_xport_create(host, host_len, REPORT_ERRORS,
                        STREAM_XPORT_SERVER | flags,
                        NULL, NULL, context, &errstr, &err);
 
index f6fab3e4e34367cf3c3dc9d939542e0884097611..0f68eafa81ad2b0de7058bdb71616529ad550a2b 100644 (file)
@@ -514,7 +514,7 @@ static char *php_tidy_file_to_mem(char *filename, zend_bool use_include_path, in
        php_stream *stream;
        char *data = NULL;
 
-       if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE, NULL))) {
+       if (!(stream = php_stream_open_wrapper(filename, "rb", (use_include_path ? USE_PATH : 0), NULL))) {
                return NULL;
        }
        if ((*len = (int) php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0)) == 0) {
index efd76463bdea6dd809968d17a2b03fec0d344022..386c2034c7e85de0ddedf547e9418ac0e9ec226d 100644 (file)
@@ -300,7 +300,7 @@ static void *php_xmlwriter_streams_IO_open_write_wrapper(const char *filename TS
        php_stream_wrapper *wrapper = NULL;
        void *ret_val = NULL;
 
-       ret_val = php_stream_open_wrapper_ex((char *)filename, "wb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, NULL);
+       ret_val = php_stream_open_wrapper_ex((char *)filename, "wb", REPORT_ERRORS, NULL, NULL);
        return ret_val;
 }
 /* }}} */
index 11c20e091407f14a8e8c119d2f17fe01fa3ebf08..36c333c7105265da7a541099f6fae6706a685317 100644 (file)
@@ -294,7 +294,7 @@ PHP_FUNCTION(gzfile)
        use_include_path = flags ? USE_PATH : 0;
 
        /* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */
-       stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
+       stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
        if (stream == NULL) {
                /* Error reporting is already done by stream code */
                RETURN_FALSE;
@@ -336,7 +336,7 @@ PHP_FUNCTION(gzopen)
 
        use_include_path = flags ? USE_PATH : 0;
 
-       stream = php_stream_gzopen(NULL, filename, mode, use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
+       stream = php_stream_gzopen(NULL, filename, mode, use_include_path | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC);
 
        if (!stream) {
                RETURN_FALSE;
@@ -365,7 +365,7 @@ PHP_FUNCTION(readgzfile)
 
        use_include_path = flags ? USE_PATH : 0;
 
-       stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE, NULL, NULL STREAMS_CC TSRMLS_CC);
+       stream = php_stream_gzopen(NULL, filename, "rb", use_include_path, NULL, NULL STREAMS_CC TSRMLS_CC);
        if (!stream) {
                RETURN_FALSE;
        }
index 06fe98397e50cde947f10e3693956d800034a4d5..755fe775198f50f64852b5dd7116372bde854b51 100644 (file)
@@ -1001,7 +1001,7 @@ static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path
 {
        TSRMLS_FETCH();
 
-       return php_stream_open_wrapper_as_file((char *)filename, "rb", ENFORCE_SAFE_MODE|USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, opened_path);
+       return php_stream_open_wrapper_as_file((char *)filename, "rb", USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, opened_path);
 }
 /* }}} */
 
@@ -1019,7 +1019,7 @@ static int php_stream_open_for_zend(const char *filename, zend_file_handle *hand
 {
        php_stream *stream;
 
-       stream = php_stream_open_wrapper((char *)filename, "rb", ENFORCE_SAFE_MODE|USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, &handle->opened_path);
+       stream = php_stream_open_wrapper((char *)filename, "rb", USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, &handle->opened_path);
 
        if (stream) {
                handle->type = ZEND_HANDLE_STREAM;
index 195a82518002d4f8717d07eb446e976124bf5386..69b0f9f09443406cb62e9157dc73f45f75678ef5 100644 (file)
@@ -1005,7 +1005,7 @@ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short p
 
        reslen = spprintf(&res, 0, "tcp://%s:%d", host, port);
 
-       stream = php_stream_xport_create(res, reslen, ENFORCE_SAFE_MODE | REPORT_ERRORS,
+       stream = php_stream_xport_create(res, reslen, REPORT_ERRORS,
                        STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, persistent_id, timeout, NULL, NULL, NULL);
 
        efree(res);
index dd98d752a3ba2e0542bc54058b0279dcdce61b53..87ff73864a544b264172e11072db8205087499e3 100755 (executable)
@@ -2222,7 +2222,7 @@ PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_conte
 {
        php_stream_wrapper *wrapper = NULL;
 
-       wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE TSRMLS_CC);
+       wrapper = php_stream_locate_url_wrapper(path, NULL, 0 TSRMLS_CC);
        if (!wrapper || !wrapper->wops || !wrapper->wops->stream_mkdir) {
                return 0;
        }
@@ -2237,7 +2237,7 @@ PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *contex
 {
        php_stream_wrapper *wrapper = NULL;
 
-       wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE TSRMLS_CC);
+       wrapper = php_stream_locate_url_wrapper(path, NULL, 0 TSRMLS_CC);
        if (!wrapper || !wrapper->wops || !wrapper->wops->stream_rmdir) {
                return 0;
        }
@@ -2266,7 +2266,7 @@ PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb,
                }
        }
 
-       wrapper = php_stream_locate_url_wrapper(path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC);
+       wrapper = php_stream_locate_url_wrapper(path, &path_to_open, 0 TSRMLS_CC);
        if (wrapper && wrapper->wops->url_stat) {
                ret = wrapper->wops->url_stat(wrapper, path_to_open, flags, ssb, context TSRMLS_CC);
                if (ret == 0) {
@@ -2692,7 +2692,7 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
                return FAILURE;
        }
 
-       stream = php_stream_opendir(dirname, ENFORCE_SAFE_MODE | REPORT_ERRORS, context);
+       stream = php_stream_opendir(dirname, REPORT_ERRORS, context);
        if (!stream) {
                return FAILURE;
        }