From: Marcus Boerger Date: Wed, 8 Mar 2006 20:31:23 +0000 (+0000) Subject: - safe_mode is nuked in head X-Git-Tag: RELEASE_1_3~488 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b883386ff00f7ed2466db44c5bb4214304035c77;p=php - safe_mode is nuked in head - spl_filesystem_object now allows controlling of clone too --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 6e4de6ebb8..61b035d426 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -206,6 +206,19 @@ static void phar_spl_foreign_dtor(spl_filesystem_object *object TSRMLS_DC) /* {{ } /* }}} */ +static void phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC) /* {{{ */ +{ + phar_archive_data *phar_data = (phar_archive_data *) dst->oth; + + phar_data->refcount++; +} +/* }}} */ + +static spl_other_handler phar_spl_foreign_handler = { + phar_spl_foreign_dtor, + NULL +}; + static void destroy_phar_manifest(void *pDest) /* {{{ */ { phar_entry_info *entry = (phar_entry_info *)pDest; @@ -577,9 +590,11 @@ static int phar_open_filename(char *fname, int fname_len, char *alias, int alias } } +#if PHP_MAJOR_VERSION < 6 if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) { return FAILURE; } +#endif if (php_check_open_basedir(fname TSRMLS_CC)) { return FAILURE; @@ -899,11 +914,13 @@ static php_stream * php_stream_phar_url_wrapper(php_stream_wrapper *wrapper, cha return fpf; } +#if PHP_MAJOR_VERSION < 6 if (PG(safe_mode) && (!php_checkuid(idata->phar->fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) { efree(idata); efree(internal_file); return NULL; } +#endif if (php_check_open_basedir(idata->phar->fname TSRMLS_CC)) { efree(idata); @@ -1491,7 +1508,7 @@ PHP_METHOD(Phar, __construct) phar_data->refcount++; phar_obj->arc.archive = phar_data; - phar_obj->spl.oth_dtor = phar_spl_foreign_dtor; + phar_obj->spl.oth_handler = &phar_spl_foreign_handler; fname_len = spprintf(&fname, 0, "phar://%s", fname);