Date: Wednesday, April 27, 2016 @ 07:17:12 Author: lcarlier Revision: 171985
upgpkg: fuseiso 20070708-6 add patchset from debian (FS#49008) Added: fuseiso/trunk/00-support_large_iso.patch fuseiso/trunk/01-fix_typo.patch fuseiso/trunk/02-prevent-buffer-overflow.patch fuseiso/trunk/03-prevent-integer-overflow.patch Modified: fuseiso/trunk/PKGBUILD Deleted: fuseiso/trunk/fuseiso-20070708-largeiso.patch -----------------------------------+ 00-support_large_iso.patch | 54 ++++++++++++++++++++++++++++++++++++ 01-fix_typo.patch | 20 +++++++++++++ 02-prevent-buffer-overflow.patch | 35 +++++++++++++++++++++++ 03-prevent-integer-overflow.patch | 16 ++++++++++ PKGBUILD | 19 +++++++++--- fuseiso-20070708-largeiso.patch | 48 -------------------------------- 6 files changed, 139 insertions(+), 53 deletions(-) Added: 00-support_large_iso.patch =================================================================== --- 00-support_large_iso.patch (rev 0) +++ 00-support_large_iso.patch 2016-04-27 05:17:12 UTC (rev 171985) @@ -0,0 +1,54 @@ +From: Thomas Bittermann +Subject: handle larger than 4GB isos +Origin: vendor, http://koji.fedoraproject.org/koji/buildinfo?buildID=149397 +Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=440436 + +--- + src/isofs.c | 6 +++--- + src/isofs.h | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +--- fuseiso.orig/src/isofs.c ++++ fuseiso/src/isofs.c +@@ -178,7 +178,7 @@ int isofs_real_preinit( char* imagefile, + context.data_size = isonum_723(context.pd.logical_block_size); + + if(!context.block_size) { +- fprintf(stderr, "init: wrong block data size %d, using default 2048\n", context.data_size); ++ fprintf(stderr, "init: wrong block data size %Lu, using default 2048\n", context.data_size); + context.data_size = 2048; + }; + +@@ -324,7 +324,7 @@ void* isofs_real_init() { + + if(context.block_size != 2048) { + // report unusual data block size +- printf("Data block size: %d\n", context.block_size); ++ printf("Data block size: %Lu\n", context.block_size); + }; + + char buf[129]; +@@ -479,7 +479,7 @@ static int isofs_read_raw_block(int bloc + }; + size_t len = read(context.fd, buf, context.data_size); + if(len != context.data_size) { +- fprintf(stderr, "isofs_read_raw_block: can`t read full block, read only %d bytes from offset %d, %d required; errno %d, message %s\n", ++ fprintf(stderr, "isofs_read_raw_block: can`t read full block, read only %d bytes from offset %d, %Lu required; errno %d, message %s\n", + len, (int) off, context.data_size, errno, strerror(errno)); + fprintf(stderr, "isofs_read_raw_block: huh? reading zeros beyond file end? someone want to save a penny?\n"); + memset(buf + len, 0, context.data_size - len); +--- fuseiso.orig/src/isofs.h ++++ fuseiso/src/isofs.h +@@ -38,9 +38,9 @@ typedef struct _isofs_context { + struct iso_directory_record *root; + int file_offset; // offset to begin of useful data (for .nrg files) + int id_offset; // offset to CD001 inside file +- size_t block_size; // raw block size +- size_t block_offset; // offset from block start to data +- size_t data_size; // data size inside block ++ off_t block_size; // raw block size ++ off_t block_offset; // offset from block start to data ++ off_t data_size; // data size inside block + int susp; // parse susp entries + int susp_skip; // skip bytes from susp SP entry + int joliet_level; // joliet extension level (1, 2 or 3) Added: 01-fix_typo.patch =================================================================== --- 01-fix_typo.patch (rev 0) +++ 01-fix_typo.patch 2016-04-27 05:17:12 UTC (rev 171985) @@ -0,0 +1,20 @@ +From: Jakub Wilk <[email protected]> +Subject: fix typo in sourcecode +Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598021 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598021 + +--- + src/fuseiso.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- fuseiso.orig/src/fuseiso.c ++++ fuseiso/src/fuseiso.c +@@ -295,7 +295,7 @@ void usage(const char* prog) { + " -f -- run in foreground, do not daemonize\n" + " -d -- run in foreground and print debug information\n" + " -s -- run single-threaded\n" +- "\nPlease consult with FUSE ducumentation for more information\n", ++ "\nPlease consult with FUSE documentation for more information\n", + VERSION, + prog); + }; Added: 02-prevent-buffer-overflow.patch =================================================================== --- 02-prevent-buffer-overflow.patch (rev 0) +++ 02-prevent-buffer-overflow.patch 2016-04-27 05:17:12 UTC (rev 171985) @@ -0,0 +1,35 @@ +Description: Prevent stack-based buffer overflow on too-long path names +Author: Mike Gabriel <[email protected]> + +--- a/src/isofs.c ++++ b/src/isofs.c +@@ -1532,13 +1532,23 @@ + if(path[1] != '\0') { // not root dir + strcat(absolute_entry, "/"); + }; +- strcat(absolute_entry, entry); +- if(g_hash_table_lookup(lookup_table, absolute_entry)) { +- // already in lookup cache ++ ++ if(strlen(absolute_entry) + strlen(entry) <= PATH_MAX-1) { ++ strcat(absolute_entry, entry); ++ if(g_hash_table_lookup(lookup_table, absolute_entry)) { ++ // already in lookup cache ++ isofs_free_inode(inode); ++ } else { ++ g_hash_table_insert(lookup_table, g_strdup(absolute_entry), inode); ++ }; ++ } ++ else { ++ printf("readdir: absolute path name for entry '%s' exceeding PATH_MAX (%d)\n", entry, PATH_MAX); + isofs_free_inode(inode); +- } else { +- g_hash_table_insert(lookup_table, g_strdup(absolute_entry), inode); +- }; ++ free(buf); ++ free(entry); ++ return -EIO; ++ } + + free(entry); + Added: 03-prevent-integer-overflow.patch =================================================================== --- 03-prevent-integer-overflow.patch (rev 0) +++ 03-prevent-integer-overflow.patch 2016-04-27 05:17:12 UTC (rev 171985) @@ -0,0 +1,16 @@ +Description: Prevent integer overflow in ZISO code +Author: Mike Gabriel <[email protected]> + +--- a/src/isofs.c ++++ b/src/isofs.c +@@ -1618,6 +1618,10 @@ + }; + + static int isofs_real_read_zf(isofs_inode *inode, char *out_buf, size_t size, off_t offset) { ++ if( inode->zf_block_shift > 17 ) { ++ fprintf(stderr, "isofs_real_read_zf: can't handle ZF block size of 2^%d\n", inode->zf_block_shift); ++ return -EIO; ++ } + int zf_block_size = 1 << inode->zf_block_shift; + int zf_start = offset / zf_block_size; + int zf_end = (offset + size) / zf_block_size; Modified: PKGBUILD =================================================================== --- PKGBUILD 2016-04-27 05:16:11 UTC (rev 171984) +++ PKGBUILD 2016-04-27 05:17:12 UTC (rev 171985) @@ -4,7 +4,7 @@ pkgname=fuseiso pkgver=20070708 -pkgrel=5 +pkgrel=6 pkgdesc="FUSE module to mount ISO filesystem images" arch=('i686' 'x86_64') url="http://sourceforge.net/projects/fuseiso/" @@ -12,15 +12,24 @@ depends=('fuse' 'glib2' 'zlib') makedepends=('pkgconfig') source=("http://ubiz.ru/dm/${pkgname}-${pkgver}.tar.bz2" - 'fuseiso-20070708-largeiso.patch') + 00-support_large_iso.patch + 01-fix_typo.patch + 02-prevent-buffer-overflow.patch + 03-prevent-integer-overflow.patch) md5sums=('4bb50412b6d01f337565e28afddca3a5' - '5c4dce932aba735727221f4e1695f277') + 'f48d99f3928c6caf62fc1d58c99b31ed' + 'd5b5f328f4dc23a7a97b46b09d30e48c' + 'fcc34d91eeab5e243c4ac7768b9f3c4c' + 'f2bacb988113ac28a71e3f136c61c4bf') build() { cd ${srcdir}/${pkgname}-${pkgver} - # Fix for isos larger than 4Go https://bugzilla.redhat.com/show_bug.cgi?id=440436 - patch -p1 -i "${srcdir}/fuseiso-20070708-largeiso.patch" + # Patchset from debian + patch -Np1 -i "${srcdir}"/00-support_large_iso.patch + patch -Np1 -i "${srcdir}"/01-fix_typo.patch + patch -Np1 -i "${srcdir}"/02-prevent-buffer-overflow.patch + patch -Np1 -i "${srcdir}"/03-prevent-integer-overflow.patch ./configure --prefix=/usr make Deleted: fuseiso-20070708-largeiso.patch =================================================================== --- fuseiso-20070708-largeiso.patch 2016-04-27 05:16:11 UTC (rev 171984) +++ fuseiso-20070708-largeiso.patch 2016-04-27 05:17:12 UTC (rev 171985) @@ -1,48 +0,0 @@ -http://bugzilla.redhat.com/show_bug.cgi?id=440436 - -diff -ur fuseiso-20070708.orig/src/isofs.c fuseiso-20070708/src/isofs.c ---- fuseiso-20070708.orig/src/isofs.c 2007-07-08 15:22:59.000000000 +0300 -+++ fuseiso-20070708/src/isofs.c 2009-10-25 12:02:16.000000000 +0200 -@@ -178,7 +178,7 @@ - context.data_size = isonum_723(context.pd.logical_block_size); - - if(!context.block_size) { -- fprintf(stderr, "init: wrong block data size %d, using default 2048\n", context.data_size); -+ fprintf(stderr, "init: wrong block data size %Lu, using default 2048\n", context.data_size); - context.data_size = 2048; - }; - -@@ -324,7 +324,7 @@ - - if(context.block_size != 2048) { - // report unusual data block size -- printf("Data block size: %d\n", context.block_size); -+ printf("Data block size: %Lu\n", context.block_size); - }; - - char buf[129]; -@@ -479,7 +479,7 @@ - }; - size_t len = read(context.fd, buf, context.data_size); - if(len != context.data_size) { -- fprintf(stderr, "isofs_read_raw_block: can`t read full block, read only %d bytes from offset %d, %d required; errno %d, message %s\n", -+ fprintf(stderr, "isofs_read_raw_block: can`t read full block, read only %d bytes from offset %d, %Lu required; errno %d, message %s\n", - len, (int) off, context.data_size, errno, strerror(errno)); - fprintf(stderr, "isofs_read_raw_block: huh? reading zeros beyond file end? someone want to save a penny?\n"); - memset(buf + len, 0, context.data_size - len); -diff -ur fuseiso-20070708.orig/src/isofs.h fuseiso-20070708/src/isofs.h ---- fuseiso-20070708.orig/src/isofs.h 2006-10-17 04:50:39.000000000 +0300 -+++ fuseiso-20070708/src/isofs.h 2009-10-25 12:02:16.000000000 +0200 -@@ -38,9 +38,9 @@ - struct iso_directory_record *root; - int file_offset; // offset to begin of useful data (for .nrg files) - int id_offset; // offset to CD001 inside file -- size_t block_size; // raw block size -- size_t block_offset; // offset from block start to data -- size_t data_size; // data size inside block -+ off_t block_size; // raw block size -+ off_t block_offset; // offset from block start to data -+ off_t data_size; // data size inside block - int susp; // parse susp entries - int susp_skip; // skip bytes from susp SP entry - int joliet_level; // joliet extension level (1, 2 or 3)
