From 435ea7efc78009456eba423514e27b89d1bb38a0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 05:10:40 +0000 Subject: import file-5.11-35.el7 --- diff --git a/.file.metadata b/.file.metadata new file mode 100644 index 0000000..77cf82e --- /dev/null +++ b/.file.metadata @@ -0,0 +1 @@ +df8ffe8759ec8cd85a98dc98e858563ea2555f64 SOURCES/file-5.11.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a3c218 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/file-5.11.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/file-4.17-rpm-name.patch b/SOURCES/file-4.17-rpm-name.patch new file mode 100644 index 0000000..3925d55 --- /dev/null +++ b/SOURCES/file-4.17-rpm-name.patch @@ -0,0 +1,12 @@ +diff --git a/magic/Magdir/rpm b/magic/Magdir/rpm +index 4eb5556..fe22b3d 100644 +--- a/magic/Magdir/rpm ++++ b/magic/Magdir/rpm +@@ -29,6 +29,7 @@ + >>8 beshort 17 SuperH + >>8 beshort 18 Xtensa + >>8 beshort 255 noarch ++>>10 string x %s + + #delta RPM Daniel Novotny (dnovotny@redhat.com) + 0 string drpm Delta RPM diff --git a/SOURCES/file-5.04-generic-msdos.patch b/SOURCES/file-5.04-generic-msdos.patch new file mode 100644 index 0000000..9fe086c --- /dev/null +++ b/SOURCES/file-5.04-generic-msdos.patch @@ -0,0 +1,98 @@ +diff --git a/magic/Magdir/msdos b/magic/Magdir/msdos +index d1a19a6..9e89f11 100644 +--- a/magic/Magdir/msdos ++++ b/magic/Magdir/msdos +@@ -319,9 +319,9 @@ + # but it isn't feasible to match all COM files since there must be at least + # two dozen different one-byte "magics". + # test too generic ? +-0 byte 0xe9 DOS executable (COM) +->0x1FE leshort 0xAA55 \b, boot code +->6 string SFX\ of\ LHarc (%s) ++#0 byte 0xe9 DOS executable (COM) ++#>0x1FE leshort 0xAA55 \b, boot code ++#>6 string SFX\ of\ LHarc (%s) + + # DOS device driver updated by Joerg Jenderek at May 2011 + # http://maben.homeip.net/static/S100/IBM/software/DOS/DOS%20techref/CHAPTER.009 +@@ -396,28 +396,28 @@ + #>4 uleshort&0x4000 0x4000 \b,control strings-support) + + # test too generic ? +-0 byte 0x8c DOS executable (COM) ++#0 byte 0x8c DOS executable (COM) + # updated by Joerg Jenderek at Oct 2008 + 0 ulelong 0xffff10eb DR-DOS executable (COM) + # byte 0xeb conflicts with "sequent" magic leshort 0xn2eb +-0 ubeshort&0xeb8d >0xeb00 ++#0 ubeshort&0xeb8d >0xeb00 + # DR-DOS STACKER.COM SCREATE.SYS missed +->0 byte 0xeb +->>0x1FE leshort 0xAA55 DOS executable (COM), boot code +->>85 string UPX DOS executable (COM), UPX compressed +->>4 string \ $ARX DOS executable (COM), ARX self-extracting archive +->>4 string \ $LHarc DOS executable (COM), LHarc self-extracting archive +->>0x20e string SFX\ by\ LARC DOS executable (COM), LARC self-extracting archive ++#>0 byte 0xeb ++#>>0x1FE leshort 0xAA55 DOS executable (COM), boot code ++#>>85 string UPX DOS executable (COM), UPX compressed ++#>>4 string \ $ARX DOS executable (COM), ARX self-extracting archive ++#>>4 string \ $LHarc DOS executable (COM), LHarc self-extracting archive ++#>>0x20e string SFX\ by\ LARC DOS executable (COM), LARC self-extracting archive + # updated by Joerg Jenderek at Oct 2008 + #0 byte 0xb8 COM executable +-0 uleshort&0x80ff 0x00b8 ++#0 uleshort&0x80ff 0x00b8 + # modified by Joerg Jenderek +->1 lelong !0x21cd4cff COM executable for DOS ++#>1 lelong !0x21cd4cff COM executable for DOS + # http://syslinux.zytor.com/comboot.php + # (32-bit COMBOOT) programs *.C32 contain 32-bit code and run in flat-memory 32-bit protected mode + # start with assembler instructions mov eax,21cd4cffh +-0 uleshort&0xc0ff 0xc0b8 +->1 lelong 0x21cd4cff COM executable (32-bit COMBOOT) ++#0 uleshort&0xc0ff 0xc0b8 ++#>1 lelong 0x21cd4cff COM executable (32-bit COMBOOT) + # syslinux:doc/comboot.txt + # A COM32R program must start with the byte sequence B8 FE 4C CD 21 (mov + # eax,21cd4cfeh) as a magic number. +@@ -437,27 +437,27 @@ + # GRR search is not working + #2 search/28 \xcd\x21 COM executable for MS-DOS + #WHICHFAT.cOM +-2 string \xcd\x21 COM executable for DOS ++#2 string \xcd\x21 COM executable for DOS + #DELTREE.cOM DELTREE2.cOM +-4 string \xcd\x21 COM executable for DOS ++#4 string \xcd\x21 COM executable for DOS + #IFMEMDSK.cOM ASSIGN.cOM COMP.cOM +-5 string \xcd\x21 COM executable for DOS ++#5 string \xcd\x21 COM executable for DOS + #DELTMP.COm HASFAT32.cOM +-7 string \xcd\x21 +->0 byte !0xb8 COM executable for DOS ++#7 string \xcd\x21 ++#>0 byte !0xb8 COM executable for DOS + #COMP.cOM MORE.COm +-10 string \xcd\x21 +->5 string !\xcd\x21 COM executable for DOS ++#10 string \xcd\x21 ++#>5 string !\xcd\x21 COM executable for DOS + #comecho.com +-13 string \xcd\x21 COM executable for DOS ++#13 string \xcd\x21 COM executable for DOS + #HELP.COm EDIT.coM +-18 string \xcd\x21 COM executable for MS-DOS ++#18 string \xcd\x21 COM executable for MS-DOS + #NWRPLTRM.COm +-23 string \xcd\x21 COM executable for MS-DOS ++#23 string \xcd\x21 COM executable for MS-DOS + #LOADFIX.cOm LOADFIX.cOm +-30 string \xcd\x21 COM executable for MS-DOS ++#30 string \xcd\x21 COM executable for MS-DOS + #syslinux.com 3.11 +-70 string \xcd\x21 COM executable for DOS ++#70 string \xcd\x21 COM executable for DOS + # many compressed/converted COMs start with a copy loop instead of a jump + 0x6 search/0xa \xfc\x57\xf3\xa5\xc3 COM executable for MS-DOS + 0x6 search/0xa \xfc\x57\xf3\xa4\xc3 COM executable for DOS diff --git a/SOURCES/file-5.04-man-return-code.patch b/SOURCES/file-5.04-man-return-code.patch new file mode 100644 index 0000000..699840e --- /dev/null +++ b/SOURCES/file-5.04-man-return-code.patch @@ -0,0 +1,16 @@ +diff --git a/doc/file.man b/doc/file.man +index fff7730..3a524f5 100644 +--- a/doc/file.man ++++ b/doc/file.man +@@ -542,6 +542,11 @@ program, and are not covered by the above license. + .Sh RETURN CODE + .Nm + returns 0 on success, and non-zero on error. ++.Pp ++If the file named by the file ++operand does not exist, cannot be read, or the type of the file named by ++the file operand cannot be determined, this is not be considered an error ++that affects the exit status. + .Sh BUGS + .Pp + Please report bugs and send patches to the bug tracker at diff --git a/SOURCES/file-5.04-minix.patch b/SOURCES/file-5.04-minix.patch new file mode 100644 index 0000000..3350068 --- /dev/null +++ b/SOURCES/file-5.04-minix.patch @@ -0,0 +1,53 @@ +diff --git a/magic/Magdir/filesystems b/magic/Magdir/filesystems +index 9172dcb..25c24ca 100644 +--- a/magic/Magdir/filesystems ++++ b/magic/Magdir/filesystems +@@ -885,32 +885,40 @@ + # Minix filesystems - Juan Cespedes + 0x410 leshort 0x137f + !:strength / 2 +->0x402 beshort < 100 Minix filesystem, V1, %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V1, %d zones + >0x1e string minix \b, bootable + 0x410 beshort 0x137f + !:strength / 2 +->0x402 beshort < 100 Minix filesystem, V1 (big endian), %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V1 (big endian), %d zones + >0x1e string minix \b, bootable + 0x410 leshort 0x138f + !:strength / 2 +->0x402 beshort < 100 Minix filesystem, V1, 30 char names, %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V1, 30 char names, %d zones + >0x1e string minix \b, bootable + 0x410 beshort 0x138f + !:strength / 2 +->0x402 beshort < 100 Minix filesystem, V1, 30 char names (big endian), %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V1, 30 char names (big endian), %d zones + >0x1e string minix \b, bootable + 0x410 leshort 0x2468 +->0x402 beshort < 100 Minix filesystem, V2, %d zones ++>0x402 beshort < 100 ++>>0x402 beshort > -1 Minix filesystem, V2, %d zones + >0x1e string minix \b, bootable + 0x410 beshort 0x2468 +->0x402 beshort < 100 Minix filesystem, V2 (big endian), %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V2 (big endian), %d zones + >0x1e string minix \b, bootable + + 0x410 leshort 0x2478 +->0x402 beshort < 100 Minix filesystem, V2, 30 char names, %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V2, 30 char names, %d zones + >0x1e string minix \b, bootable + 0x410 leshort 0x2478 +->0x402 beshort < 100 Minix filesystem, V2, 30 char names, %d zones ++>0x402 beshort < 100 ++>0x402 beshort > -1 Minix filesystem, V2, 30 char names, %d zones + >0x1e string minix \b, bootable + 0x410 beshort 0x2478 + >0x402 beshort !0 Minix filesystem, V2, 30 char names (big endian), %d zones diff --git a/SOURCES/file-5.04-ppc32core.patch b/SOURCES/file-5.04-ppc32core.patch new file mode 100644 index 0000000..3aad1dd --- /dev/null +++ b/SOURCES/file-5.04-ppc32core.patch @@ -0,0 +1,12 @@ +diff --git a/src/readelf.c b/src/readelf.c +index 823db6e..9651239 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -218,6 +218,7 @@ static const size_t prpsoffsets32[] = { + 100, /* SunOS 5.x (command line) */ + 84, /* SunOS 5.x (short name) */ + ++ 48, /* PowerPC */ + 44, /* Linux (command line) */ + 28, /* Linux 2.0.36 (short name) */ + diff --git a/SOURCES/file-5.04-trim.patch b/SOURCES/file-5.04-trim.patch new file mode 100644 index 0000000..9aebda0 --- /dev/null +++ b/SOURCES/file-5.04-trim.patch @@ -0,0 +1,85 @@ +diff --git a/magic/Magdir/filesystems b/magic/Magdir/filesystems +index a2c2966..ecfa6c2 100644 +--- a/magic/Magdir/filesystems ++++ b/magic/Magdir/filesystems +@@ -1251,7 +1251,7 @@ + >>38917 byte >0x33 (unknown version, ID 0x%X) + >>38917 byte <0x31 (unknown version, ID 0x%X) + # "application id" which appears to be used as a volume label +->32808 string >\0 '%s' ++>32808 string/T >\0 '%s' + >34816 string \000CD001\001EL\ TORITO\ SPECIFICATION (bootable) + 37633 string CD001 ISO 9660 CD-ROM filesystem data (raw 2352 byte sectors) + !:mime application/x-iso9660-image +diff --git a/src/apprentice.c b/src/apprentice.c +index 0490642..6dd8381 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -1452,6 +1452,9 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp, + goto bad; + m->str_flags |= PSTRING_LENGTH_INCLUDES_ITSELF; + break; ++ case CHAR_TRIM: ++ m->str_flags |= STRING_TRIM; ++ break; + default: + bad: + if (ms->flags & MAGIC_CHECK) +diff --git a/src/file.h b/src/file.h +index e02009f..1b5f53f 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -307,6 +307,7 @@ struct magic { + #define PSTRING_LEN \ + (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE) + #define PSTRING_LENGTH_INCLUDES_ITSELF BIT(12) ++#define STRING_TRIM BIT(13) + #define CHAR_COMPACT_WHITESPACE 'W' + #define CHAR_COMPACT_OPTIONAL_WHITESPACE 'w' + #define CHAR_IGNORE_LOWERCASE 'c' +@@ -321,6 +322,7 @@ struct magic { + #define CHAR_PSTRING_4_BE 'L' + #define CHAR_PSTRING_4_LE 'l' + #define CHAR_PSTRING_LENGTH_INCLUDES_ITSELF 'J' ++#define CHAR_TRIM 'T' + #define STRING_IGNORE_CASE (STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE) + #define STRING_DEFAULT_RANGE 100 + +diff --git a/src/softmagic.c b/src/softmagic.c +index 8d08cad..f084edd 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -451,11 +451,30 @@ mprint(struct magic_set *ms, struct magic *m) + t = ms->offset + m->vallen; + } + else { ++ char *str = p->s; ++ ++ /* compute t before we mangle the string? */ ++ t = ms->offset + strlen(str); ++ + if (*m->value.s == '\0') +- p->s[strcspn(p->s, "\n")] = '\0'; +- if (file_printf(ms, m->desc, p->s) == -1) ++ str[strcspn(str, "\n")] = '\0'; ++ ++ if (m->str_flags & STRING_TRIM) { ++ char *last; ++ while (isspace((unsigned char)*str)) ++ str++; ++ last = str; ++ while (*last) ++ last++; ++ --last; ++ while (isspace((unsigned char)*last)) ++ last--; ++ *++last = '\0'; ++ } ++ ++ if (file_printf(ms, m->desc, str) == -1) + return -1; +- t = ms->offset + strlen(p->s); ++ + if (m->type == FILE_PSTRING) + t += file_pstring_length_size(m); + } diff --git a/SOURCES/file-5.04-volume_key.patch b/SOURCES/file-5.04-volume_key.patch new file mode 100644 index 0000000..b3c0860 --- /dev/null +++ b/SOURCES/file-5.04-volume_key.patch @@ -0,0 +1,10 @@ +diff --git a/magic/Magdir/securitycerts b/magic/Magdir/securitycerts +index 8785dd8..1c340be 100644 +--- a/magic/Magdir/securitycerts ++++ b/magic/Magdir/securitycerts +@@ -4,3 +4,5 @@ + 0 search/1 -----BEGIN\ CERTIFICATE------ RFC1421 Security Certificate text + 0 search/1 -----BEGIN\ NEW\ CERTIFICATE RFC1421 Security Certificate Signing Request text + 0 belong 0xedfeedfe Sun 'jks' Java Keystore File data ++ ++0 string \0volume_key volume_key escrow packet diff --git a/SOURCES/file-5.10-sticky-bit.patch b/SOURCES/file-5.10-sticky-bit.patch new file mode 100644 index 0000000..de11829 --- /dev/null +++ b/SOURCES/file-5.10-sticky-bit.patch @@ -0,0 +1,12 @@ +diff --git a/src/ascmagic.c b/src/ascmagic.c +index 5a1caac..8d6ca95 100644 +--- a/src/ascmagic.c ++++ b/src/ascmagic.c +@@ -211,6 +211,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf, + case 0: + if (file_printf(ms, ", ") == -1) + goto done; ++ break; + case -1: + goto done; + default: diff --git a/SOURCES/file-5.10-strength.patch b/SOURCES/file-5.10-strength.patch new file mode 100644 index 0000000..738b189 --- /dev/null +++ b/SOURCES/file-5.10-strength.patch @@ -0,0 +1,60 @@ +diff --git a/magic/Magdir/c-lang b/magic/Magdir/c-lang +index 0665627..fdefa8c 100644 +--- a/magic/Magdir/c-lang ++++ b/magic/Magdir/c-lang +@@ -6,26 +6,36 @@ + # BCPL + 0 search/8192 "libhdr" BCPL source text + !:mime text/x-bcpl ++!:strength / 2 + 0 search/8192 "LIBHDR" BCPL source text + !:mime text/x-bcpl ++!:strength / 2 + + # C + 0 regex \^#include C source text + !:mime text/x-c ++!:strength / 2 + 0 regex \^char C source text + !:mime text/x-c ++!:strength / 2 + 0 regex \^double C source text + !:mime text/x-c ++!:strength / 2 + 0 regex \^extern C source text + !:mime text/x-c ++!:strength / 2 + 0 regex \^float C source text + !:mime text/x-c ++!:strength / 2 + 0 regex \^struct C source text + !:mime text/x-c ++!:strength / 2 + 0 regex \^union C source text + !:mime text/x-c ++!:strength / 2 + 0 search/8192 main( C source text + !:mime text/x-c ++!:strength / 2 + + # C++ + # The strength of these rules is increased so they beat the C rules above +diff --git a/magic/Magdir/perl b/magic/Magdir/perl +index e11f2ab..b02b2c2 100644 +--- a/magic/Magdir/perl ++++ b/magic/Magdir/perl +@@ -28,10 +28,14 @@ + # check the first line + 0 search/1 package + >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text ++# to be tried before C source ++!:strength + 5 + # not 'p', check other lines + 0 search/1 !p + >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; + >>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text ++# to be tried before C source ++!:strength + 40 + + + diff --git a/SOURCES/file-5.11-CVE-2013-7345.patch b/SOURCES/file-5.11-CVE-2013-7345.patch new file mode 100644 index 0000000..cd04dc1 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2013-7345.patch @@ -0,0 +1,27 @@ +From ef2329cf71acb59204dd981e2c6cce6c81fe467c Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Mon, 25 Mar 2013 14:06:55 +0000 +Subject: [PATCH] limit to 100 repetitions to avoid excessive backtracking + Carsten Wolff + +--- + magic/Magdir/commands | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/magic/Magdir/commands b/magic/Magdir/commands +index 67c3eee..4a7d8dd 100644 +--- a/magic/Magdir/commands ++++ b/magic/Magdir/commands +@@ -49,7 +49,8 @@ + !:mime text/x-awk + 0 string/wt #!\ /usr/bin/awk awk script text executable + !:mime text/x-awk +-0 regex =^\\s*BEGIN\\s*[{] awk script text ++0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text ++!:strength - 12 + + # AT&T Bell Labs' Plan 9 shell + 0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable +-- +1.8.5.5 + diff --git a/SOURCES/file-5.11-CVE-2014-0207.patch b/SOURCES/file-5.11-CVE-2014-0207.patch new file mode 100644 index 0000000..6b04b62 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-0207.patch @@ -0,0 +1,32 @@ +From 4fcb9a9d1b1063a65fbeb27395de4979c75bd962 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 3 Jun 2014 11:05:00 +0200 +Subject: [PATCH] Fix bug #67326 fileinfo: cdf_read_short_sector insufficient + boundary check + +Upstream fix https://github.com/file/file/commit/6d209c1c489457397a5763bca4b28e43aac90391.patch +Only revelant part applied +--- + ext/fileinfo/libmagic/cdf.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index 4712e84..16649f1 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -352,10 +352,10 @@ cdf_read_short_sector(const cdf_stream_t *sst, void *buf, size_t offs, + size_t ss = CDF_SHORT_SEC_SIZE(h); + size_t pos = CDF_SHORT_SEC_POS(h, id); + assert(ss == len); +- if (pos > CDF_SEC_SIZE(h) * sst->sst_len) { ++ if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) { + DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %" + SIZE_T_FORMAT "u\n", +- pos, CDF_SEC_SIZE(h) * sst->sst_len)); ++ pos + len, CDF_SEC_SIZE(h) * sst->sst_len)); + return -1; + } + (void)memcpy(((char *)buf) + offs, +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-0237.patch b/SOURCES/file-5.11-CVE-2014-0237.patch new file mode 100644 index 0000000..912d8f2 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-0237.patch @@ -0,0 +1,52 @@ +From 68ce2d0ea6da79b12a365e375e1c2ce882c77480 Mon Sep 17 00:00:00 2001 +From: Stanislav Malyshev +Date: Mon, 26 May 2014 17:50:14 -0700 +Subject: [PATCH] Fix bug #67328 (fileinfo: numerous file_printf calls + resulting in performance degradation) + +Upstream patch: https://github.com/file/file/commit/b8acc83781d5a24cc5101e525d15efe0482c280d +--- + ext/fileinfo/libmagic/cdf.c | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index dd7177e..8dacd2f 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -929,7 +929,7 @@ int + cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h, + cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count) + { +- size_t i, maxcount; ++ size_t maxcount; + const cdf_summary_info_header_t *si = + CAST(const cdf_summary_info_header_t *, sst->sst_tab); + const cdf_section_declaration_t *sd = +@@ -944,21 +944,13 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h, + ssi->si_os = CDF_TOLE2(si->si_os); + ssi->si_class = si->si_class; + cdf_swap_class(&ssi->si_class); +- ssi->si_count = CDF_TOLE2(si->si_count); ++ ssi->si_count = CDF_TOLE4(si->si_count); + *count = 0; + maxcount = 0; + *info = NULL; +- for (i = 0; i < CDF_TOLE4(si->si_count); i++) { +- if (i >= CDF_LOOP_LIMIT) { +- DPRINTF(("Unpack summary info loop limit")); +- errno = EFTYPE; +- return -1; +- } +- if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), +- info, count, &maxcount) == -1) { ++ if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info, ++ count, &maxcount) == -1) + return -1; +- } +- } + return 0; + } + +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-0238.patch b/SOURCES/file-5.11-CVE-2014-0238.patch new file mode 100644 index 0000000..aeed14d --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-0238.patch @@ -0,0 +1,39 @@ +From 22736b7c56d678f142d5dd21f4996e5819507a2b Mon Sep 17 00:00:00 2001 +From: Stanislav Malyshev +Date: Mon, 26 May 2014 17:42:18 -0700 +Subject: [PATCH] Fix bug #67327: fileinfo: CDF infinite loop in nelements DoS + +Upstream fix: https://github.com/file/file/commit/f97486ef5dc3e8735440edc4fc8808c63e1a3ef0 +--- + ext/fileinfo/libmagic/cdf.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index 8dacd2f..4712e84 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -810,6 +810,10 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, + i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); + if (inp[i].pi_type & CDF_VECTOR) { + nelements = CDF_GETUINT32(q, 1); ++ if (nelements == 0) { ++ DPRINTF(("CDF_VECTOR with nelements == 0\n")); ++ goto out; ++ } + o = 2; + } else { + nelements = 1; +@@ -884,7 +888,9 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, + } + DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n", + nelements)); +- for (j = 0; j < nelements; j++, i++) { ++ for (j = 0; j < nelements && i < sh.sh_properties; ++ j++, i++) ++ { + uint32_t l = CDF_GETUINT32(q, o); + inp[i].pi_str.s_len = l; + inp[i].pi_str.s_buf = (const char *) +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-1943.patch b/SOURCES/file-5.11-CVE-2014-1943.patch new file mode 100644 index 0000000..6b7c19c --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-1943.patch @@ -0,0 +1,137 @@ +diff --git a/src/ascmagic.c b/src/ascmagic.c +index 8d6ca95..cfa3951 100644 +--- a/src/ascmagic.c ++++ b/src/ascmagic.c +@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf, + == NULL) + goto done; + if ((rv = file_softmagic(ms, utf8_buf, +- (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0) ++ (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0) + rv = -1; + } + +diff --git a/src/file.h b/src/file.h +index 175f659..e02009f 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -414,7 +414,7 @@ protected int file_encoding(struct magic_set *, const unsigned char *, size_t, + unichar **, size_t *, const char **, const char **, const char **); + protected int file_is_tar(struct magic_set *, const unsigned char *, size_t); + protected int file_softmagic(struct magic_set *, const unsigned char *, size_t, +- int, int); ++ size_t, int, int); + protected struct mlist *file_apprentice(struct magic_set *, const char *, int); + protected uint64_t file_signextend(struct magic_set *, struct magic *, + uint64_t); +diff --git a/src/funcs.c b/src/funcs.c +index 0b2a3d0..0d645eb 100644 +--- a/src/funcs.c ++++ b/src/funcs.c +@@ -228,7 +228,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu + + /* try soft magic tests */ + if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) +- if ((m = file_softmagic(ms, ubuf, nb, BINTEST, ++ if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST, + looks_text)) != 0) { + if ((ms->flags & MAGIC_DEBUG) != 0) + (void)fprintf(stderr, "softmagic %d\n", m); +diff --git a/src/softmagic.c b/src/softmagic.c +index 22e1190..56f09ee 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -41,11 +41,12 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $") + #include + #include + ++#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o))) + + private int match(struct magic_set *, struct magic *, uint32_t, +- const unsigned char *, size_t, int, int); ++ const unsigned char *, size_t, int, int, int); + private int mget(struct magic_set *, const unsigned char *, +- struct magic *, size_t, unsigned int, int); ++ struct magic *, size_t, unsigned int, int, int); + private int magiccheck(struct magic_set *, struct magic *); + private int32_t mprint(struct magic_set *, struct magic *); + private int32_t moffset(struct magic_set *, struct magic *); +@@ -67,13 +68,13 @@ private void cvt_64(union VALUETYPE *, const struct magic *); + /*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */ + protected int + file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, +- int mode, int text) ++ size_t level, int mode, int text) + { + struct mlist *ml; + int rv; + for (ml = ms->mlist->next; ml != ms->mlist; ml = ml->next) + if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, mode, +- text)) != 0) ++ text, level)) != 0) + return rv; + + return 0; +@@ -108,7 +109,8 @@ file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, + */ + private int + match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, +- const unsigned char *s, size_t nbytes, int mode, int text) ++ const unsigned char *s, size_t nbytes, int mode, int text, ++ int recursion_level) + { + uint32_t magindex = 0; + unsigned int cont_level = 0; +@@ -140,7 +142,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, + ms->line = m->lineno; + + /* if main entry matches, print it... */ +- switch (mget(ms, s, m, nbytes, cont_level, text)) { ++ switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) { + case -1: + return -1; + case 0: +@@ -223,7 +225,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, + continue; + } + #endif +- switch (mget(ms, s, m, nbytes, cont_level, text)) { ++ switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) { + case -1: + return -1; + case 0: +@@ -1018,12 +1020,18 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, + + private int + mget(struct magic_set *ms, const unsigned char *s, +- struct magic *m, size_t nbytes, unsigned int cont_level, int text) ++ struct magic *m, size_t nbytes, unsigned int cont_level, int text, ++ int recursion_level) + { + uint32_t offset = ms->offset; + uint32_t count = m->str_range; + union VALUETYPE *p = &ms->ms_value; + ++ if (recursion_level >= 20) { ++ file_error(ms, 0, "recursion nesting exceeded"); ++ return -1; ++ } ++ + if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, nbytes, count) == -1) + return -1; + +@@ -1580,10 +1588,12 @@ mget(struct magic_set *ms, const unsigned char *s, + if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && + file_printf(ms, "%s", m->desc) == -1) + return -1; +- if (nbytes < offset) ++ if (offset == 0) + return 0; ++ if (OFFSET_OOB(nbytes, offset, 0)) ++ return 0; + return file_softmagic(ms, s + offset, nbytes - offset, +- BINTEST, text); ++ recursion_level, BINTEST, text); + + case FILE_DEFAULT: /* nothing to check */ + default: diff --git a/SOURCES/file-5.11-CVE-2014-2270.patch b/SOURCES/file-5.11-CVE-2014-2270.patch new file mode 100644 index 0000000..7f4af99 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-2270.patch @@ -0,0 +1,133 @@ +diff --git a/src/softmagic.c b/src/softmagic.c +index 56f09ee..8d08cad 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -61,6 +61,7 @@ private void cvt_16(union VALUETYPE *, const struct magic *); + private void cvt_32(union VALUETYPE *, const struct magic *); + private void cvt_64(union VALUETYPE *, const struct magic *); + ++#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o))) + /* + * softmagic - lookup one file in parsed, in-memory copy of database + * Passed the name and FILE * of one file to be typed. +@@ -1081,7 +1082,7 @@ mget(struct magic_set *ms, const unsigned char *s, + } + switch (m->in_type) { + case FILE_BYTE: +- if (nbytes < (offset + 1)) ++ if (OFFSET_OOB(nbytes, offset, 1)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1116,7 +1117,8 @@ mget(struct magic_set *ms, const unsigned char *s, + offset = ~offset; + break; + case FILE_BESHORT: +- if (nbytes < (offset + 2)) ++ ++ if (OFFSET_OOB(nbytes, offset, 2)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1168,7 +1170,7 @@ mget(struct magic_set *ms, const unsigned char *s, + offset = ~offset; + break; + case FILE_LESHORT: +- if (nbytes < (offset + 2)) ++ if (OFFSET_OOB(nbytes, offset, 2)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1220,7 +1222,7 @@ mget(struct magic_set *ms, const unsigned char *s, + offset = ~offset; + break; + case FILE_SHORT: +- if (nbytes < (offset + 2)) ++ if (OFFSET_OOB(nbytes, offset, 2)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1257,7 +1259,7 @@ mget(struct magic_set *ms, const unsigned char *s, + break; + case FILE_BELONG: + case FILE_BEID3: +- if (nbytes < (offset + 4)) ++ if (OFFSET_OOB(nbytes, offset, 4)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1328,7 +1330,7 @@ mget(struct magic_set *ms, const unsigned char *s, + break; + case FILE_LELONG: + case FILE_LEID3: +- if (nbytes < (offset + 4)) ++ if (OFFSET_OOB(nbytes, offset, 4)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1398,7 +1400,7 @@ mget(struct magic_set *ms, const unsigned char *s, + offset = ~offset; + break; + case FILE_MELONG: +- if (nbytes < (offset + 4)) ++ if (OFFSET_OOB(nbytes, offset, 4)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1468,7 +1470,7 @@ mget(struct magic_set *ms, const unsigned char *s, + offset = ~offset; + break; + case FILE_LONG: +- if (nbytes < (offset + 4)) ++ if (OFFSET_OOB(nbytes, offset, 4)) + return 0; + if (off) { + switch (m->in_op & FILE_OPS_MASK) { +@@ -1535,14 +1537,14 @@ mget(struct magic_set *ms, const unsigned char *s, + /* Verify we have enough data to match magic type */ + switch (m->type) { + case FILE_BYTE: +- if (nbytes < (offset + 1)) /* should alway be true */ ++ if (OFFSET_OOB(nbytes, offset, 1)) + return 0; + break; + + case FILE_SHORT: + case FILE_BESHORT: + case FILE_LESHORT: +- if (nbytes < (offset + 2)) ++ if (OFFSET_OOB(nbytes, offset, 2)) + return 0; + break; + +@@ -1561,26 +1563,26 @@ mget(struct magic_set *ms, const unsigned char *s, + case FILE_FLOAT: + case FILE_BEFLOAT: + case FILE_LEFLOAT: +- if (nbytes < (offset + 4)) ++ if (OFFSET_OOB(nbytes, offset, 4)) + return 0; + break; + + case FILE_DOUBLE: + case FILE_BEDOUBLE: + case FILE_LEDOUBLE: +- if (nbytes < (offset + 8)) ++ if (OFFSET_OOB(nbytes, offset, 8)) + return 0; + break; + + case FILE_STRING: + case FILE_PSTRING: + case FILE_SEARCH: +- if (nbytes < (offset + m->vallen)) ++ if (OFFSET_OOB(nbytes, offset, m->vallen)) + return 0; + break; + + case FILE_REGEX: +- if (nbytes < offset) ++ if (OFFSET_OOB(nbytes, offset, 0)) + return 0; + break; + diff --git a/SOURCES/file-5.11-CVE-2014-3478.patch b/SOURCES/file-5.11-CVE-2014-3478.patch new file mode 100644 index 0000000..4d3fbe0 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3478.patch @@ -0,0 +1,41 @@ +From e77659a8c87272e5061738a31430d2111482c426 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 10 Jun 2014 14:02:36 +0200 +Subject: [PATCH] Fixed Bug #67410 fileinfo: mconvert incorrect handling of + truncated pascal string size + +Upstream +https://github.com/file/file/commit/27a14bc7ba285a0a5ebfdb55e54001aa11932b08 +--- + ext/fileinfo/libmagic/softmagic.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c +index 21fea6b..01e4977 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -818,10 +818,18 @@ mconvert(struct magic_set *ms, struct magic *m) + return 1; + } + case FILE_PSTRING: { +- char *ptr1 = p->s, *ptr2 = ptr1 + file_pstring_length_size(m); ++ size_t sz = file_pstring_length_size(m); ++ char *ptr1 = p->s, *ptr2 = ptr1 + sz; + size_t len = file_pstring_get_length(m, ptr1); +- if (len >= sizeof(p->s)) +- len = sizeof(p->s) - 1; ++ if (len >= sizeof(p->s)) { ++ /* ++ * The size of the pascal string length (sz) ++ * is 1, 2, or 4. We need at least 1 byte for NUL ++ * termination, but we've already truncated the ++ * string by p->s, so we need to deduct sz. ++ */ ++ len = sizeof(p->s) - sz; ++ } + while (len--) + *ptr1++ = *ptr2++; + *ptr1 = '\0'; +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-3479.patch b/SOURCES/file-5.11-CVE-2014-3479.patch new file mode 100644 index 0000000..58c0cd5 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3479.patch @@ -0,0 +1,37 @@ +From 5c9f96799961818944d43b22c241cc56c215c2e4 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 10 Jun 2014 14:13:14 +0200 +Subject: [PATCH] Fixed Bug #67411 fileinfo: cdf_check_stream_offset + insufficient boundary check + +Upstream: +https://github.com/file/file/commit/36fadd29849b8087af9f4586f89dbf74ea45be67 +--- + ext/fileinfo/libmagic/cdf.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index 16649f1..c9a5d50 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -267,13 +267,15 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h, + { + const char *b = (const char *)sst->sst_tab; + const char *e = ((const char *)p) + tail; ++ size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? ++ CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + (void)&line; +- if (e >= b && (size_t)(e - b) < CDF_SEC_SIZE(h) * sst->sst_len) ++ if (e >= b && (size_t)(e - b) <= ss * sst->sst_len) + return 0; + DPRINTF(("%d: offset begin %p end %p %" SIZE_T_FORMAT "u" + " >= %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %" + SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b), +- CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len)); ++ ss * sst->sst_len, ss, sst->sst_len)); + errno = EFTYPE; + return -1; + } +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-3480.patch b/SOURCES/file-5.11-CVE-2014-3480.patch new file mode 100644 index 0000000..1d84c15 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3480.patch @@ -0,0 +1,40 @@ +From 40ef6e07e0b2cdced57c506e08cf18f47122292d Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 10 Jun 2014 14:22:04 +0200 +Subject: [PATCH] Bug #67412 fileinfo: cdf_count_chain insufficient + boundary check + +Upstream: +https://github.com/file/file/commit/40bade80cbe2af1d0b2cd0420cebd5d5905a2382 +--- + ext/fileinfo/libmagic/cdf.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index c9a5d50..ee467a6 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -457,7 +457,8 @@ size_t + cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size) + { + size_t i, j; +- cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size); ++ cdf_secid_t maxsector = (cdf_secid_t)((sat->sat_len * size) ++ / sizeof(maxsector)); + + DPRINTF(("Chain:")); + for (j = i = 0; sid >= 0; i++, j++) { +@@ -467,8 +468,8 @@ cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size) + errno = EFTYPE; + return (size_t)-1; + } +- if (sid > maxsector) { +- DPRINTF(("Sector %d > %d\n", sid, maxsector)); ++ if (sid >= maxsector) { ++ DPRINTF(("Sector %d >= %d\n", sid, maxsector)); + errno = EFTYPE; + return (size_t)-1; + } +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-3487.patch b/SOURCES/file-5.11-CVE-2014-3487.patch new file mode 100644 index 0000000..fe9ed7b --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3487.patch @@ -0,0 +1,34 @@ +From 25b1dc917a53787dbb2532721ca22f3f36eb13c0 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 10 Jun 2014 14:33:37 +0200 +Subject: [PATCH] Fixed Bug #67413 fileinfo: cdf_read_property_info + insufficient boundary chec + +Upstream: +https://github.com/file/file/commit/93e063ee374b6a75729df9e7201fb511e47e259d + +Adapted for C standard. +--- + ext/fileinfo/libmagic/cdf.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index ee467a6..429f3b9 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -799,7 +799,11 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, + if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) + goto out; + for (i = 0; i < sh.sh_properties; i++) { +- size_t ofs = CDF_GETUINT32(p, (i << 1) + 1); ++ size_t ofs, tail = (i << 1) + 1; ++ if (cdf_check_stream_offset(sst, h, p, tail * sizeof(uint32_t), ++ __LINE__) == -1) ++ goto out; ++ ofs = CDF_GETUINT32(p, tail); + q = (const uint8_t *)(const void *) + ((const char *)(const void *)p + ofs + - 2 * sizeof(uint32_t)); +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-3538.patch b/SOURCES/file-5.11-CVE-2014-3538.patch new file mode 100644 index 0000000..c70f851 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3538.patch @@ -0,0 +1,84 @@ +diff --git a/src/softmagic.c b/src/softmagic.c +index f848f94..ee979b9 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -50,7 +50,7 @@ private int32_t mprint(struct magic_set *, struct magic *); + private int32_t moffset(struct magic_set *, struct magic *); + private void mdebug(uint32_t, const char *, size_t); + private int mcopy(struct magic_set *, union VALUETYPE *, int, int, +- const unsigned char *, uint32_t, size_t, size_t); ++ const unsigned char *, uint32_t, size_t, struct magic *); + private int mconvert(struct magic_set *, struct magic *); + private int print_sep(struct magic_set *, int); + private int handle_annotation(struct magic_set *, struct magic *); +@@ -936,7 +936,7 @@ mdebug(uint32_t offset, const char *str, size_t len) + + private int + mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, +- const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt) ++ const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) + { + /* + * Note: FILE_SEARCH and FILE_REGEX do not actually copy +@@ -956,15 +956,24 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, + const char *last; /* end of search region */ + const char *buf; /* start of search region */ + const char *end; +- size_t lines; ++ size_t lines, linecnt, bytecnt; + ++ linecnt = m->str_range; ++ bytecnt = linecnt * 80; ++ ++ if (bytecnt == 0) { ++ bytecnt = 8192; ++ } ++ if (bytecnt > nbytes) { ++ bytecnt = nbytes; ++ } + if (s == NULL) { + ms->search.s_len = 0; + ms->search.s = NULL; + return 0; + } + buf = RCAST(const char *, s) + offset; +- end = last = RCAST(const char *, s) + nbytes; ++ end = last = RCAST(const char *, s) + bytecnt; + /* mget() guarantees buf <= last */ + for (lines = linecnt, b = buf; lines && b < end && + ((b = CAST(const char *, +@@ -977,7 +986,7 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, + b++; + } + if (lines) +- last = RCAST(const char *, s) + nbytes; ++ last = RCAST(const char *, s) + bytecnt; + + ms->search.s = buf; + ms->search.s_len = last - buf; +@@ -1050,7 +1059,6 @@ mget(struct magic_set *ms, const unsigned char *s, + int recursion_level) + { + uint32_t offset = ms->offset; +- uint32_t count = m->str_range; + union VALUETYPE *p = &ms->ms_value; + + if (recursion_level >= 20) { +@@ -1058,7 +1066,7 @@ mget(struct magic_set *ms, const unsigned char *s, + return -1; + } + +- if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, nbytes, count) == -1) ++ if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, (uint32_t)nbytes, m) == -1) + return -1; + + if ((ms->flags & MAGIC_DEBUG) != 0) { +@@ -1546,7 +1554,7 @@ mget(struct magic_set *ms, const unsigned char *s, + if (m->flag & INDIROFFADD) { + offset += ms->c.li[cont_level-1].off; + } +- if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1) ++ if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) + return -1; + ms->offset = offset; + diff --git a/SOURCES/file-5.11-CVE-2014-3587.patch b/SOURCES/file-5.11-CVE-2014-3587.patch new file mode 100644 index 0000000..ff84da2 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3587.patch @@ -0,0 +1,26 @@ +From 7ba1409a1aee5925180de546057ddd84ff267947 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 14 Aug 2014 17:19:03 -0700 +Subject: [PATCH] Fix bug #67716 - Segfault in cdf.c + +--- + NEWS | 1 + + ext/fileinfo/libmagic/cdf.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c +index 429f3b9..2c0a2d9 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -807,7 +807,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, + q = (const uint8_t *)(const void *) + ((const char *)(const void *)p + ofs + - 2 * sizeof(uint32_t)); +- if (q > e) { ++ if (q < p || q > e) { + DPRINTF(("Ran of the end %p > %p\n", q, e)); + goto out; + } +-- +1.9.2 + diff --git a/SOURCES/file-5.11-CVE-2014-3710.patch b/SOURCES/file-5.11-CVE-2014-3710.patch new file mode 100644 index 0000000..1bc5dcf --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-3710.patch @@ -0,0 +1,35 @@ +From 1803228597e82218a8c105e67975bc50e6f5bf0d Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 22 Oct 2014 15:37:04 +0200 +Subject: [PATCH] Fix bug #68283: fileinfo: out-of-bounds read in elf note + headers + +Upstream commit +https://github.com/file/file/commit/39c7ac1106be844a5296d3eb5971946cc09ffda0 + +CVE -2014-3710 +--- + ext/fileinfo/libmagic/readelf.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c +index 1c3845f..bb6f70f 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -366,6 +366,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + uint32_t namesz, descsz; + unsigned char *nbuf = CAST(unsigned char *, vbuf); + ++ if (xnh_sizeof + offset > size) { ++ /* ++ * We're out of note headers. ++ */ ++ return xnh_sizeof + offset; ++ } ++ + (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof); + offset += xnh_sizeof; + +-- +2.1.0 + diff --git a/SOURCES/file-5.11-CVE-2014-8116.patch b/SOURCES/file-5.11-CVE-2014-8116.patch new file mode 100644 index 0000000..2dc1f61 --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-8116.patch @@ -0,0 +1,124 @@ +diff --git a/src/elfclass.h b/src/elfclass.h +index 010958a..0826ce3 100644 +--- a/src/elfclass.h ++++ b/src/elfclass.h +@@ -35,10 +35,12 @@ + switch (type) { + #ifdef ELFCORE + case ET_CORE: ++ phnum = elf_getu16(swap, elfhdr.e_phnum); ++ if (phnum > MAX_PHNUM) ++ return toomany(ms, "program", phnum); + flags |= FLAGS_IS_CORE; + if (dophn_core(ms, clazz, swap, fd, +- (off_t)elf_getu(swap, elfhdr.e_phoff), +- elf_getu16(swap, elfhdr.e_phnum), ++ (off_t)elf_getu(swap, elfhdr.e_phoff), phnum, + (size_t)elf_getu16(swap, elfhdr.e_phentsize), + fsize, &flags) == -1) + return -1; +@@ -46,18 +48,24 @@ + #endif + case ET_EXEC: + case ET_DYN: ++ phnum = elf_getu16(swap, elfhdr.e_phnum); ++ if (phnum > MAX_PHNUM) ++ return toomany(ms, "program", phnum); ++ shnum = elf_getu16(swap, elfhdr.e_shnum); ++ if (shnum > MAX_SHNUM) ++ return toomany(ms, "section", shnum); + if (dophn_exec(ms, clazz, swap, fd, +- (off_t)elf_getu(swap, elfhdr.e_phoff), +- elf_getu16(swap, elfhdr.e_phnum), ++ (off_t)elf_getu(swap, elfhdr.e_phoff), phnum, + (size_t)elf_getu16(swap, elfhdr.e_phentsize), +- fsize, &flags, elf_getu16(swap, elfhdr.e_shnum)) +- == -1) ++ fsize, &flags, shnum) == -1) + return -1; + /*FALLTHROUGH*/ + case ET_REL: ++ shnum = elf_getu16(swap, elfhdr.e_shnum); ++ if (shnum > MAX_SHNUM) ++ return toomany(ms, "section", shnum); + if (doshn(ms, clazz, swap, fd, +- (off_t)elf_getu(swap, elfhdr.e_shoff), +- elf_getu16(swap, elfhdr.e_shnum), ++ (off_t)elf_getu(swap, elfhdr.e_shoff), shnum, + (size_t)elf_getu16(swap, elfhdr.e_shentsize), + fsize, &flags, elf_getu16(swap, elfhdr.e_machine), + (int)elf_getu16(swap, elfhdr.e_shstrndx)) == -1) +diff --git a/src/readelf.c b/src/readelf.c +index de016b5..1f4d1f4 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -60,6 +60,18 @@ private uint16_t getu16(int, uint16_t); + private uint32_t getu32(int, uint32_t); + private uint64_t getu64(int, uint64_t); + ++#define MAX_PHNUM 2048 ++#define MAX_SHNUM 32768 ++ ++private int ++toomany(struct magic_set *ms, const char *name, uint16_t num) ++{ ++ if (file_printf(ms, ", too many %s header sections (%u)", name, num ++ ) == -1) ++ return -1; ++ return 0; ++} ++ + private uint16_t + getu16(int swap, uint16_t value) + { +@@ -388,13 +400,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + if (namesz & 0x80000000) { + (void)file_printf(ms, ", bad note name size 0x%lx", + (unsigned long)namesz); +- return offset; ++ return 0; + } + + if (descsz & 0x80000000) { + (void)file_printf(ms, ", bad note description size 0x%lx", + (unsigned long)descsz); +- return offset; ++ return 0; + } + + +@@ -851,6 +863,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + Elf32_Shdr sh32; + Elf64_Shdr sh64; + int stripped = 1; ++ size_t nbadcap = 0; + void *nbuf; + off_t noff, coff, name_off; + uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */ +@@ -928,6 +941,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + free(nbuf); + break; + case SHT_SUNW_cap: ++ if (nbadcap > 5) ++ break; + if (lseek(fd, xsh_offset, SEEK_SET) == (off_t)-1) { + file_badseek(ms); + return -1; +@@ -963,6 +978,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + (unsigned long long)xcap_tag, + (unsigned long long)xcap_val) == -1) + return -1; ++ if (nbadcap++ > 2) ++ coff = xsh_size; + break; + } + } +@@ -1142,7 +1159,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf, + int flags = 0; + Elf32_Ehdr elf32hdr; + Elf64_Ehdr elf64hdr; +- uint16_t type; ++ uint16_t type, phnum, shnum; + + if (ms->flags & (MAGIC_MIME|MAGIC_APPLE)) + return 0; diff --git a/SOURCES/file-5.11-CVE-2014-8117.patch b/SOURCES/file-5.11-CVE-2014-8117.patch new file mode 100644 index 0000000..f1ccb2f --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-8117.patch @@ -0,0 +1,129 @@ +diff --git a/src/file.h b/src/file.h +index 28f9bc7..f55d47f 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -446,6 +446,14 @@ protected int file_os2_apptype(struct magic_set *, const char *, const void *, + #endif /* __EMX__ */ + + ++typedef struct { ++ char *buf; ++ uint32_t offset; ++} file_pushbuf_t; ++ ++protected file_pushbuf_t *file_push_buffer(struct magic_set *); ++protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *); ++ + #ifndef COMPILE_ONLY + extern const char *file_names[]; + extern const size_t file_nnames; +diff --git a/src/funcs.c b/src/funcs.c +index 0d645eb..04bab02 100644 +--- a/src/funcs.c ++++ b/src/funcs.c +@@ -459,3 +459,43 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep) + return nm; + } + } ++ ++protected file_pushbuf_t * ++file_push_buffer(struct magic_set *ms) ++{ ++ file_pushbuf_t *pb; ++ ++ if (ms->event_flags & EVENT_HAD_ERR) ++ return NULL; ++ ++ if ((pb = (CAST(file_pushbuf_t *, malloc(sizeof(*pb))))) == NULL) ++ return NULL; ++ ++ pb->buf = ms->o.buf; ++ pb->offset = ms->offset; ++ ++ ms->o.buf = NULL; ++ ms->offset = 0; ++ ++ return pb; ++} ++ ++protected char * ++file_pop_buffer(struct magic_set *ms, file_pushbuf_t *pb) ++{ ++ char *rbuf; ++ ++ if (ms->event_flags & EVENT_HAD_ERR) { ++ free(pb->buf); ++ free(pb); ++ return NULL; ++ } ++ ++ rbuf = ms->o.buf; ++ ++ ms->o.buf = pb->buf; ++ ms->offset = pb->offset; ++ ++ free(pb); ++ return rbuf; ++} +diff --git a/src/softmagic.c b/src/softmagic.c +index ee979b9..3695add 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -60,6 +60,7 @@ private void cvt_32(union VALUETYPE *, const struct magic *); + private void cvt_64(union VALUETYPE *, const struct magic *); + + #define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o))) ++ + /* + * softmagic - lookup one file in parsed, in-memory copy of database + * Passed the name and FILE * of one file to be typed. +@@ -1060,6 +1061,9 @@ mget(struct magic_set *ms, const unsigned char *s, + { + uint32_t offset = ms->offset; + union VALUETYPE *p = &ms->ms_value; ++ file_pushbuf_t *pb; ++ char *rbuf; ++ int rv; + + if (recursion_level >= 20) { + file_error(ms, 0, "recursion nesting exceeded"); +@@ -1620,16 +1624,34 @@ mget(struct magic_set *ms, const unsigned char *s, + break; + + case FILE_INDIRECT: +- if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && +- file_printf(ms, "%s", m->desc) == -1) +- return -1; + if (offset == 0) + return 0; ++ + if (nbytes < offset) +- return 0; +- return file_softmagic(ms, s + offset, nbytes - offset, ++ return 0; ++ ++ if ((pb = file_push_buffer(ms)) == NULL) ++ return -1; ++ ++ rv = file_softmagic(ms, s + offset, nbytes - offset, + recursion_level, BINTEST, text); + ++ if ((ms->flags & MAGIC_DEBUG) != 0) ++ fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); ++ ++ rbuf = file_pop_buffer(ms, pb); ++ if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR) ++ return -1; ++ ++ if (rv == 1) { ++ if (file_printf(ms, "%s", rbuf) == -1) { ++ free(rbuf); ++ return -1; ++ } ++ } ++ free(rbuf); ++ return rv; ++ + case FILE_DEFAULT: /* nothing to check */ + default: + break; diff --git a/SOURCES/file-5.11-CVE-2014-9652.patch b/SOURCES/file-5.11-CVE-2014-9652.patch new file mode 100644 index 0000000..85df25d --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-9652.patch @@ -0,0 +1,34 @@ +From 59e63838913eee47f5c120a6c53d4565af638158 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Tue, 11 Nov 2014 17:48:23 +0000 +Subject: [PATCH] PR/398: Correctly truncate pascal strings (fixes out of + bounds read of 1, 2, or 4 bytes). + +--- + src/softmagic.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/softmagic.c b/src/softmagic.c +index dbb670a..2b15f2c 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -822,14 +822,17 @@ mconvert(struct magic_set *ms, struct magic *m) + size_t sz = file_pstring_length_size(m); + char *ptr1 = p->s, *ptr2 = ptr1 + sz; + size_t len = file_pstring_get_length(m, ptr1); +- if (len >= sizeof(p->s)) { ++ sz = sizeof(p->s) - sz; /* maximum length of string */ ++ if (len >= sz) { + /* + * The size of the pascal string length (sz) + * is 1, 2, or 4. We need at least 1 byte for NUL + * termination, but we've already truncated the + * string by p->s, so we need to deduct sz. ++ * Because we can use one of the bytes of the length ++ * after we shifted as NUL termination. + */ +- len = sizeof(p->s) - sz; ++ len = sz; + } + while (len--) + *ptr1++ = *ptr2++; diff --git a/SOURCES/file-5.11-CVE-2014-9653.patch b/SOURCES/file-5.11-CVE-2014-9653.patch new file mode 100644 index 0000000..b1765dc --- /dev/null +++ b/SOURCES/file-5.11-CVE-2014-9653.patch @@ -0,0 +1,67 @@ +diff --git a/src/readelf.c b/src/readelf.c +index 1f4d1f4..05ec736 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -327,7 +327,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + * Loop through all the program headers. + */ + for ( ; num; num--) { +- if (pread(fd, xph_addr, xph_sizeof, off) == -1) { ++ if (pread(fd, xph_addr, xph_sizeof, off) < (ssize_t)xph_sizeof) { + file_badread(ms); + return -1; + } +@@ -869,6 +869,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */ + uint64_t cap_sf1 = 0; /* SunOS 5.x software capabilites */ + char name[50]; ++ ssize_t namesize; + + if (size != xsh_sizeof) { + if (file_printf(ms, ", corrupted section header size") == -1) +@@ -877,7 +878,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + } + + /* Read offset of name section to be able to read section names later */ +- if (pread(fd, xsh_addr, xsh_sizeof, off + size * strtab) == -1) { ++ if (pread(fd, xsh_addr, xsh_sizeof, off + size * strtab) < (ssize_t)xsh_sizeof) { + file_badread(ms); + return -1; + } +@@ -885,15 +886,15 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + + for ( ; num; num--) { + /* Read the name of this section. */ +- if (pread(fd, name, sizeof(name), name_off + xsh_name) == -1) { ++ if ((namesize = pread(fd, name, sizeof(name) - 1, name_off + xsh_name)) == -1) { + file_badread(ms); + return -1; + } +- name[sizeof(name) - 1] = '\0'; ++ name[namesize] = '\0'; + if (strcmp(name, ".debug_info") == 0) + stripped = 0; + +- if (pread(fd, xsh_addr, xsh_sizeof, off) == -1) { ++ if (pread(fd, xsh_addr, xsh_sizeof, off) < (ssize_t)xsh_sizeof) { + file_badread(ms); + return -1; + } +@@ -923,7 +924,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + " for note"); + return -1; + } +- if (pread(fd, nbuf, xsh_size, xsh_offset) == -1) { ++ if (pread(fd, nbuf, xsh_size, xsh_offset) < (ssize_t)xsh_size) { + file_badread(ms); + free(nbuf); + return -1; +@@ -1076,7 +1077,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + } + + for ( ; num; num--) { +- if (pread(fd, xph_addr, xph_sizeof, off) == -1) { ++ if (pread(fd, xph_addr, xph_sizeof, off) < (ssize_t)xph_sizeof) { + file_badread(ms); + return -1; + } diff --git a/SOURCES/file-5.11-add-aarch64.patch b/SOURCES/file-5.11-add-aarch64.patch new file mode 100644 index 0000000..89cc430 --- /dev/null +++ b/SOURCES/file-5.11-add-aarch64.patch @@ -0,0 +1,32 @@ +From a5c989d3d36e51293a0474c4653f595dcfb94751 Mon Sep 17 00:00:00 2001 +From: Jeffrey Bastian +Date: Thu, 20 Feb 2014 15:45:42 -0500 +Subject: [PATCH] add aarch64 + +backport of upstream https://github.com/glensc/file/commit/2dccf6a6615f +--- + magic/Magdir/elf | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/magic/Magdir/elf b/magic/Magdir/elf +index 8e3b7bc..e0e9937 100644 +--- a/magic/Magdir/elf ++++ b/magic/Magdir/elf +@@ -148,12 +148,11 @@ + >>18 leshort 97 NatSemi 32k, + >>18 leshort 106 Analog Devices Blackfin, + >>18 leshort 113 Altera Nios II, +->>18 leshort 0xae META, ++>>18 leshort 174 META, ++>>18 leshort 183 ARM aarch64, + >>18 leshort 187 Tilera TILE64, + >>18 leshort 188 Tilera TILEPro, + >>18 leshort 191 Tilera TILE-Gx, +->>18 leshort 0x3426 OpenRISC (obsolete), +->>18 leshort 0x8472 OpenRISC (obsolete), + >>18 leshort 0x9026 Alpha (unofficial), + >>20 lelong 0 invalid version + >>20 lelong 1 version 1 +-- +1.8.3.1 + diff --git a/SOURCES/file-5.11-auxv.patch b/SOURCES/file-5.11-auxv.patch new file mode 100644 index 0000000..9fddea9 --- /dev/null +++ b/SOURCES/file-5.11-auxv.patch @@ -0,0 +1,564 @@ +diff --git a/src/readelf.c b/src/readelf.c +index 9651239..807affc 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -41,6 +41,8 @@ FILE_RCSID("@(#)$File: readelf.c,v 1.90 2011/08/23 08:01:12 christos Exp $") + #include "readelf.h" + #include "magic.h" + ++#define __arraycount(a) (sizeof(a) / sizeof(a[0])) ++ + #ifdef ELFCORE + private int dophn_core(struct magic_set *, int, int, int, off_t, int, size_t, + off_t, int *); +@@ -50,7 +52,7 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, + private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, + off_t, int *, int, int); + private size_t donote(struct magic_set *, void *, size_t, size_t, int, +- int, size_t, int *); ++ int, size_t, int *, int, off_t, int, off_t); + + #define ELF_ALIGN(a) ((((a) + align - 1) / align) * align) + +@@ -184,6 +186,11 @@ getu64(int swap, uint64_t value) + elf_getu32(swap, ph32.p_align) : 4) \ + : (off_t) (ph64.p_align ? \ + elf_getu64(swap, ph64.p_align) : 4))) ++#define xph_vaddr (size_t)((clazz == ELFCLASS32 \ ++ ? (off_t) (ph32.p_vaddr ? \ ++ elf_getu32(swap, ph32.p_vaddr) : 4) \ ++ : (off_t) (ph64.p_vaddr ? \ ++ elf_getu64(swap, ph64.p_vaddr) : 4))) + #define xph_filesz (size_t)((clazz == ELFCLASS32 \ + ? elf_getu32(swap, ph32.p_filesz) \ + : elf_getu64(swap, ph64.p_filesz))) +@@ -194,8 +201,8 @@ getu64(int swap, uint64_t value) + ? elf_getu32(swap, ph32.p_memsz) \ + : elf_getu64(swap, ph64.p_memsz))) + #define xnh_sizeof (clazz == ELFCLASS32 \ +- ? sizeof nh32 \ +- : sizeof nh64) ++ ? sizeof(nh32) \ ++ : sizeof(nh64)) + #define xnh_type (clazz == ELFCLASS32 \ + ? elf_getu32(swap, nh32.n_type) \ + : elf_getu32(swap, nh64.n_type)) +@@ -220,6 +227,18 @@ getu64(int swap, uint64_t value) + #define xcap_val (clazz == ELFCLASS32 \ + ? elf_getu32(swap, cap32.c_un.c_val) \ + : elf_getu64(swap, cap64.c_un.c_val)) ++#define xauxv_addr (clazz == ELFCLASS32 \ ++ ? (void *)&auxv32 \ ++ : (void *)&auxv64) ++#define xauxv_sizeof (clazz == ELFCLASS32 \ ++ ? sizeof(auxv32) \ ++ : sizeof(auxv64)) ++#define xauxv_type (clazz == ELFCLASS32 \ ++ ? elf_getu32(swap, auxv32.a_type) \ ++ : elf_getu64(swap, auxv64.a_type)) ++#define xauxv_val (clazz == ELFCLASS32 \ ++ ? elf_getu32(swap, auxv32.a_v) \ ++ : elf_getu64(swap, auxv64.a_v)) + + #ifdef ELFCORE + /* +@@ -306,6 +325,7 @@ private const char os_style_names[][8] = { + #define FLAGS_DID_BUILD_ID 0x04 + #define FLAGS_DID_CORE_STYLE 0x08 + #define FLAGS_IS_CORE 0x10 ++#define FLAGS_DID_AUXV 0x200 + + private int + dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, +@@ -316,6 +336,8 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + size_t offset, len; + unsigned char nbuf[BUFSIZ]; + ssize_t bufsize; ++ off_t ph_off = off; ++ int ph_num = num; + + if (size != xph_sizeof) { + if (file_printf(ms, ", corrupted program header size") == -1) +@@ -355,7 +377,8 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + if (offset >= (size_t)bufsize) + break; + offset = donote(ms, nbuf, offset, (size_t)bufsize, +- clazz, swap, 4, flags); ++ clazz, swap, 4, flags, fd, ph_off, ++ ph_num, fsize); + if (offset == 0) + break; + +@@ -365,9 +388,160 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + } + #endif + ++private off_t ++get_offset_from_virtaddr(struct magic_set *ms, int swap, int clazz, int fd, ++ off_t off, int num, off_t fsize, uint64_t virtaddr) ++{ ++ Elf32_Phdr ph32; ++ Elf64_Phdr ph64; ++ ++ /* ++ * Loop through all the program headers and find the header with ++ * virtual address in which the "virtaddr" belongs to. ++ */ ++ for ( ; num; num--) { ++ if (pread(fd, xph_addr, xph_sizeof, off) < (ssize_t)xph_sizeof) { ++ file_badread(ms); ++ return -1; ++ } ++ off += xph_sizeof; ++ ++ if (xph_offset > fsize) { ++ /* Perhaps warn here */ ++ continue; ++ } ++ ++ if (virtaddr >= xph_vaddr && virtaddr < xph_vaddr + xph_filesz) ++ return xph_offset + (virtaddr - xph_vaddr); ++ } ++ return 0; ++} ++ ++private size_t ++get_string_on_virtaddr(struct magic_set *ms, ++ int swap, int clazz, int fd, off_t ph_off, int ph_num, ++ off_t fsize, uint64_t virtaddr, char *buf, ssize_t buflen) ++{ ++ char *bptr; ++ off_t offset; ++ ++ if (buflen == 0) ++ return 0; ++ ++ offset = get_offset_from_virtaddr(ms, swap, clazz, fd, ph_off, ph_num, ++ fsize, virtaddr); ++ if (offset < 0 || (buflen = pread(fd, buf, buflen, offset)) <= 0) { ++ file_badread(ms); ++ return 0; ++ } ++ ++ buf[buflen - 1] = '\0'; ++ ++ /* We expect only printable characters, so return if buffer contains ++ * non-printable character before the '\0' or just '\0'. */ ++ for (bptr = buf; *bptr && isprint((unsigned char)*bptr); bptr++) ++ continue; ++ if (*bptr != '\0') ++ return 0; ++ ++ return bptr - buf; ++} ++ ++ ++private int ++do_auxv_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, ++ int swap, uint32_t namesz __attribute__((__unused__)), ++ uint32_t descsz __attribute__((__unused__)), ++ size_t noff __attribute__((__unused__)), size_t doff, ++ int *flags, size_t size __attribute__((__unused__)), int clazz, ++ int fd, off_t ph_off, int ph_num, off_t fsize) ++{ ++#ifdef ELFCORE ++ Aux32Info auxv32; ++ Aux64Info auxv64; ++ size_t elsize = xauxv_sizeof; ++ const char *tag; ++ int is_string; ++ size_t nval; ++ size_t off; ++ ++ ++ if (type != NT_AUXV || (*flags & FLAGS_IS_CORE) == 0) ++ return 0; ++ ++ *flags |= FLAGS_DID_AUXV; ++ ++ nval = 0; ++ for (off = 0; off + elsize <= descsz; off += elsize) { ++ (void)memcpy(xauxv_addr, &nbuf[doff + off], xauxv_sizeof); ++ /* Limit processing to 50 vector entries to prevent DoS */ ++ if (nval++ >= 50) { ++ file_error(ms, 0, "Too many ELF Auxv elements"); ++ return 1; ++ } ++ ++ switch(xauxv_type) { ++ case AT_LINUX_EXECFN: ++ is_string = 1; ++ tag = "execfn"; ++ break; ++ case AT_LINUX_PLATFORM: ++ is_string = 1; ++ tag = "platform"; ++ break; ++ case AT_LINUX_UID: ++ is_string = 0; ++ tag = "real uid"; ++ break; ++ case AT_LINUX_GID: ++ is_string = 0; ++ tag = "real gid"; ++ break; ++ case AT_LINUX_EUID: ++ is_string = 0; ++ tag = "effective uid"; ++ break; ++ case AT_LINUX_EGID: ++ is_string = 0; ++ tag = "effective gid"; ++ break; ++ default: ++ is_string = 0; ++ tag = NULL; ++ break; ++ } ++ ++ if (tag == NULL) ++ continue; ++ ++ if (is_string) { ++ char buf[256]; ++ ssize_t buflen; ++ buflen = get_string_on_virtaddr(ms, swap, clazz, fd, ++ ph_off, ph_num, fsize, xauxv_val, buf, sizeof(buf)); ++ ++ if (buflen == 0) ++ continue; ++ ++ if (file_printf(ms, ", %s: '%s'", tag, buf) == -1) ++ return 0; ++ } else { ++ if (file_printf(ms, ", %s: %d", tag, (int) xauxv_val) ++ == -1) ++ return 0; ++ } ++ } ++ return 1; ++#else ++ return 0; ++#endif ++} ++ ++ + private size_t + donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, +- int clazz, int swap, size_t align, int *flags) ++ int clazz, int swap, size_t align, int *flags, ++ int fd, off_t ph_off, int ph_num, off_t fsize) + { + Elf32_Nhdr nh32; + Elf64_Nhdr nh64; +@@ -390,6 +564,7 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + + namesz = xnh_namesz; + descsz = xnh_descsz; ++ + if ((namesz == 0) && (descsz == 0)) { + /* + * We're out of note headers. +@@ -438,37 +613,37 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + (void)memcpy(desc, &nbuf[doff], sizeof(desc)); + + if (file_printf(ms, ", for GNU/") == -1) +- return size; ++ return offset; + switch (elf_getu32(swap, desc[0])) { + case GNU_OS_LINUX: + if (file_printf(ms, "Linux") == -1) +- return size; ++ return offset; + break; + case GNU_OS_HURD: + if (file_printf(ms, "Hurd") == -1) +- return size; ++ return offset; + break; + case GNU_OS_SOLARIS: + if (file_printf(ms, "Solaris") == -1) +- return size; ++ return offset; + break; + case GNU_OS_KFREEBSD: + if (file_printf(ms, "kFreeBSD") == -1) +- return size; ++ return offset; + break; + case GNU_OS_KNETBSD: + if (file_printf(ms, "kNetBSD") == -1) +- return size; ++ return offset; + break; + default: + if (file_printf(ms, "") == -1) +- return size; ++ return offset; + } + if (file_printf(ms, " %d.%d.%d", elf_getu32(swap, desc[1]), + elf_getu32(swap, desc[2]), elf_getu32(swap, desc[3])) == -1) +- return size; ++ return offset; + *flags |= FLAGS_DID_NOTE; +- return size; ++ return offset; + } + + if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && +@@ -492,7 +667,7 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + desc = elf_getu32(swap, desc); + + if (file_printf(ms, ", for NetBSD") == -1) +- return size; ++ return offset; + /* + * The version number used to be stuck as 199905, and was thus + * basically content-free. Newer versions of NetBSD have fixed +@@ -512,23 +687,23 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + uint32_t ver_maj = desc / 100000000; + + if (file_printf(ms, " %u.%u", ver_maj, ver_min) == -1) +- return size; ++ return offset; + if (ver_rel == 0 && ver_patch != 0) { + if (file_printf(ms, ".%u", ver_patch) == -1) +- return size; ++ return offset; + } else if (ver_rel != 0) { + while (ver_rel > 26) { + if (file_printf(ms, "Z") == -1) +- return size; ++ return offset; + ver_rel -= 26; + } + if (file_printf(ms, "%c", 'A' + ver_rel - 1) + == -1) +- return size; ++ return offset; + } + } + *flags |= FLAGS_DID_NOTE; +- return size; ++ return offset; + } + + if (namesz == 8 && strcmp((char *)&nbuf[noff], "FreeBSD") == 0 && +@@ -537,7 +712,7 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + (void)memcpy(&desc, &nbuf[doff], sizeof(desc)); + desc = elf_getu32(swap, desc); + if (file_printf(ms, ", for FreeBSD") == -1) +- return size; ++ return offset; + + /* + * Contents is __FreeBSD_version, whose relation to OS +@@ -567,69 +742,69 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + */ + if (desc == 460002) { + if (file_printf(ms, " 4.6.2") == -1) +- return size; ++ return offset; + } else if (desc < 460100) { + if (file_printf(ms, " %d.%d", desc / 100000, + desc / 10000 % 10) == -1) +- return size; ++ return offset; + if (desc / 1000 % 10 > 0) + if (file_printf(ms, ".%d", desc / 1000 % 10) + == -1) +- return size; ++ return offset; + if ((desc % 1000 > 0) || (desc % 100000 == 0)) + if (file_printf(ms, " (%d)", desc) == -1) +- return size; ++ return offset; + } else if (desc < 500000) { + if (file_printf(ms, " %d.%d", desc / 100000, + desc / 10000 % 10 + desc / 1000 % 10) == -1) +- return size; ++ return offset; + if (desc / 100 % 10 > 0) { + if (file_printf(ms, " (%d)", desc) == -1) +- return size; ++ return offset; + } else if (desc / 10 % 10 > 0) { + if (file_printf(ms, ".%d", desc / 10 % 10) + == -1) +- return size; ++ return offset; + } + } else { + if (file_printf(ms, " %d.%d", desc / 100000, + desc / 1000 % 100) == -1) +- return size; ++ return offset; + if ((desc / 100 % 10 > 0) || + (desc % 100000 / 100 == 0)) { + if (file_printf(ms, " (%d)", desc) == -1) +- return size; ++ return offset; + } else if (desc / 10 % 10 > 0) { + if (file_printf(ms, ".%d", desc / 10 % 10) + == -1) +- return size; ++ return offset; + } + } + *flags |= FLAGS_DID_NOTE; +- return size; ++ return offset; + } + + if (namesz == 8 && strcmp((char *)&nbuf[noff], "OpenBSD") == 0 && + xnh_type == NT_OPENBSD_VERSION && descsz == 4) { + if (file_printf(ms, ", for OpenBSD") == -1) +- return size; ++ return offset; + /* Content of note is always 0 */ + *flags |= FLAGS_DID_NOTE; +- return size; ++ return offset; + } + + if (namesz == 10 && strcmp((char *)&nbuf[noff], "DragonFly") == 0 && + xnh_type == NT_DRAGONFLY_VERSION && descsz == 4) { + uint32_t desc; + if (file_printf(ms, ", for DragonFly") == -1) +- return size; ++ return offset; + (void)memcpy(&desc, &nbuf[doff], sizeof(desc)); + desc = elf_getu32(swap, desc); + if (file_printf(ms, " %d.%d.%d", desc / 100000, + desc / 10000 % 10, desc % 10000) == -1) +- return size; ++ return offset; + *flags |= FLAGS_DID_NOTE; +- return size; ++ return offset; + } + + core: +@@ -661,14 +836,22 @@ core: + os_style = OS_STYLE_NETBSD; + } + ++ if ((*flags & FLAGS_DID_AUXV) == 0) { ++ if (do_auxv_note(ms, nbuf, xnh_type, swap, ++ namesz, descsz, noff, doff, flags, size, clazz, ++ fd, ph_off, ph_num, fsize)) ++ return offset; ++ } ++ ++ + #ifdef ELFCORE + if ((*flags & FLAGS_DID_CORE) != 0) +- return size; ++ return offset; + + if (os_style != -1 && (*flags & FLAGS_DID_CORE_STYLE) == 0) { + if (file_printf(ms, ", %s-style", os_style_names[os_style]) + == -1) +- return size; ++ return offset; + *flags |= FLAGS_DID_CORE_STYLE; + } + +@@ -683,7 +866,7 @@ core: + */ + if (file_printf(ms, ", from '%.31s'", + &nbuf[doff + 0x7c]) == -1) +- return size; ++ return offset; + + /* + * Extract the signal number. It is at +@@ -693,9 +876,9 @@ core: + sizeof(signo)); + if (file_printf(ms, " (signal %u)", + elf_getu32(swap, signo)) == -1) +- return size; ++ return offset; + *flags |= FLAGS_DID_CORE; +- return size; ++ return offset; + } + break; + +@@ -793,9 +976,9 @@ core: + cp--; + if (file_printf(ms, ", from '%.*s'", + (int)(cp - cname), cname) == -1) +- return size; ++ return offset; + *flags |= FLAGS_DID_CORE; +- return size; ++ return offset; + + tryanother: + ; +@@ -936,7 +1119,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + if (noff >= (off_t)xsh_size) + break; + noff = donote(ms, nbuf, (size_t)noff, +- xsh_size, clazz, swap, 4, flags); ++ xsh_size, clazz, swap, 4, flags, 0, 0, 0, 0); + if (noff == 0) + break; + } +@@ -1130,7 +1313,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + break; + offset = donote(ms, nbuf, offset, + (size_t)bufsize, clazz, swap, align, +- flags); ++ flags, 0, 0, 0, 0); + if (offset == 0) + break; + } +diff --git a/src/readelf.h b/src/readelf.h +index ab4b5d1..fb34585 100644 +--- a/src/readelf.h ++++ b/src/readelf.h +@@ -62,6 +62,42 @@ typedef uint8_t Elf64_Char; + #define EI_NIDENT 16 + + typedef struct { ++ Elf32_Word a_type; /* 32-bit id */ ++ Elf32_Word a_v; /* 32-bit id */ ++} Aux32Info; ++ ++typedef struct { ++ Elf64_Xword a_type; /* 64-bit id */ ++ Elf64_Xword a_v; /* 64-bit id */ ++} Aux64Info; ++ ++#define AT_NULL 0 /* end of vector */ ++#define AT_IGNORE 1 /* entry should be ignored */ ++#define AT_EXECFD 2 /* file descriptor of program */ ++#define AT_PHDR 3 /* program headers for program */ ++#define AT_PHENT 4 /* size of program header entry */ ++#define AT_PHNUM 5 /* number of program headers */ ++#define AT_PAGESZ 6 /* system page size */ ++#define AT_BASE 7 /* base address of interpreter */ ++#define AT_FLAGS 8 /* flags */ ++#define AT_ENTRY 9 /* entry point of program */ ++#define AT_LINUX_NOTELF 10 /* program is not ELF */ ++#define AT_LINUX_UID 11 /* real uid */ ++#define AT_LINUX_EUID 12 /* effective uid */ ++#define AT_LINUX_GID 13 /* real gid */ ++#define AT_LINUX_EGID 14 /* effective gid */ ++#define AT_LINUX_PLATFORM 15 /* string identifying CPU for optimizations */ ++#define AT_LINUX_HWCAP 16 /* arch dependent hints at CPU capabilities */ ++#define AT_LINUX_CLKTCK 17 /* frequency at which times() increments */ ++/* AT_* values 18 through 22 are reserved */ ++#define AT_LINUX_SECURE 23 /* secure mode boolean */ ++#define AT_LINUX_BASE_PLATFORM 24 /* string identifying real platform, may ++ * differ from AT_PLATFORM. */ ++#define AT_LINUX_RANDOM 25 /* address of 16 random bytes */ ++#define AT_LINUX_HWCAP2 26 /* extension of AT_HWCAP */ ++#define AT_LINUX_EXECFN 31 /* filename of program */ ++ ++typedef struct { + Elf32_Char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; diff --git a/SOURCES/file-5.11-buildid.patch b/SOURCES/file-5.11-buildid.patch new file mode 100644 index 0000000..d27e127 --- /dev/null +++ b/SOURCES/file-5.11-buildid.patch @@ -0,0 +1,32 @@ +From 26f146f7dcf96f8f0a5b2f0503bdb4c46b74cf56 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Wed, 31 Oct 2012 17:03:41 +0000 +Subject: [PATCH] PR/208: Fix buildid format + +--- + src/readelf.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/readelf.c b/src/readelf.c +index deb6d31..158f789 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -473,13 +473,14 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, + + if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && + xnh_type == NT_GNU_BUILD_ID && (descsz == 16 || descsz == 20)) { +- uint32_t desc[5], i; +- if (file_printf(ms, ", BuildID[%s]=0x", descsz == 16 ? "md5/uuid" : ++ uint8_t desc[20]; ++ uint32_t i; ++ if (file_printf(ms, ", BuildID[%s]=", descsz == 16 ? "md5/uuid" : + "sha1") == -1) + return size; + (void)memcpy(desc, &nbuf[doff], descsz); +- for (i = 0; i < descsz >> 2; i++) +- if (file_printf(ms, "%.8x", desc[i]) == -1) ++ for (i = 0; i < descsz; i++) ++ if (file_printf(ms, "%02x", desc[i]) == -1) + return size; + *flags |= FLAGS_DID_BUILD_ID; + } diff --git a/SOURCES/file-5.11-compress.patch b/SOURCES/file-5.11-compress.patch new file mode 100644 index 0000000..04241d5 --- /dev/null +++ b/SOURCES/file-5.11-compress.patch @@ -0,0 +1,13 @@ +diff --git a/src/compress.c b/src/compress.c +index 2b05352..ccb1cfd 100644 +--- a/src/compress.c ++++ b/src/compress.c +@@ -183,7 +183,7 @@ sread(int fd, void *buf, size_t n, int canbepipe __attribute__ ((unused))) + goto nocheck; + + #ifdef FIONREAD +- if ((canbepipe && (ioctl(fd, FIONREAD, &t) == -1)) || (t == 0)) { ++ if (canbepipe && ((ioctl(fd, FIONREAD, &t) == -1) || (t == 0))) { + #ifdef FD_ZERO + for (cnt = 0;; cnt++) { + fd_set check; diff --git a/SOURCES/file-5.11-dump-twice.patch b/SOURCES/file-5.11-dump-twice.patch new file mode 100644 index 0000000..1273b50 --- /dev/null +++ b/SOURCES/file-5.11-dump-twice.patch @@ -0,0 +1,13 @@ +diff --git a/magic/Magdir/convex b/magic/Magdir/convex +index 6141a82..4e096b9 100644 +--- a/magic/Magdir/convex ++++ b/magic/Magdir/convex +@@ -30,8 +30,6 @@ + # The restore program uses these number to determine how the data is + # to be extracted. + # +-24 belong =60011 dump format, 4.1 BSD or earlier +-24 belong =60012 dump format, 4.2 or 4.3 BSD without IDC + 24 belong =60013 dump format, 4.2 or 4.3 BSD (IDC compatible) + 24 belong =60014 dump format, Convex Storage Manager by-reference dump + # diff --git a/SOURCES/file-5.11-exit-code.patch b/SOURCES/file-5.11-exit-code.patch new file mode 100644 index 0000000..130c503 --- /dev/null +++ b/SOURCES/file-5.11-exit-code.patch @@ -0,0 +1,56 @@ +diff --git a/src/fsmagic.c b/src/fsmagic.c +index 7200271..1ffe667 100644 +--- a/src/fsmagic.c ++++ b/src/fsmagic.c +@@ -124,14 +124,12 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb) + + if (ret) { + if (ms->flags & MAGIC_ERROR) { +- file_error(ms, errno, "cannot stat `%s'", fn); ++ file_error(ms, errno, "cannot stat"); + return -1; + } +- if (file_printf(ms, "cannot open `%s' (%s)", +- fn, strerror(errno)) == -1) ++ if (file_printf(ms, "cannot open (%s)", strerror(errno)) == -1) + return -1; +- ms->event_flags |= EVENT_HAD_ERR; +- return -1; ++ return 0; + } + + if (!mime) { +diff --git a/src/magic.c b/src/magic.c +index 2b61080..a184a35 100644 +--- a/src/magic.c ++++ b/src/magic.c +@@ -417,8 +417,9 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) + ispipe = 1; + } else { + int flags = O_RDONLY|O_BINARY; ++ int okstat = stat(inname, &sb) == 0; + +- if (stat(inname, &sb) == 0 && S_ISFIFO(sb.st_mode)) { ++ if (okstat && S_ISFIFO(sb.st_mode)) { + #ifdef O_NONBLOCK + flags |= O_NONBLOCK; + #endif +@@ -427,7 +428,8 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) + + errno = 0; + if ((fd = open(inname, flags)) < 0) { +- if (unreadable_info(ms, sb.st_mode, inname) == -1) ++ if (okstat && ++ unreadable_info(ms, sb.st_mode, inname) == -1) + goto done; + rv = 0; + goto done; +@@ -462,7 +464,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) + + } else { + if ((nbytes = read(fd, (char *)buf, HOWMANY)) == -1) { +- file_error(ms, errno, "cannot read `%s'", inname); ++ file_error(ms, errno, "cannot read"); + goto done; + } + } diff --git a/SOURCES/file-5.11-gzip-strength.patch b/SOURCES/file-5.11-gzip-strength.patch new file mode 100644 index 0000000..ddcdd74 --- /dev/null +++ b/SOURCES/file-5.11-gzip-strength.patch @@ -0,0 +1,30 @@ +From af069cb735df84c45b9ab06a789eb9fd89bee38d Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Wed, 11 Dec 2013 17:55:00 +0000 +Subject: [PATCH] Bump the strength of gzip and reorder printing of attributes + (Thomas Ledoux) + +Upstream-commit: 5c945517d8b4e4c7db9f132f04fa4814dc957a83 + +Rordering of attributes dropped from this patch to stay compatible. + +Signed-off-by: Kamil Dudka +--- + magic/Magdir/compress | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/magic/Magdir/compress b/magic/Magdir/compress +index 94c209d..5dc4dcf 100644 +--- a/magic/Magdir/compress ++++ b/magic/Magdir/compress +@@ -22,6 +22,7 @@ + # other than 8 ("deflate", the only method defined in RFC 1952). + 0 string \037\213 gzip compressed data + !:mime application/x-gzip ++!:strength * 2 + >2 byte <8 \b, reserved method + >2 byte >8 \b, unknown method + >3 byte &0x01 \b, ASCII +-- +2.13.5 + diff --git a/SOURCES/file-5.11-ia64-swap.patch b/SOURCES/file-5.11-ia64-swap.patch new file mode 100644 index 0000000..bf2fbb9 --- /dev/null +++ b/SOURCES/file-5.11-ia64-swap.patch @@ -0,0 +1,12 @@ +diff --git a/magic/Magdir/linux b/magic/Magdir/linux +index 8d4c60a..aa8d1aa 100644 +--- a/magic/Magdir/linux ++++ b/magic/Magdir/linux +@@ -88,6 +88,7 @@ + # From Daniel Novotny + # swap file for PowerPC + 65526 string SWAPSPACE2 Linux/ppc swap file ++16374 string SWAPSPACE2 Linux/ia64 swap file + # + # Linux kernel boot images, from Albert Cahalan + # and others such as Axel Kohlmeyer diff --git a/SOURCES/file-5.11-java1718.patch b/SOURCES/file-5.11-java1718.patch new file mode 100644 index 0000000..5a8ed81 --- /dev/null +++ b/SOURCES/file-5.11-java1718.patch @@ -0,0 +1,13 @@ +diff --git a/magic/Magdir/cafebabe b/magic/Magdir/cafebabe +index 6400e2f..6f2e96d 100644 +--- a/magic/Magdir/cafebabe ++++ b/magic/Magdir/cafebabe +@@ -27,6 +27,8 @@ + >>4 belong 0x0030 (Java 1.4) + >>4 belong 0x0031 (Java 1.5) + >>4 belong 0x0032 (Java 1.6) ++>>4 belong 0x0033 (Java 1.7) ++>>4 belong 0x0034 (Java 1.8) + + + 0 belong 0xcafebabe diff --git a/SOURCES/file-5.11-magicmgc-home.patch b/SOURCES/file-5.11-magicmgc-home.patch new file mode 100644 index 0000000..9750c27 --- /dev/null +++ b/SOURCES/file-5.11-magicmgc-home.patch @@ -0,0 +1,32 @@ +diff --git a/src/magic.c b/src/magic.c +index 5403951..2b61080 100644 +--- a/src/magic.c ++++ b/src/magic.c +@@ -101,16 +101,21 @@ get_default_magic(void) + if ((home = getenv("HOME")) == NULL) + return MAGIC; + +- if (asprintf(&hmagicpath, "%s/.magic", home) < 0) ++ if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0) + return MAGIC; +- if (stat(hmagicpath, &st) == -1) +- goto out; +- if (S_ISDIR(st.st_mode)) { ++ if (stat(hmagicpath, &st) == -1) { + free(hmagicpath); +- if (asprintf(&hmagicpath, "%s/%s", home, hmagic) < 0) ++ if (asprintf(&hmagicpath, "%s/.magic", home) < 0) + return MAGIC; +- if (access(hmagicpath, R_OK) == -1) ++ if (stat(hmagicpath, &st) == -1) + goto out; ++ if (S_ISDIR(st.st_mode)) { ++ free(hmagicpath); ++ if (asprintf(&hmagicpath, "%s/%s", home, hmagic) < 0) ++ return MAGIC; ++ if (access(hmagicpath, R_OK) == -1) ++ goto out; ++ } + } + + if (asprintf(&default_magic, "%s:%s", hmagicpath, MAGIC) < 0) diff --git a/SOURCES/file-5.11-newpython.patch b/SOURCES/file-5.11-newpython.patch new file mode 100644 index 0000000..ad80258 --- /dev/null +++ b/SOURCES/file-5.11-newpython.patch @@ -0,0 +1,14 @@ +diff --git a/magic/Magdir/python b/magic/Magdir/python +index 23f8d6b..6d7121a 100644 +--- a/magic/Magdir/python ++++ b/magic/Magdir/python +@@ -22,6 +22,9 @@ + 0 belong 0x3b0c0d0a python 3.0 byte-compiled + 0 belong 0x4f0c0d0a python 3.1 byte-compiled + 0 belong 0x6c0c0d0a python 3.2 byte-compiled ++0 belong 0x9e0c0d0a python 3.3 byte-compiled ++0 belong 0xee0c0d0a python 3.4 byte-compiled ++0 belong 0x160d0d0a python 3.5 byte-compiled + + 0 search/1/w #!\ /usr/bin/python Python script text executable + !:mime text/x-python diff --git a/SOURCES/file-5.11-offset-oob.patch b/SOURCES/file-5.11-offset-oob.patch new file mode 100644 index 0000000..e72ebda --- /dev/null +++ b/SOURCES/file-5.11-offset-oob.patch @@ -0,0 +1,31 @@ +diff --git a/src/softmagic.c b/src/softmagic.c +index 8d08cad..6dc86f5 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -41,8 +41,6 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $") + #include + #include + +-#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o))) +- + private int match(struct magic_set *, struct magic *, uint32_t, + const unsigned char *, size_t, int, int, int); + private int mget(struct magic_set *, const unsigned char *, +@@ -1601,7 +1599,7 @@ mget(struct magic_set *ms, const unsigned char *s, + break; + + case FILE_REGEX: +- if (OFFSET_OOB(nbytes, offset, 0)) ++ if (nbytes < offset) + return 0; + break; + +@@ -1611,7 +1609,7 @@ mget(struct magic_set *ms, const unsigned char *s, + return -1; + if (offset == 0) + return 0; +- if (OFFSET_OOB(nbytes, offset, 0)) ++ if (nbytes < offset) + return 0; + return file_softmagic(ms, s + offset, nbytes - offset, + recursion_level, BINTEST, text); diff --git a/SOURCES/file-5.11-pascal.patch b/SOURCES/file-5.11-pascal.patch new file mode 100644 index 0000000..5a39a4b --- /dev/null +++ b/SOURCES/file-5.11-pascal.patch @@ -0,0 +1,16 @@ +diff --git a/magic/Magdir/pascal b/magic/Magdir/pascal +index a134a47..d8e61c6 100644 +--- a/magic/Magdir/pascal ++++ b/magic/Magdir/pascal +@@ -4,7 +4,7 @@ + # + 0 search/8192 (input, Pascal source text + !:mime text/x-pascal +-0 regex \^program Pascal source text +-!:mime text/x-pascal +-0 regex \^record Pascal source text +-!:mime text/x-pascal ++#0 regex \^program Pascal source text ++#!:mime text/x-pascal ++#0 regex \^record Pascal source text ++#!:mime text/x-pascal diff --git a/SOURCES/file-5.11-perl-shebang.patch b/SOURCES/file-5.11-perl-shebang.patch new file mode 100644 index 0000000..aec548f --- /dev/null +++ b/SOURCES/file-5.11-perl-shebang.patch @@ -0,0 +1,37 @@ +diff --git a/magic/Magdir/perl b/magic/Magdir/perl +index ef0cc6d..453665c 100644 +--- a/magic/Magdir/perl ++++ b/magic/Magdir/perl +@@ -5,24 +5,22 @@ + # The `eval' lines recognizes an outrageously clever hack. + # Keith Waclena + # Send additions to +-0 search/1/w #!\ /bin/perl Perl script text executable +-!:mime text/x-perl + 0 search/1 eval\ "exec\ /bin/perl Perl script text + !:mime text/x-perl +-0 search/1/w #!\ /usr/bin/perl Perl script text executable +-!:mime text/x-perl + 0 search/1 eval\ "exec\ /usr/bin/perl Perl script text + !:mime text/x-perl +-0 search/1/w #!\ /usr/local/bin/perl Perl script text executable +-!:mime text/x-perl + 0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text + !:mime text/x-perl + 0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text + !:mime text/x-perl +-0 search/1 #!/usr/bin/env\ perl Perl script text executable +-!:mime text/x-perl +-0 search/1 #!\ /usr/bin/env\ perl Perl script text executable +-!:mime text/x-perl ++ ++0 search/1 #! ++>0 regex \^#!.*/bin/perl.*$ Perl script text executable ++!:mime text/x-perl ++>0 regex \^#!.*/bin/env\ perl.*$ Perl script text executable ++!:mime text/x-perl ++# to be tried before awk script ++!:strength + 40 + + # by Dmitry V. Levin and Alexey Tourbin + # check the first line diff --git a/SOURCES/file-5.11-ppc64.patch b/SOURCES/file-5.11-ppc64.patch new file mode 100644 index 0000000..44202ae --- /dev/null +++ b/SOURCES/file-5.11-ppc64.patch @@ -0,0 +1,29 @@ +diff --git a/magic/Magdir/elf b/magic/Magdir/elf +index e0e9937..11c876e 100644 +--- a/magic/Magdir/elf ++++ b/magic/Magdir/elf +@@ -84,10 +84,21 @@ + >>>48 leshort &0x0008 (LP64), + >>18 leshort 16 nCUBE, + >>18 leshort 17 Fujitsu VPP500, +->>18 leshort 18 SPARC32PLUS - invalid byte order, +->>18 leshort 20 PowerPC, ++>>18 leshort 18 SPARC32PLUS, ++# only for 32-bit ++>>>4 byte 1 ++>>>>36 lelong&0xffff00 0x000100 V8+ Required, ++>>>>36 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required, ++>>>>36 lelong&0xffff00 0x000400 HaL R1 Extensions Required, ++>>>>36 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required, ++>>18 leshort 19 Intel 80960, ++>>18 leshort 20 PowerPC or cisco 4500, ++>>18 leshort 21 64-bit PowerPC or cisco 7500, + >>18 leshort 22 IBM S/390, +->>18 leshort 36 NEC V800, ++>>18 leshort 23 Cell SPU, ++>>18 leshort 24 cisco SVIP, ++>>18 leshort 25 cisco 7200, ++>>18 leshort 36 NEC V800 or cisco 12000, + >>18 leshort 37 Fujitsu FR20, + >>18 leshort 38 TRW RH-32, + >>18 leshort 39 Motorola RCE, diff --git a/SOURCES/file-5.11-python-comment.patch b/SOURCES/file-5.11-python-comment.patch new file mode 100644 index 0000000..d0d6693 --- /dev/null +++ b/SOURCES/file-5.11-python-comment.patch @@ -0,0 +1,39 @@ +From ac2eb47fe154aa01460414de987491b02ea225e2 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Sat, 15 Feb 2014 01:30:52 +0000 +Subject: [PATCH] comment out python comment magic cause other things like + mediawiki use it. + +Upstream-commit: eced9dbd4aa438de22ff453c723136beac41a558 +Signed-off-by: Kamil Dudka +--- + magic/Magdir/python | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/magic/Magdir/python b/magic/Magdir/python +index 53cae42..b3ee014 100644 +--- a/magic/Magdir/python ++++ b/magic/Magdir/python +@@ -46,13 +46,13 @@ + !:mime text/x-python + + # comments +-0 search/4096 ''' +->&0 regex .*'''$ Python script text executable +-!:mime text/x-python ++#0 search/4096 ''' ++#>&0 regex .*'''$ Python script text executable ++#!:mime text/x-python + +-0 search/4096 """ +->&0 regex .*"""$ Python script text executable +-!:mime text/x-python ++#0 search/4096 """ ++#>&0 regex .*"""$ Python script text executable ++#!:mime text/x-python + + # try: + # except: or finally: +-- +2.14.4 + diff --git a/SOURCES/file-5.11-qcow3.patch b/SOURCES/file-5.11-qcow3.patch new file mode 100644 index 0000000..70f43fa --- /dev/null +++ b/SOURCES/file-5.11-qcow3.patch @@ -0,0 +1,26 @@ +diff --git a/magic/Magdir/msdos b/magic/Magdir/msdos +index 8f3e532..21f055d 100644 +--- a/magic/Magdir/msdos ++++ b/magic/Magdir/msdos +@@ -811,6 +811,21 @@ + >>24 bequad x \b, %lld bytes + >>32 belong 1 \b, AES-encrypted + ++>4 belong 3 (v3) ++# Using the existence of the Backing File Offset to determine whether ++# to read Backing File Information ++>>8 bequad >0 \b, has backing file ++# Note that this isn't a null-terminated string; the length is actually ++# (16.L). Assuming a null-terminated string happens to work usually, but it ++# may spew junk until it reaches a \0 in some cases. Also, since there's no ++# .Q modifier, we just use the bottom four bytes as an offset. Note that if ++# the file is over 4G, and the backing file path is stored after the first 4G, ++# the wrong filename will be printed. (This should be (8.Q), when that syntax ++# is introduced.) ++>>>(12.L) string >\0 (path %s) ++>>24 bequad x \b, %lld bytes ++>>32 belong 1 \b, AES-encrypted ++ + >4 default x (unknown version) + + 0 string/b QEVM QEMU suspend to disk image diff --git a/SOURCES/file-5.11-rrdtool.patch b/SOURCES/file-5.11-rrdtool.patch new file mode 100644 index 0000000..557988c --- /dev/null +++ b/SOURCES/file-5.11-rrdtool.patch @@ -0,0 +1,15 @@ +diff --git a/magic/Magdir/database b/magic/Magdir/database +index 5c38f5c..a17cc42 100644 +--- a/magic/Magdir/database ++++ b/magic/Magdir/database +@@ -84,8 +84,8 @@ + # + # + # Round Robin Database Tool by Tobias Oetiker +-0 string RRD RRDTool DB +->4 string x version %s ++0 string/b RRD\0 RRDTool DB ++>4 string/b x version %s + #---------------------------------------------------------------------- + # ROOT: file(1) magic for ROOT databases + # diff --git a/SOURCES/file-5.11-softmagic-read.patch b/SOURCES/file-5.11-softmagic-read.patch new file mode 100644 index 0000000..154b8d0 --- /dev/null +++ b/SOURCES/file-5.11-softmagic-read.patch @@ -0,0 +1,17 @@ +diff --git a/src/softmagic.c b/src/softmagic.c +index 8d08cad..8262788 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -199,9 +199,9 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, + if (file_check_mem(ms, ++cont_level) == -1) + return -1; + +- while (magic[magindex+1].cont_level != 0 && +- ++magindex < nmagic) { +- m = &magic[magindex]; ++ while (magindex + 1 < nmagic && ++ magic[magindex + 1].cont_level != 0) { ++ m = &magic[++magindex]; + ms->line = m->lineno; /* for messages */ + + if (cont_level < m->cont_level) diff --git a/SOURCES/file-5.11-stripped.patch b/SOURCES/file-5.11-stripped.patch new file mode 100644 index 0000000..b0cef3b --- /dev/null +++ b/SOURCES/file-5.11-stripped.patch @@ -0,0 +1,318 @@ +diff --git a/configure.ac b/configure.ac +index 1511c9a..97a4689 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -159,7 +159,7 @@ dnl Checks for functions + AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof fork) + + dnl Provide implementation of some required functions if necessary +-AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline) ++AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline pread) + + dnl Checks for libraries + AC_CHECK_LIB(z,gzopen) +diff --git a/src/cdf.c b/src/cdf.c +index d05d279..3b2b79b 100644 +--- a/src/cdf.c ++++ b/src/cdf.c +@@ -35,7 +35,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: cdf.c,v 1.50 2012/02/20 22:35:29 christos Exp $") ++FILE_RCSID("@(#)$File: cdf.c,v 1.51 2012/03/20 18:28:02 christos Exp $") + #endif + + #include +@@ -296,10 +296,7 @@ cdf_read(const cdf_info_t *info, off_t off, void *buf, size_t len) + if (info->i_fd == -1) + return -1; + +- if (lseek(info->i_fd, off, SEEK_SET) == (off_t)-1) +- return -1; +- +- if (read(info->i_fd, buf, len) != (ssize_t)len) ++ if (pread(info->i_fd, buf, len, off) != (ssize_t)len) + return -1; + + return (ssize_t)len; +diff --git a/src/elfclass.h b/src/elfclass.h +index 2e7741b..010958a 100644 +--- a/src/elfclass.h ++++ b/src/elfclass.h +@@ -59,7 +59,8 @@ + (off_t)elf_getu(swap, elfhdr.e_shoff), + elf_getu16(swap, elfhdr.e_shnum), + (size_t)elf_getu16(swap, elfhdr.e_shentsize), +- fsize, &flags, elf_getu16(swap, elfhdr.e_machine)) == -1) ++ fsize, &flags, elf_getu16(swap, elfhdr.e_machine), ++ (int)elf_getu16(swap, elfhdr.e_shstrndx)) == -1) + return -1; + break; + +diff --git a/src/file.h b/src/file.h +index 1b5f53f..28f9bc7 100644 +--- a/src/file.h ++++ b/src/file.h +@@ -462,6 +462,9 @@ extern char *sys_errlist[]; + #define strtoul(a, b, c) strtol(a, b, c) + #endif + ++#ifndef HAVE_PREAD ++ssize_t pread(int, void *, size_t, off_t); ++#endif + #ifndef HAVE_VASPRINTF + int vasprintf(char **, const char *, va_list); + #endif +diff --git a/src/readelf.c b/src/readelf.c +index ce4832a..8d355c5 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -48,7 +48,7 @@ private int dophn_core(struct magic_set *, int, int, int, off_t, int, size_t, + private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, + off_t, int *, int); + private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, +- off_t, int *, int); ++ off_t, int *, int, int); + private size_t donote(struct magic_set *, void *, size_t, size_t, int, + int, size_t, int *); + +@@ -129,19 +129,21 @@ getu64(int swap, uint64_t value) + #define elf_getu32(swap, value) getu32(swap, value) + #ifdef USE_ARRAY_FOR_64BIT_TYPES + # define elf_getu64(swap, array) \ +- ((swap ? ((uint64_t)elf_getu32(swap, array[0])) << 32 : elf_getu32(swap, array[0])) + \ +- (swap ? elf_getu32(swap, array[1]) : ((uint64_t)elf_getu32(swap, array[1]) << 32))) ++ ((swap ? ((uint64_t)elf_getu32(swap, array[0])) << 32 \ ++ : elf_getu32(swap, array[0])) + \ ++ (swap ? elf_getu32(swap, array[1]) : \ ++ ((uint64_t)elf_getu32(swap, array[1]) << 32))) + #else + # define elf_getu64(swap, value) getu64(swap, value) + #endif + + #define xsh_addr (clazz == ELFCLASS32 \ +- ? (void *) &sh32 \ +- : (void *) &sh64) ++ ? (void *)&sh32 \ ++ : (void *)&sh64) + #define xsh_sizeof (clazz == ELFCLASS32 \ +- ? sizeof sh32 \ +- : sizeof sh64) +-#define xsh_size (clazz == ELFCLASS32 \ ++ ? sizeof(sh32) \ ++ : sizeof(sh64)) ++#define xsh_size (size_t)(clazz == ELFCLASS32 \ + ? elf_getu32(swap, sh32.sh_size) \ + : elf_getu64(swap, sh64.sh_size)) + #define xsh_offset (off_t)(clazz == ELFCLASS32 \ +@@ -150,12 +152,15 @@ getu64(int swap, uint64_t value) + #define xsh_type (clazz == ELFCLASS32 \ + ? elf_getu32(swap, sh32.sh_type) \ + : elf_getu32(swap, sh64.sh_type)) ++#define xsh_name (clazz == ELFCLASS32 \ ++ ? elf_getu32(swap, sh32.sh_name) \ ++ : elf_getu32(swap, sh64.sh_name)) + #define xph_addr (clazz == ELFCLASS32 \ + ? (void *) &ph32 \ + : (void *) &ph64) + #define xph_sizeof (clazz == ELFCLASS32 \ +- ? sizeof ph32 \ +- : sizeof ph64) ++ ? sizeof(ph32) \ ++ : sizeof(ph64)) + #define xph_type (clazz == ELFCLASS32 \ + ? elf_getu32(swap, ph32.p_type) \ + : elf_getu32(swap, ph64.p_type)) +@@ -171,8 +176,8 @@ getu64(int swap, uint64_t value) + ? elf_getu32(swap, ph32.p_filesz) \ + : elf_getu64(swap, ph64.p_filesz))) + #define xnh_addr (clazz == ELFCLASS32 \ +- ? (void *) &nh32 \ +- : (void *) &nh64) ++ ? (void *)&nh32 \ ++ : (void *)&nh64) + #define xph_memsz (size_t)((clazz == ELFCLASS32 \ + ? elf_getu32(swap, ph32.p_memsz) \ + : elf_getu64(swap, ph64.p_memsz))) +@@ -192,8 +197,8 @@ getu64(int swap, uint64_t value) + ? prpsoffsets32[i] \ + : prpsoffsets64[i]) + #define xcap_addr (clazz == ELFCLASS32 \ +- ? (void *) &cap32 \ +- : (void *) &cap64) ++ ? (void *)&cap32 \ ++ : (void *)&cap64) + #define xcap_sizeof (clazz == ELFCLASS32 \ + ? sizeof cap32 \ + : sizeof cap64) +@@ -296,7 +301,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + { + Elf32_Phdr ph32; + Elf64_Phdr ph64; +- size_t offset; ++ size_t offset, len; + unsigned char nbuf[BUFSIZ]; + ssize_t bufsize; + +@@ -310,11 +315,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + * Loop through all the program headers. + */ + for ( ; num; num--) { +- if (lseek(fd, off, SEEK_SET) == (off_t)-1) { +- file_badseek(ms); +- return -1; +- } +- if (read(fd, xph_addr, xph_sizeof) == -1) { ++ if (pread(fd, xph_addr, xph_sizeof, off) == -1) { + file_badread(ms); + return -1; + } +@@ -332,13 +333,8 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + * This is a PT_NOTE section; loop through all the notes + * in the section. + */ +- if (lseek(fd, xph_offset, SEEK_SET) == (off_t)-1) { +- file_badseek(ms); +- return -1; +- } +- bufsize = read(fd, nbuf, +- ((xph_filesz < sizeof(nbuf)) ? xph_filesz : sizeof(nbuf))); +- if (bufsize == -1) { ++ len = xph_filesz < sizeof(nbuf) ? xph_filesz : sizeof(nbuf); ++ if ((bufsize = pread(fd, nbuf, len, xph_offset)) == -1) { + file_badread(ms); + return -1; + } +@@ -843,15 +839,16 @@ static const cap_desc_t cap_desc_386[] = { + + private int + doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, +- size_t size, off_t fsize, int *flags, int mach) ++ size_t size, off_t fsize, int *flags, int mach, int strtab) + { + Elf32_Shdr sh32; + Elf64_Shdr sh64; + int stripped = 1; + void *nbuf; +- off_t noff, coff; ++ off_t noff, coff, name_off; + uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */ + uint64_t cap_sf1 = 0; /* SunOS 5.x software capabilites */ ++ char name[50]; + + if (size != xsh_sizeof) { + if (file_printf(ms, ", corrupted section header size") == -1) +@@ -859,12 +856,24 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + return 0; + } + ++ /* Read offset of name section to be able to read section names later */ ++ if (pread(fd, xsh_addr, xsh_sizeof, off + size * strtab) == -1) { ++ file_badread(ms); ++ return -1; ++ } ++ name_off = xsh_offset; ++ + for ( ; num; num--) { +- if (lseek(fd, off, SEEK_SET) == (off_t)-1) { +- file_badseek(ms); ++ /* Read the name of this section. */ ++ if (pread(fd, name, sizeof(name), name_off + xsh_name) == -1) { ++ file_badread(ms); + return -1; + } +- if (read(fd, xsh_addr, xsh_sizeof) == -1) { ++ name[sizeof(name) - 1] = '\0'; ++ if (strcmp(name, ".debug_info") == 0) ++ stripped = 0; ++ ++ if (pread(fd, xsh_addr, xsh_sizeof, off) == -1) { + file_badread(ms); + return -1; + } +@@ -889,39 +898,30 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, + /* Things we can determine when we seek */ + switch (xsh_type) { + case SHT_NOTE: +- if ((nbuf = malloc((size_t)xsh_size)) == NULL) { ++ if ((nbuf = malloc(xsh_size)) == NULL) { + file_error(ms, errno, "Cannot allocate memory" + " for note"); + return -1; + } +- if ((noff = lseek(fd, (off_t)xsh_offset, SEEK_SET)) == +- (off_t)-1) { ++ if (pread(fd, nbuf, xsh_size, xsh_offset) == -1) { + file_badread(ms); + free(nbuf); + return -1; + } +- if (read(fd, nbuf, (size_t)xsh_size) != +- (ssize_t)xsh_size) { +- free(nbuf); +- file_badread(ms); +- return -1; +- } + + noff = 0; + for (;;) { + if (noff >= (off_t)xsh_size) + break; + noff = donote(ms, nbuf, (size_t)noff, +- (size_t)xsh_size, clazz, swap, 4, +- flags); ++ xsh_size, clazz, swap, 4, flags); + if (noff == 0) + break; + } + free(nbuf); + break; + case SHT_SUNW_cap: +- if (lseek(fd, (off_t)xsh_offset, SEEK_SET) == +- (off_t)-1) { ++ if (lseek(fd, xsh_offset, SEEK_SET) == (off_t)-1) { + file_badseek(ms); + return -1; + } +@@ -1043,7 +1043,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + const char *shared_libraries = ""; + unsigned char nbuf[BUFSIZ]; + ssize_t bufsize; +- size_t offset, align; ++ size_t offset, align, len; + + if (size != xph_sizeof) { + if (file_printf(ms, ", corrupted program header size") == -1) +@@ -1052,13 +1052,8 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + } + + for ( ; num; num--) { +- if (lseek(fd, off, SEEK_SET) == (off_t)-1) { +- file_badseek(ms); +- return -1; +- } +- +- if (read(fd, xph_addr, xph_sizeof) == -1) { +- file_badread(ms); ++ if (pread(fd, xph_addr, xph_sizeof, off) == -1) { ++ file_badread(ms); + return -1; + } + +@@ -1096,12 +1091,9 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, + * This is a PT_NOTE section; loop through all the notes + * in the section. + */ +- if (lseek(fd, xph_offset, SEEK_SET) == (off_t)-1) { +- file_badseek(ms); +- return -1; +- } +- bufsize = read(fd, nbuf, ((xph_filesz < sizeof(nbuf)) ? +- xph_filesz : sizeof(nbuf))); ++ len = xph_filesz < sizeof(nbuf) ? xph_filesz ++ : sizeof(nbuf); ++ bufsize = pread(fd, nbuf, len, xph_offset); + if (bufsize == -1) { + file_badread(ms); + return -1; diff --git a/SOURCES/file-5.11-swap-info.patch b/SOURCES/file-5.11-swap-info.patch new file mode 100644 index 0000000..ec4e170 --- /dev/null +++ b/SOURCES/file-5.11-swap-info.patch @@ -0,0 +1,23 @@ +diff --git a/magic/Magdir/linux b/magic/Magdir/linux +index aa8d1aa..90f0f46 100644 +--- a/magic/Magdir/linux ++++ b/magic/Magdir/linux +@@ -87,7 +87,17 @@ + >0x41a beshort x \b%04x + # From Daniel Novotny + # swap file for PowerPC +-65526 string SWAPSPACE2 Linux/ppc swap file ++65526 string SWAPSPACE2 Linux swap file ++>0x400 long x version %d, ++>0x404 long x size %d pages, ++>1052 string \0 no label, ++>1052 string >\0 LABEL=%s, ++>0x40c belong x UUID=%08x ++>0x410 beshort x \b-%04x ++>0x412 beshort x \b-%04x ++>0x414 beshort x \b-%04x ++>0x416 belong x \b-%08x ++>0x41a beshort x \b%04x + 16374 string SWAPSPACE2 Linux/ia64 swap file + # + # Linux kernel boot images, from Albert Cahalan diff --git a/SOURCES/file-5.11-version.patch b/SOURCES/file-5.11-version.patch new file mode 100644 index 0000000..de75812 --- /dev/null +++ b/SOURCES/file-5.11-version.patch @@ -0,0 +1,27 @@ +From 5c9813d05317379b38e04b1b7ffb8cca6a236143 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Thu, 6 Sep 2012 14:18:50 +0000 +Subject: [PATCH] PR/198: Version should not exit 1 + +Upstream-commit: a5a197f98d6ad293a25f3e20563aab31906c5ab3 +Signed-off-by: Kamil Dudka +--- + src/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/file.c b/src/file.c +index 408ec63..7911b07 100644 +--- a/src/file.c ++++ b/src/file.c +@@ -252,7 +252,7 @@ main(int argc, char *argv[]) + (void)fprintf(stdout, "%s-%s\n", progname, VERSION); + (void)fprintf(stdout, "magic file from %s\n", + magicfile); +- return 1; ++ return 0; + case 'z': + flags |= MAGIC_COMPRESS; + break; +-- +2.5.5 + diff --git a/SOURCES/file-5.11-xml.patch b/SOURCES/file-5.11-xml.patch new file mode 100644 index 0000000..373fed5 --- /dev/null +++ b/SOURCES/file-5.11-xml.patch @@ -0,0 +1,47 @@ +diff --git a/magic/Magdir/sgml b/magic/Magdir/sgml +index 3f78c2f..991f90d 100644 +--- a/magic/Magdir/sgml ++++ b/magic/Magdir/sgml +@@ -17,16 +17,16 @@ + + # xhtml + 0 string/t \15 string >\0 +->>19 search/4096/cWbt \19 search/4096/cWbt \>15 string >\0 (version %.3s) + !:mime text/html + 0 string/t \15 string >\0 +->>19 search/4096/cWbt \19 search/4096/cWbt \>15 string >\0 (version %.3s) + !:mime text/html + 0 string/t \15 string >\0 +->>19 search/4096/cWbt \19 search/4096/cWbt \>15 string >\0 (version %.3s) + !:mime text/html + + #------------------------------------------------------------------------------ +@@ -59,17 +59,14 @@ + !:mime application/xml + 0 string/t \15 search/1 >\0 %.3s document text ++>15 string/t >\0 %.3s document text + >>23 search/1 \>24 search/1 \flags & MAGIC_CHECK) ++ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0) + file_magwarn(ms, "using regular magic file `%s'", fn); + rv = apprentice_load(ms, &magic, &nmagic, fn, action); + if (rv != 0) + +-- +1.7.7.4 + diff --git a/SOURCES/file-python-func.patch b/SOURCES/file-python-func.patch new file mode 100644 index 0000000..59ced47 --- /dev/null +++ b/SOURCES/file-python-func.patch @@ -0,0 +1,13 @@ +diff --git a/magic/Magdir/python b/magic/Magdir/python +index e592803..c786469 100644 +--- a/magic/Magdir/python ++++ b/magic/Magdir/python +@@ -59,3 +59,8 @@ + !:mime text/x-python + >&0 search/4096 finally: Python script text executable + !:mime text/x-python ++ ++# def name(args, args): ++0 regex \^(\ |\\t)*def\ +[a-zA-Z]+ ++>&0 regex \ *\\(([a-zA-Z]|,|\ )*\\):$ Python script text executable ++!:mime text/x-python diff --git a/SOURCES/file-qed-vdi-image.patch b/SOURCES/file-qed-vdi-image.patch new file mode 100644 index 0000000..eba59d7 --- /dev/null +++ b/SOURCES/file-qed-vdi-image.patch @@ -0,0 +1,22 @@ +diff --git a/magic/Magdir/msdos b/magic/Magdir/msdos +index 560d360..83724c5 100644 +--- a/magic/Magdir/msdos ++++ b/magic/Magdir/msdos +@@ -815,6 +815,17 @@ + + 0 string/b QEVM QEMU suspend to disk image + ++# QEMU QED Image ++# http://wiki.qemu.org/Features/QED/Specification ++0 string/b QED\0 QEMU QED Image ++ ++# VDI Image ++64 string/b \x7f\x10\xda\xbe VDI Image ++>68 string/b \x01\x00\x01\x00 version 1.1 ++>0 string >\0 (%s) ++>368 lequad x \b, %lld bytes ++ ++ + 0 string/b Bochs\ Virtual\ HD\ Image Bochs disk image, + >32 string x type %s, + >48 string x subtype %s diff --git a/SOURCES/file-tnef.patch b/SOURCES/file-tnef.patch new file mode 100644 index 0000000..1b8d377 --- /dev/null +++ b/SOURCES/file-tnef.patch @@ -0,0 +1,12 @@ +diff --git a/magic/Magdir/mail.news b/magic/Magdir/mail.news +index 96fa069..fb5e293 100644 +--- a/magic/Magdir/mail.news ++++ b/magic/Magdir/mail.news +@@ -34,6 +34,7 @@ + + # TNEF files... + 0 lelong 0x223E9F78 Transport Neutral Encapsulation Format ++!:mime application/vnd.ms-tnef + + # From: Kevin Sullivan + 0 string *mbx* MBX mail folder diff --git a/SPECS/file.spec b/SPECS/file.spec new file mode 100644 index 0000000..f24bf82 --- /dev/null +++ b/SPECS/file.spec @@ -0,0 +1,1022 @@ +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%global __libtoolize : + +Summary: A utility for determining file types +Name: file +Version: 5.11 +Release: 35%{?dist} +License: BSD +Group: Applications/File +Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz +# Upstream says it's up to distributions to add a way to support local-magic. +Patch0: file-localmagic.patch +# sent upstream - should be included in next upstream release +Patch1: file-tnef.patch +Patch2: file-5.10-strength.patch +Patch3: file-5.10-sticky-bit.patch +Patch4: file-python-func.patch +Patch5: file-qed-vdi-image.patch +Patch6: file-5.11-ia64-swap.patch +Patch7: file-4.17-rpm-name.patch +Patch8: file-5.11-magicmgc-home.patch +Patch9: file-5.11-compress.patch +Patch10: file-5.11-dump-twice.patch +Patch11: file-5.04-volume_key.patch +Patch12: file-5.04-man-return-code.patch +Patch13: file-5.04-generic-msdos.patch +Patch14: file-5.14-netpbm.patch +Patch15: file-5.11-rrdtool.patch +Patch16: file-5.11-exit-code.patch +Patch17: file-5.11-perl-shebang.patch +Patch18: file-5.11-qcow3.patch +Patch20: file-5.11-CVE-2014-1943.patch +Patch21: file-5.11-CVE-2014-2270.patch +Patch22: file-5.11-CVE-2013-7345.patch +Patch30: file-5.11-add-aarch64.patch +Patch31: file-5.04-minix.patch +Patch32: file-5.04-trim.patch +Patch33: file-5.11-ppc64.patch +Patch34: file-5.04-ppc32core.patch +Patch35: file-5.11-stripped.patch +Patch36: file-5.11-softmagic-read.patch +Patch37: file-5.11-offset-oob.patch +Patch38: file-5.11-swap-info.patch +Patch39: file-5.11-CVE-2014-0207.patch +Patch40: file-5.11-CVE-2014-0237.patch +Patch41: file-5.11-CVE-2014-0238.patch +Patch42: file-5.11-CVE-2014-3478.patch +Patch43: file-5.11-CVE-2014-3479.patch +Patch44: file-5.11-CVE-2014-3480.patch +Patch45: file-5.11-CVE-2014-3487.patch +Patch46: file-5.11-CVE-2014-3538.patch +Patch47: file-5.11-CVE-2014-3587.patch +Patch48: file-5.11-CVE-2014-3710.patch +Patch49: file-5.11-CVE-2014-8116.patch +Patch50: file-5.11-CVE-2014-8117.patch +Patch51: file-5.11-CVE-2014-9652.patch +Patch52: file-5.11-CVE-2014-9653.patch +Patch53: file-5.11-xml.patch +Patch54: file-5.11-buildid.patch +Patch55: file-5.11-java1718.patch +Patch56: file-5.11-auxv.patch +Patch57: file-5.11-newpython.patch +Patch58: file-5.11-pascal.patch + +# fix #1246385 - 'file --version' now exits successfully +Patch59: file-5.11-version.patch + +# fix #1488898 - bump the strength of gzip +Patch60: file-5.11-gzip-strength.patch + +# fix #1562135 - do not classify groovy script as python code +Patch61: file-5.11-python-comment.patch + +URL: http://www.darwinsys.com/file/ +Requires: file-libs = %{version}-%{release} +BuildRequires: zlib-devel + +%description +The file command is used to identify a particular file according to the +type of data contained by the file. File can identify many different +file types, including ELF binaries, system libraries, RPM packages, and +different graphics formats. + +%package libs +Summary: Libraries for applications using libmagic +Group: Applications/File +License: BSD + +%description libs + +Libraries for applications using libmagic. + +%package devel +Summary: Libraries and header files for file development +Group: Applications/File +Requires: %{name} = %{version}-%{release} + +%description devel +The file-devel package contains the header files and libmagic library +necessary for developing programs using libmagic. + +%package static +Summary: Static library for file development +Group: Applications/File +Requires: %{name} = %{version}-%{release} + +%description static +The file-static package contains the static version of +the libmagic library. + +%package -n python-magic +Summary: Python bindings for the libmagic API +Group: Development/Libraries +BuildArch: noarch +BuildRequires: python2-devel +Requires: %{name} = %{version}-%{release} + +%description -n python-magic +This package contains the Python bindings to allow access to the +libmagic API. The libmagic library is also used by the familiar +file(1) command. + +%prep + +# Don't use -b -- it will lead to problems when compiling magic file! +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 +%patch61 -p1 + +# Patches can generate *.orig files, which can't stay in the magic dir, +# otherwise there will be problems when compiling magic file! +rm -fv magic/Magdir/*.orig + +iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ +touch -r doc/libmagic.man doc/libmagic.man_ +mv doc/libmagic.man_ doc/libmagic.man + +%build +CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \ +%configure --enable-fsect-man5 --disable-rpath +# remove hardcoded library paths from local libtool +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/src/.libs +make +cd python +CFLAGS="%{optflags}" %{__python} setup.py build + +%install +mkdir -p ${RPM_BUILD_ROOT}%{_bindir} +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5 +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/file + +make DESTDIR=${RPM_BUILD_ROOT} install +rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la + +# local magic in /etc/magic +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir} +cp -a ./magic/magic.local ${RPM_BUILD_ROOT}%{_sysconfdir}/magic + +cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic +ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic +#ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime +ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic + +cd python +%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} +%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name} + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files +%doc COPYING ChangeLog README +%{_bindir}/* +%{_mandir}/man1/* +%config(noreplace) %{_sysconfdir}/magic + +%files libs +%doc COPYING ChangeLog README +%{_libdir}/*so.* +%{_datadir}/magic* +%{_mandir}/man5/* +%{_datadir}/file +%{_datadir}/misc/* + +%files devel +%{_libdir}/*.so +%{_includedir}/magic.h +%{_mandir}/man3/* + +%files static +%{_libdir}/*.a + +%files -n python-magic +%doc python/README COPYING python/example.py +%{python_sitelib}/magic.py +%{python_sitelib}/magic.pyc +%{python_sitelib}/magic.pyo +%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6 +%{python_sitelib}/*egg-info +%endif + +%changelog +* Wed Jun 06 2018 Kamil Dudka 5.11-35 +- fix #1562135 - do not classify groovy script as python code + +* Thu Sep 07 2017 Kamil Dudka 5.11-34 +- fix #1488898 - bump the strength of gzip + +* Mon Jun 27 2016 Kamil Dudka 5.11-33 +- fix #1246385 - 'file --version' now exits successfully + +* Wed Mar 09 2016 Jan Kaluza 5.11-32 +- fix #1278737 - add support for Java 1.7 and 1.8 +- fix #1281723 - show full executable name for core +- fix #1271636 - add support for detection of Python 2.7 byte-compiled files +- fix #1278768 - comment out too-sensitive Pascal magic + +* Mon Sep 07 2015 Jan Kaluza - 5.11-31 +- fix #1255396 - Make the build ID output consistent with other tools + +* Fri Aug 28 2015 Jan Kaluza - 5.11-30 +- fix CVE-2014-8116 - bump the acceptable ELF program headers count to 2048 + +* Mon Jul 13 2015 Jan Kaluza - 5.11-29 +- fix #839229 - fix detection of version of XML files + +* Mon Jul 13 2015 Jan Kaluza - 5.11-28 +- fix #839229 - fix detection of version of XML files + +* Tue Jul 07 2015 Jan Kaluza - 5.11-27 +- fix CVE-2014-0207 - cdf_read_short_sector insufficient boundary check +- fix CVE-2014-0237 - cdf_unpack_summary_info() excessive looping DoS +- fix CVE-2014-0238 - CDF property info parsing nelements infinite loop +- fix CVE-2014-3478 - mconvert incorrect handling of truncated pascal string +- fix CVE-2014-3479 - fix extensive backtracking in regular expression +- fix CVE-2014-3480 - cdf_count_chain insufficient boundary check +- fix CVE-2014-3487 - cdf_read_property_info insufficient boundary check +- fix CVE-2014-3538 - unrestricted regular expression matching +- fix CVE-2014-3587 - fix cdf_read_property_info +- fix CVE-2014-3710 - out-of-bounds read in elf note headers +- fix CVE-2014-8116 - multiple denial of service issues (resource consumption) +- fix CVE-2014-8117 - denial of service issue (resource consumption) +- fix CVE-2014-9652 - out of bounds read in mconvert() +- fix CVE-2014-9653 - malformed elf file causes access to uninitialized memory + +* Tue Jun 09 2015 Jan Kaluza - 5.11-26 +- fix #1080452 - remove .orig files from magic directory + +* Tue Jun 02 2015 Jan Kaluza - 5.11-25 +- fix #1224667, #1224668 - show additional info for Linux swap files + +* Mon May 11 2015 Jan Kaluza - 5.11-24 +- fix #1064268 - fix stray return -1 + +* Wed Apr 22 2015 Jan Kaluza - 5.11-23 +- fix #1094648 - improve Minix detection pattern to fix false positives +- fix #1161912 - trim white-spaces during ISO9660 detection +- fix #1157850 - fix detection of ppc64le ELF binaries +- fix #1161911 - display "from" field on 32bit ppc core +- fix #1064167 - revert MAXMIME patch +- fix #1064268 - detect Dwarf debuginfo as "not stripped" +- fix #1082689 - fix invalid read when matched pattern is the last one tried +- fix #1080362 - remove deadcode and OFFSET_OOB redefinition + +* Tue Jul 15 2014 Jan Kaluza - 5.11-22 +- fix #1067688 - add support for aarch64 ELF binaries + +* Tue Mar 25 2014 Jan Kaluza - 5.11-21 +- fix #1079848 - fix potential regression in Perl detection caused + by previous fix + +* Mon Mar 24 2014 Jan Kaluza - 5.11-20 +- fix #1079848 - fix for CVE-2013-7345 + +* Fri Mar 07 2014 Jan Kaluza - 5.11-19 +- fix #1073554 - fix for CVE-2014-2270 + +* Wed Feb 19 2014 Jan Kaluza - 5.11-18 +- fix #1066563 - fix for CVE-2014-1943 + +* Wed Feb 12 2014 Jan Kaluza - 5.11-17 +- Increase MAXMIME size to 80 bytes (#1064167) + +* Fri Jan 24 2014 Daniel Mach - 5.11-16 +- Mass rebuild 2014-01-24 + +* Fri Jan 10 2014 Jan Kaluza - 5.11-15 +- fix #1048910 - detect perl scripts even with arguments in shebang + +* Tue Jan 07 2014 Jan Kaluza - 5.11-14 +- fix #1048910 - increase perl scripts magic strength +- fix #1048082 - add support for QCOW3 images detection + +* Thu Jan 02 2014 Jan Kaluza - 5.11-13 +- fix #1038025 - improve perl scripts detection according to perl shebang + +* Fri Dec 27 2013 Daniel Mach - 5.11-12 +- Mass rebuild 2013-12-27 + +* Fri Nov 08 2013 Jan Kaluza - 5.11-11 +- fix #1022967 - improve RRD Tool database detection +- fix #1026852 - exit with 0 exit code when input file does not exist + +* Mon Jun 17 2013 Jan Kaluza - 5.11-10 +- build python-magic as noarch +- fix netpbm detection + +* Mon Mar 11 2013 Jan Kaluza - 5.11-9 +- fix #919466 - fix memory leak in get_default_magic + +* Wed Feb 13 2013 Fedora Release Engineering - 5.11-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Dec 04 2012 Jan Kaluza - 5.11-7 +- removed duplicated patterns for backups generated by "dump" tool +- recognize volume_key escrow packets +- mention exit code in manpage +- remove weak msdos patterns + +* Wed Nov 21 2012 Jan Kaluza - 5.11-6 +- clean up the spec file + +* Tue Aug 14 2012 Jan Kaluza - 5.11-5 +- fix #847936 - decompress bzip2 properly when using -z param +- fix #847937 - read magic patterns also from ~/.magic.mgc + +* Fri Jul 27 2012 Fedora Release Engineering - 5.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 19 2012 Jan Kaluza - 5.11-3 +- removed buildroot, defattr + +* Tue Jun 21 2012 Jan Kaluza - 5.11-2 +- detect names of RPM packages +- detect swap on ia64 architecture + +* Mon Feb 27 2012 Jan Kaluza - 5.11-1 +- fix #796130 - update to file-5.11 +- fix #796209 - recognize VDI images +- fix #795709 - recognize QED images + +* Wed Jan 18 2012 Jan Kaluza - 5.10-5 +- fix detection of ASCII text files with setuid, setgid, or sticky bits + +* Tue Jan 10 2012 Jan Kaluza - 5.10-4 +- fix #772651 - decrease strength of newly added "C source" patterns + +* Tue Jan 03 2012 Jan Kaluza - 5.10-3 +- fix #771292 - do not show 'using regular magic file' warning for /etc/magic, + because this file is not supposed to be compiled + +* Mon Jan 02 2012 Jan Kaluza - 5.10-2 +- fix #770006 - detect tnef files + +* Mon Jan 02 2012 Jan Kaluza - 5.10-1 +- fix #771030 - update to file-5.10 + +* Mon Jan 02 2012 Jan Kaluza - 5.09-3 +- fix #720321 - added /etc/magic config file to let users define their local + magic patterns + +* Wed Oct 26 2011 Fedora Release Engineering - 5.09-2 +- Rebuilt for glibc bug#747377 + +* Thu Sep 29 2011 Jan Kaluza - 5.09-1 +- fix #739286 - update to file-5.09 + +* Thu Aug 04 2011 Jan Kaluza - 5.08-1 +- fix #728181 - update to file-5.08 +- remove unused patches + +* Tue Jun 14 2011 Jan Kaluza - 5.07-5 +- fix #712991 - include RPM noarch in /usr/share/magic + +* Thu Jun 09 2011 Jan Kaluza - 5.07-4 +- fix #711843 - fix postscript detection + +* Thu Jun 09 2011 Jan Kaluza - 5.07-3 +- fix #709953 - add support for BIOS version detection + +* Mon May 23 2011 Jan Kaluza - 5.07-2 +- backported patches to fix 5.07 regressions +- fix #706231 - fixed ZIP detection +- fix #705183, #705499 - removed weak DOS device driver pattern + +* Wed May 11 2011 Jan Kaluza - 5.07-1 +- update to new upstream version 5.07 +- remove unused patches + +* Tue Mar 01 2011 Jan Kaluza - 5.05-4 +- fix #678458 - support for Python 3.2 compiled files + +* Thu Feb 10 2011 Jan Kaluza - 5.05-3 +- fix #676543 - improved TeX and LaTeX recognition +- fix #676041 - detect all supported RPM architectures + +* Tue Feb 08 2011 Fedora Release Engineering - 5.05-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 18 2011 Jan Kaluza - 5.05-1 +- fix #670319 - update to new upstream release 5.05 +- removed useless patches + +* Mon Jan 10 2011 Jan Kaluza - 5.04-18 +- fix #668304 - support for com32r programs +- distinguish between GFS2 and GFS1 filesystems + +* Wed Nov 24 2010 Jan Kaluza - 5.04-17 +- fix #656395 - "string" magic directive supports longer strings + +* Wed Aug 29 2010 Jan Kaluza - 5.04-16 +- fix #637785 - support for zip64 format + +* Tue Aug 24 2010 Jan Kaluza - 5.04-15 +- fix #626591 - support for WebM format + +* Thu Aug 12 2010 Jan Kaluza - 5.04-14 +- fix #623602 - support for Python 2.7 compiled files + +* Wed Jul 21 2010 David Malcolm - 5.04-13 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Thu Jul 19 2010 Jan Kaluza 5.04-12 +- fix #599695 - try to get "from" attribute for ELF binaries + only from core dumps. + +* Thu Jul 08 2010 Jan Kaluza 5.04-11 +- added docs for file-libs + +* Tue Jun 29 2010 Jan Kaluza 5.04-10 +- fix #608922 - updated z-machine magic + +* Fri Jun 11 2010 Jan Kaluza 5.04-9 +- removed excessive HTML/SGML "magic patterns" (#603040) + +* Wed Apr 14 2010 Daniel Novotny 5.04-8 +- fix #580046 - the file command returns zero exit code + even in case of unexisting file being tested + +* Wed Apr 07 2010 Daniel Novotny 5.04-7 +- fix #566305 - "file" may trim too much of command line from core file + +* Wed Mar 24 2010 Daniel Novotny 5.04-6 +- fix #550212 - 'file' gives bad meta-data for squashfs-4.0 + +* Wed Mar 24 2010 Daniel Novotny 5.04-5 +- fix #575184 - file command does not print separator + when --print0 option is used + +* Thu Mar 11 2010 Daniel Novotny 5.04-4 +- fix #570785 - "file" misidentifies filesystem type + +* Tue Feb 09 2010 Daniel Novotny 5.04-3 +- fix #562840 - [PATCH] Add matches for ruby modules + +* Thu Jan 28 2010 Daniel Novotny 5.04-2 +- fix #533245 - segfaults on star.ulaw + +* Mon Jan 25 2010 Daniel Novotny 5.04-1 +- update to new upstream release 5.04 + +* Mon Jan 18 2010 Daniel Novotny 5.03-18 +- static library moved to new "-static" subpackage (#556048) + +* Fri Dec 25 2009 Robert Scheck 5.03-17 +- removed broken install of example.py (%%doc is much enough) + +* Mon Nov 30 2009 Daniel Novotny 5.03-16 +- fixed the patch for multilib (#515767) + +* Tue Nov 24 2009 Daniel Novotny 5.03-15 +- BuildRequires: autoconf, automake + +* Tue Nov 24 2009 Daniel Novotny 5.03-14 +- BuildRequires: automake because of the Makefile.am patch + +* Fri Nov 13 2009 Daniel Novotny 5.03-13 +- fix #537324 - update spec conditional for rhel + +* Thu Nov 05 2009 Daniel Novotny 5.03-12 +- fix #533151 - file command doesn't recognize deltaisos or rpm-only deltarpms + +* Tue Oct 27 2009 Daniel Novotny 5.03-11 +- fix #531082 - RFE: add detection of Python 3 bytecode +- fix #531127 - `file' command does not recognize mime type `image/vnd.djvu' + +* Wed Oct 21 2009 Daniel Novotny 5.03-10 +- fix #530083 - file -s is not able to detect swap signature on ppc + +* Tue Aug 25 2009 Daniel Novotny 5.03-9 +- fix #515767 - multilib: file /usr/share/misc/magic.mgc conflicts + +* Thu Aug 06 2009 Daniel Novotny 5.03-8 +- rebuild for #515767 - multilib: file /usr/share/misc/magic.mgc conflicts + +* Fri Jul 24 2009 Fedora Release Engineering - 5.03-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 23 2009 Daniel Novotny 5.03-6 +- fix #510429 - file is confused by string "/* (if any) */" + in C header and claims it "Lisp/Scheme program text" + +* Wed Jul 22 2009 Daniel Novotny 5.03-5 +- #513079 - RFE: file - recognize xfs metadump images + +* Fri Jul 10 2009 Adam Jackson 5.03-4 +- Clean up %%description. + +* Tue Jun 16 2009 Daniel Novotny 5.03-4 +- one more PostScript font magic added (#505762), + updated font patch + +* Tue Jun 16 2009 Daniel Novotny 5.03-3 +- added magic for three font issues (PostScript fonts) + (#505758, #505759, #505765) + +* Thu May 14 2009 Daniel Novotny 5.03-2 +- fix #500739 - Disorganized magic* file locations in file-libs + +* Mon May 11 2009 Daniel Novotny 5.03-1 +- new upstream version + +* Tue May 05 2009 Daniel Novotny 5.02-1 +- new upstream version; drop upstreamed patches; this fixes #497913 + +* Wed Apr 29 2009 Daniel Novotny 5.00-8 +- fix #498036 - Elang JAM file definition breaks detection of postscript-files + +* Mon Apr 20 2009 Daniel Novotny 5.00-7 +- fix previous patch: + the name of the format is a bit different (MDUMP -> MDMP) + +* Fri Apr 17 2009 Daniel Novotny 5.00-6 +- fix #485835 (MDUMP files) + +* Mon Mar 23 2009 Daniel Novotny 5.00-5 +- added two font definitions (#491594, #491595) + and a fix for file descriptor leak when MAGIC_COMPRESS used (#491596) + +* Tue Feb 24 2009 Fedora Release Engineering - 5.00-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 23 2009 Daniel Novotny 5.00-3 +- fix #486105 - file-5.00-2.fc11 fails to recognise a file + (and makes rpmbuild fail) + +* Mon Feb 16 2009 Daniel Novotny 5.00-2 +- fix #485141 - rpm failed while checking a French Word file + +* Mon Feb 09 2009 Daniel Novotny 5.00-1 +- upgrade to 5.00 +- drop upstreamed patches, rebase remaining patch + +* Wed Jan 14 2009 Daniel Novotny 4.26-9 +- fix #476655 detect JPEG-2000 Code Stream Bitmap + +* Mon Jan 12 2009 Daniel Novotny 4.26-8 +- fix #479300 - add btrfs filesystem magic + +* Mon Dec 15 2008 Daniel Novotny 4.26-7 +- fix the LaTex issue in bz#474156 + +* Thu Dec 04 2008 Ignacio Vazquez-Abrams - 4.26-6 +- Rebuild for Python 2.6 + +* Thu Dec 04 2008 Daniel Novotny - 4.26-5 +- fix #470811 - Spurious perl auto-requires + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 4.26-4 +- Rebuild for Python 2.6 + +* Thu Oct 16 2008 Daniel Novotny 4.26-3 +- fix #465994 file --mime-encoding seems broken + +* Tue Oct 07 2008 Daniel Novotny 4.26-2 +- fix #463809: rpmbuild rpmfcClassify: Assertion fails on some binary files + (false positive test on "DOS device driver" crashed file(1) + and rpmbuild(8) failed) + +* Mon Sep 15 2008 Daniel Novotny 4.26-1 +- new upstream version: fixes #462064 + +* Mon Jul 21 2008 Tomas Smetana - 4.25-1 +- new upstream version; drop upstreamed patches + +* Fri Jun 06 2008 Tomas Smetana - 4.24-4 +- add GFS2 filesystem magic; thanks to Eric Sandeen +- add LVM snapshots magic (#449755); thanks to Jason Farrell + +* Wed Jun 04 2008 Tomas Smetana - 4.24-3 +- drop patches that do nothing in recent build system +- create the text magic file during installation + +* Tue Jun 03 2008 Tomas Smetana - 4.24-2 +- rebuild because of egg-info + +* Tue Jun 03 2008 Tomas Smetana - 4.24-1 +- new upstream version + +* Tue Mar 11 2008 Tomas Smetana - 4.23-5 +- fix EFI detection patch + +* Fri Feb 01 2008 Tomas Smetana - 4.23-4 +- fix mismatching gzip files and text files as animations + +* Fri Feb 01 2008 Tomas Smetana - 4.23-3 +- fix #430927 - detect ext4 filesystems + +* Thu Jan 31 2008 Tomas Smetana - 4.23-2 +- fix #430952 - wrong handling of ELF binaries + +* Tue Jan 29 2008 Tomas Smetana - 4.23-1 +- new upstream version; update patches; drop unused patches + +* Thu Jan 24 2008 Tomas Smetana - 4.21-5 +- build a separate python-magic package; thanks to Terje Rosten + +* Thu Dec 06 2007 Tomas Smetana - 4.21-4 +- add PE32/PE32+ magic + +* Wed Aug 15 2007 Martin Bacovsky - 4.21-3 +- resolves: #172015: no longer reports filename of crashed app when run on core files. +- resolves: #249578: Weird output from "file -i" +- resolves: #234817: file reports wrong filetype for microsoft word file + +* Wed Jul 4 2007 Martin Bacovsky - 4.21-2 +- resolves: #246700: RPM description isn't related to product +- resolves: #238789: file-devel depends on %%{version} + but not on %%{version}-%%{release} +- resolves: #235267: for core files, file doesn't display the executable name + +* Tue May 29 2007 Martin Bacovsky - 4.21-1 +- upgrade to new upstream 4.21 +- resolves: #241034: CVE-2007-2799 file integer overflow + +* Wed Mar 7 2007 Martin Bacovsky - 4.20-1 +- upgrade to new upstream 4.20 + +* Tue Feb 20 2007 Martin Bacovsky - 4.19-4 +- rpath in file removal + +* Mon Feb 19 2007 Martin Bacovsky - 4.19-3 +- Resolves: #225750 - Merge Review: file + +* Thu Jan 25 2007 Martin Bacovsky - 4.19-2 +- Resolves: #223297 - file does not recognize OpenOffice "native" formats +- Resolves: #224344 - Magic rules should be in file-libs + +* Tue Jan 9 2007 Martin Bacovsky - 4.19-1 +- Resolves: #208880 - Pointless file(1) error message while detecting ELF 64-bit file + thanks to for patch +- Resolves: #214992 - file-devel should own %%_includedir/* %%_libdir/lib*.so +- Resolves: #203548 - a -devel package should be split out for libmagic +- upgrade to new upstream 4.19 +- patch revision and cleaning +- split package to file, file-devel and file-libs + +* Wed Aug 23 2006 Martin Bacovsky - 4.17-8 +- fix recognition of perl script with embed awk (#203610) + +* Fri Aug 18 2006 Martin Bacovsky - 4.17-7 +- fix recognition of bash script with embed awk (#202185) + +* Thu Aug 03 2006 Martin Bacovsky - 4.17-6 +- fix gziped empty file (#72986) + +* Wed Jul 12 2006 Jesse Keating - 4.17-5.1 +- rebuild + +* Mon Jul 10 2006 Radek Vokal 4.17-5 +- fix powerpoint mine (#190373) + +* Wed May 24 2006 Radek Vokal 4.17-4 +- /usr/share/file is owned by package (#192858) +- fix magic for Clamav files (#192406) + +* Fri Apr 21 2006 Radek Vokal 4.17-3 +- add support for OCFS or ASM (#189017) + +* Tue Mar 14 2006 Radek Vokal 4.17-2 +- fix segfault when compiling magic +- add check for wctype.h +- fix for flac and mp3 files + +* Mon Mar 13 2006 Radek Vokal 4.17-1 +- upgrade to file-4.17, patch clean-up + +* Fri Feb 10 2006 Jesse Keating - 4.16-6.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 4.16-6.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Sun Feb 04 2006 Radek Vokal 4.16-6 +- xen patch, recognizes Xen saved domain + +* Fri Jan 13 2006 Radek Vokal 4.16-5 +- fix for 64bit arrays + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Tue Nov 29 2005 Radek Vokal - 4.16-4 +- printf utf8 filenames and don't use isprint() (#174348) + +* Tue Nov 08 2005 Radek Vokal - 4.16-3 +- remove .la files (#172633) + +* Mon Oct 31 2005 Radek Vokal - 4.16-2 +- fix core files output, show "from" (#172015) + +* Tue Oct 18 2005 Radek Vokal - 4.16-1 +- upgrade to upstream + +* Mon Oct 03 2005 Radek Vokal - 4.15-4 +- file output for Berkeley DB gains Cracklib (#168917) + +* Mon Sep 19 2005 Radek Vokal - 4.15-3 +- small fix in previously added patch, now it works for multiple params + +* Mon Sep 19 2005 Radek Vokal - 4.15-2 +- print xxx-style only once (#168617) + +* Thu Aug 09 2005 Radek Vokal - 4.15-1 +- upgrade to upstream + +* Tue Aug 09 2005 Radek Vokal - 4.14-4 +- mime for mpeg and aac files fixed (#165323) + +* Fri Aug 05 2005 Radek Vokal - 4.14-3 +- mime for 3ds files removed, conflicts with text files (#165165) + +* Fri Jul 22 2005 Radek Vokal - 4.14-2 +- fixed mime types recognition (#163866) + +* Thu Jul 14 2005 Radek Vokal - 4.14-1 +- sync with upstream, patch clean-up + +* Mon Jul 04 2005 Radek Vokal - 4.13-5 +- fixed reiserfs check (#162378) + +* Mon Apr 11 2005 Radek Vokal - 4.13-4 +- check Cyrus files before Apple Quicktime movies (#154342) + +* Mon Mar 07 2005 Radek Vokal - 4.13-3 +- check for shared libs before fs dump files (#149868) + +* Fri Mar 04 2005 Radek Vokal - 4.13-2 +- gcc4 rebuilt + +* Tue Feb 15 2005 Radek Vokal - 4.13-1 +- new version, fixing few bugs, patch clean-up +- consistent output for bzip files (#147440) + +* Mon Jan 24 2005 Radek Vokal - 4.12-3 +- core64 patch fixing output on core files (#145354) +- minor change in magic patch + +* Mon Jan 03 2005 Radek Vokal - 4.12-2 +- fixed crashes in threaded environment (#143871) + +* Thu Dec 02 2004 Radek Vokal - 4.12-1 +- upgrade to file-4.12 +- removed Tim's patch, tuned magic patch + +* Sat Nov 20 2004 Miloslav Trmac - 4.10-4 +- Convert libmagic.3 to UTF-8 + +* Thu Nov 18 2004 Radek Vokal 4.10-3 +- set of patches from debian.org +- new magic types (#128763) +- zlib added to BuildReq (#125294) + +* Tue Oct 12 2004 Tim Waugh 4.10-2 +- Fixed occasional segfault (bug #131892). + +* Wed Aug 11 2004 Radek Vokal +- zlib patch deleted, note patch deleted, rh patch updated, debian patch updated +- upgrade to file-4.10 + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Mon May 10 2004 Jakub Jelinek +- fix ELF note handling (#109495) + +* Tue Mar 23 2004 Karsten Hopp 4.07-3 +- add docs (#115966) + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Sun Jan 18 2004 Jeff Johnson 4.07-1 +- upgrade to 4.07. +- deal gracefully with unreadable files (#113207). +- detect PO files (from Debian). + +* Tue Dec 16 2003 Jeff Johnson 4.06-1 +- upgrade to file-4.06. + +* Mon Nov 10 2003 Tim Waugh 4.02-4 +- Minimal fix for busy loop problem (bug #109495). + +* Mon Oct 13 2003 Jeff Johnson 4.05-1 +- upgrade to 4.05. + +* Thu Oct 9 2003 Jeff Johnson 4.02-3 +- use zlib rather than exec'ing gzip. + +-* Thu Aug 28 2003 Dan Walsh +-- Add Selinux support. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Sat May 24 2003 Florian La Roche +- add ldconfig to post/postun + +* Mon Apr 21 2003 Jeff Johnson 4.02-1 +- upgrade to file-4.02. + +* Thu Feb 27 2003 Jeff Johnson 3.39-9 +- check size read from elf header (#85297). + +* Tue Feb 18 2003 Matt Wilson 3.39-8 +- add FHS compatibility symlink from /usr/share/misc/magic -> ../magic + (#84509) + +* Fri Feb 14 2003 Jeff Johnson 3.39-7 +- the "real" fix to the vorbis/ogg magic details (#82810). + +* Mon Jan 27 2003 Jeff Johnson 3.39-6 +- avoid vorbis/ogg magic details (#82810). + +* Wed Jan 22 2003 Tim Powers 3.39-5 +- rebuilt + +* Sun Jan 12 2003 Nalin Dahyabhai 3.39-4 +- PT_NOTE, take 3 + +* Fri Jan 10 2003 Nalin Dahyabhai 3.39-3 +- don't barf in ELF headers with align = 0 + +* Tue Jan 7 2003 Nalin Dahyabhai 3.39-2 +- don't get lost when looking at PT_NOTE sections + +* Sat Oct 26 2002 Jeff Johnson 3.39-1 +- update to 3.39. + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Mon May 6 2002 Trond Eivind Glomsrød 3.37-6 +- Don't use an old magic.mime +- Add mng detection (#64229) + +* Tue Feb 26 2002 Trond Eivind Glomsrød 3.37-5 +- Rebuild + +* Mon Jan 14 2002 Trond Eivind Glomsrød 3.37-4 +- Fix missing include of (#58209) + +* Tue Dec 11 2001 Trond Eivind Glomsrød 3.37-2 +- Add CFLAGS to handle large files (#53576) + +* Mon Dec 10 2001 Trond Eivind Glomsrød 3.37-1 +- 3.37 +- s/Copyright/License/ +- build with --enable-fsect-man5, drop patch +- disable two old patches + +* Fri Jul 06 2001 Florian La Roche +- revert a patch to Magdir/elf, which breaks many libtool scripts + in several rpm packages + +* Mon Jun 25 2001 Crutcher Dunnavant +- iterate to 3.35 + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Sun Nov 26 2000 Jeff Johnson +- update to 3.33. + +* Mon Aug 14 2000 Preston Brown +- Bill made the patch but didn't apply it. :) + +* Mon Aug 14 2000 Bill Nottingham +- 'ASCII text', not 'ASCII test' (#16168) + +* Mon Jul 31 2000 Jeff Johnson +- fix off-by-1 error when creating filename for use with -i. +- include a copy of GNOME /etc/mime-types in %%{_datadir}/magic.mime (#14741). + +* Sat Jul 22 2000 Jeff Johnson +- install magic as man5/magic.5 with other formats (#11172). + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Wed Jun 14 2000 Jeff Johnson +- FHS packaging. + +* Tue Apr 14 2000 Bernhard Rosenkraenzer +- 3.30 + +* Wed Feb 16 2000 Cristian Gafton +- add ia64 patch from rth + +* Mon Feb 7 2000 Bill Nottingham +- handle compressed manpages +- update to 3.28 + +* Mon Aug 23 1999 Jeff Johnson +- identify ELF stripped files correctly (#4665). +- use SPARC (not sparc) consistently throughout (#4665). +- add entries for MS Office files (#4665). + +* Thu Aug 12 1999 Jeff Johnson +- diddle magic so that *.tfm files are identified correctly. + +* Tue Jul 6 1999 Jeff Johnson +- update to 3.27. + +* Mon Mar 22 1999 Preston Brown +- experimental support for realmedia files added + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 5) + +* Fri Mar 19 1999 Jeff Johnson +- strip binary. + +* Fri Nov 27 1998 Jakub Jelinek +- add SPARC V9 magic. + +* Tue Nov 10 1998 Jeff Johnson +- update to 3.26. + +* Mon Aug 24 1998 Jeff Johnson +- update to 3.25. +- detect gimp XCF versions. + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Wed Apr 08 1998 Erik Troan +- updated to 3.24 +- buildrooted + +* Mon Jun 02 1997 Erik Troan +- built against glibc + +* Mon Mar 31 1997 Erik Troan +- Fixed problems caused by 64 bit time_t. + +* Thu Mar 06 1997 Michael K. Johnson +- Improved recognition of Linux kernel images.