summaryrefslogtreecommitdiff
path: root/ext/phar/phar.c
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-08-21 05:17:28 +0000
committerGreg Beaver <cellog@php.net>2008-08-21 05:17:28 +0000
commitc3e8485971f066259672103f143ae6e3fa86f2de (patch)
tree3151be9d89afb45f93875ff6c340401625dd7dcc /ext/phar/phar.c
parent50066470cd3e1963c591d40e94f2d0a15117f596 (diff)
downloadphp-git-c3e8485971f066259672103f143ae6e3fa86f2de.tar.gz
fix bug #45792: bz2 compressed files in zip failure
Diffstat (limited to 'ext/phar/phar.c')
-rw-r--r--ext/phar/phar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 36ec247b17..2da7a948ff 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -2383,7 +2383,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
/**
* Validate the CRC32 of a file opened from within the phar
*/
-int phar_postprocess_file(php_stream_wrapper *wrapper, int options, phar_entry_data *idata, php_uint32 crc32, char **error TSRMLS_DC) /* {{{ */
+int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip TSRMLS_DC) /* {{{ */
{
php_uint32 crc = ~0;
int len = idata->internal_file->uncompressed_filesize;
@@ -2394,7 +2394,7 @@ int phar_postprocess_file(php_stream_wrapper *wrapper, int options, phar_entry_d
*error = NULL;
}
- if (entry->is_zip) {
+ if (entry->is_zip && process_zip > 0) {
/* verify local file header */
phar_zip_file_header local;
@@ -2424,6 +2424,7 @@ int phar_postprocess_file(php_stream_wrapper *wrapper, int options, phar_entry_d
idata->zero = entry->offset_abs;
}
}
+ if (process_zip == 1) return SUCCESS;
php_stream_seek(fp, idata->zero, SEEK_SET);
@@ -2437,7 +2438,7 @@ int phar_postprocess_file(php_stream_wrapper *wrapper, int options, phar_entry_d
entry->is_crc_checked = 1;
return SUCCESS;
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: internal corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
+ spprintf(error, 0, "phar error: internal corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
return FAILURE;
}
}