diff options
author | Xinchen Hui <laruence@php.net> | 2013-11-05 19:29:13 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2013-11-05 19:29:13 +0800 |
commit | 6c8ff0031cadb3164bfa77939fd07e4689520f44 (patch) | |
tree | 40223893bebed271b54ce0a354adc09a3d091867 | |
parent | 2a94494b7e87a93f34dad608139aceb970860166 (diff) | |
parent | 63dba7ec9d7ce1ec5e2d48742c71ce66db973b93 (diff) | |
download | php-git-6c8ff0031cadb3164bfa77939fd07e4689520f44.tar.gz |
Merge branch 'PHP-5.5'
Conflicts:
ext/phar/phar_internal.h
ext/phar/stream.c
ext/phar/util.c
-rw-r--r-- | ext/phar/phar.c | 1 | ||||
-rw-r--r-- | ext/phar/util.c | 13 |
2 files changed, 5 insertions, 9 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 79f88b4362..d4716bca91 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3302,6 +3302,7 @@ static size_t phar_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */ zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); #define phar_orig_zend_open zend_stream_open_function + static char *phar_resolve_path(const char *filename, int filename_len TSRMLS_DC) { return phar_find_in_include_path((char *) filename, filename_len, NULL TSRMLS_CC); diff --git a/ext/phar/util.c b/ext/phar/util.c index d2b162fe59..a887daecdc 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -628,11 +628,6 @@ int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */ if (phar_get_pharfp(phar TSRMLS_CC)) { return SUCCESS; } -#if PHP_API_VERSION < 20100412 - if (PG(safe_mode) && (!php_checkuid(phar->fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) { - return FAILURE; - } -#endif if (php_check_open_basedir(phar->fname TSRMLS_CC)) { return FAILURE; @@ -814,6 +809,7 @@ int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, if (entry->fp_type == PHAR_MOD) { /* already newly created, truncate */ php_stream_truncate_set_size(entry->fp, 0); + entry->old_flags = entry->flags; entry->is_modified = 1; phar->is_modified = 1; @@ -1424,11 +1420,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, Z_TYPE_P(zdata) = IS_STRING; Z_STRLEN_P(zdata) = end; -#if PHP_MAJOR_VERSION > 5 - if (end != (off_t) php_stream_copy_to_mem(fp, (void **) &(Z_STRVAL_P(zdata)), (size_t) end, 0)) { -#else if (end != (off_t) php_stream_copy_to_mem(fp, &(Z_STRVAL_P(zdata)), (size_t) end, 0)) { -#endif zval_dtor(zdata); zval_dtor(zsig); zval_dtor(zkey); @@ -1461,6 +1453,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, Z_ADDREF_P(zsig); } Z_ADDREF_P(zkey); + fci.retval_ptr_ptr = &retval_ptr; if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) { @@ -1478,12 +1471,14 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, zval_dtor(openssl); efree(openssl); Z_DELREF_P(zdata); + if (is_sign) { Z_UNSET_ISREF_P(zsig); } else { Z_DELREF_P(zsig); } Z_DELREF_P(zkey); + zval_dtor(zdata); efree(zdata); zval_dtor(zkey); |