Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package file for openSUSE:Factory checked in at 2021-04-29 01:36:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/file (Old) and /work/SRC/openSUSE:Factory/.file.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "file" Thu Apr 29 01:36:27 2021 rev:122 rq:888046 version:5.40 Changes: -------- --- /work/SRC/openSUSE:Factory/file/file.changes 2021-03-12 13:30:45.922110871 +0100 +++ /work/SRC/openSUSE:Factory/.file.new.12324/file.changes 2021-04-29 01:36:34.118422658 +0200 @@ -1,0 +2,62 @@ +Fri Apr 23 10:26:49 UTC 2021 - Dr. Werner Fink <[email protected]> + +- Add patch file-5.40-ascii.patch + * fix regressions on dection of smaller ASCII files (boo#1184899) + +------------------------------------------------------------------- +Thu Apr 22 13:42:49 UTC 2021 - Dr. Werner Fink <[email protected]> + +- Add upstream comitts as patches + * file-5.40-9b0459af.patch + put attributes inside the xz magic. (boo#1184888, boo#1184891) + * file-5.40-749e1ecf.patch + If the file is less than 3 bytes, use the file length to determine type + * file-5.40-f0601504.patch + Fix regression after unsigned/signed printing changes + * file-5.40-f7705dca.patch + fix previous (cast >>) + * file-5.40-3096f87f.patch + Correct return values to exptexted + * file-5.40-4c5fe1ad.patch + Add missing parens +- Port patch + * file-5.28-btrfs-image.dif + due patch file-5.40-f0601504.patch + +------------------------------------------------------------------- +Tue Apr 6 07:39:00 UTC 2021 - Dr. Werner Fink <[email protected]> + +- Add upstream commits as patches + * file-5.40-1c677c04.patch + Don't count each byte encounter as 1, count the total number + of bytes found (Anatol Belski). This makes it behave like 5.39 + * file-5.40-6b34436a.patch + remove "u" from the pattern (Joerg Jenderek) + * file-5.40-9e2becec.patch + Encoding bug fix +- Fix offsets of patches + * file-5.17-option.dif + * file-5.19-biorad.dif + * file-5.19-printf.dif + * file-5.19-zip2.0.dif + * file-5.22-elf.dif + * file-5.23-endian.patch + * file-5.28-btrfs-image.dif + * file-5.38-allow-readlinkat.dif + * file-secure_getenv.patch + +------------------------------------------------------------------- +Sat Apr 3 07:32:11 UTC 2021 - Andreas Stieger <[email protected]> + +- update to 5.40: + * Add limit to the number of bytes to scan for encoding + * Fix /T (trim flag) for regex + * Trim trailing separator. + * Convert system read errors from corrupt ELF + files into human readable error messages + * Exclude surrogate pairs from utf-8 detection +- drop upstreamed patches: + * file-5.16-ocloexec.patch + * file-5.39-alternate_format.dif + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/file/python-magic.changes 2020-07-05 01:10:06.239391693 +0200 +++ /work/SRC/openSUSE:Factory/.file.new.12324/python-magic.changes 2021-04-29 01:36:34.138422686 +0200 @@ -1,0 +2,6 @@ +Sat Apr 3 07:32:11 UTC 2021 - Andreas Stieger <[email protected]> + +- update to 5.40: + * file 5.40, no changes specific to python-magic + +------------------------------------------------------------------- Old: ---- file-5.16-ocloexec.patch file-5.39-alternate_format.dif file-5.39.tar.gz file-5.39.tar.gz.asc New: ---- file-5.40-1c677c04.patch file-5.40-3096f87f.patch file-5.40-4c5fe1ad.patch file-5.40-6b34436a.patch file-5.40-749e1ecf.patch file-5.40-9b0459af.patch file-5.40-9e2becec.patch file-5.40-ascii.patch file-5.40-f0601504.patch file-5.40-f7705dca.patch file-5.40.tar.gz file-5.40.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ file.spec ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.238424245 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.242424251 +0200 @@ -33,7 +33,7 @@ %endif # # Set Version also in python-magic.spec -Version: 5.39 +Version: 5.40 Release: 0 Summary: A Tool to Determine File Types License: BSD-2-Clause @@ -60,12 +60,22 @@ Patch27: file-5.19-zip2.0.dif Patch31: file-5.19-biorad.dif Patch32: file-5.19-clicfs.dif -Patch33: file-5.16-ocloexec.patch Patch34: file-5.23-endian.patch Patch37: file-secure_getenv.patch Patch39: file-5.28-btrfs-image.dif Patch40: file-5.38-allow-readlinkat.dif -Patch42: file-5.39-alternate_format.dif +# Upstream commits as patches +Patch41: file-5.40-1c677c04.patch +Patch42: file-5.40-9e2becec.patch +Patch43: file-5.40-6b34436a.patch +Patch44: file-5.40-9b0459af.patch +Patch45: file-5.40-f0601504.patch +Patch46: file-5.40-3096f87f.patch +Patch47: file-5.40-f7705dca.patch +Patch48: file-5.40-749e1ecf.patch +Patch49: file-5.40-4c5fe1ad.patch +# My fix of the ASCII count bug +Patch60: file-5.40-ascii.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -109,6 +119,16 @@ %prep %setup -q -n file-%{version} +%patch41 -p0 +%patch42 -p0 +%patch43 -p0 +%patch44 -p0 +%patch45 -p0 +%patch46 -p0 +%patch47 -p0 +%patch48 -p0 +%patch49 -p0 +%patch60 -p0 %patch1 -p0 -b .misc %patch4 -p0 -b .conf %patch5 -p0 -b .tex @@ -125,12 +145,10 @@ %patch27 -p0 -b .zip2.0 %patch31 -p0 -b .biorad %patch32 -p0 -b .clicfs -%patch33 -p0 -b .clexe %patch34 -p0 -b .endian %patch37 -p1 -b .getenv %patch39 -p1 -b .btrfs %patch40 -p1 -b .readlinkat -%patch42 -p0 -b .af %patch -b .0 test -s src/magic.h.in || cp -p src/magic.h src/magic.h.in rm -fv src/magic.h ++++++ python-magic.spec ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.266424285 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.270424290 +0200 @@ -27,7 +27,7 @@ BuildRequires: python-rpm-macros BuildRequires: zlib-devel URL: http://www.darwinsys.com/file/ -Version: 5.39 +Version: 5.40 Release: 0 Summary: Python module to use libmagic License: BSD-3-Clause AND BSD-4-Clause ++++++ file-5.17-option.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.318424359 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.322424364 +0200 @@ -1,6 +1,6 @@ --- file-5.39/src/file.c.orig 2020-06-17 16:13:36.625305367 +0200 +++ file-5.39/src/file.c 2020-06-17 16:15:12.429553163 +0200 -@@ -249,6 +249,8 @@ +@@ -251,6 +251,8 @@ break; case 'e': case OPT_EXCLUDE_QUIET: @@ -9,7 +9,7 @@ for (i = 0; i < __arraycount(nv); i++) if (strcmp(nv[i].name, optarg) == 0) break; -@@ -261,7 +263,7 @@ +@@ -263,7 +265,7 @@ break; case 'f': @@ -18,7 +18,7 @@ usage(); if (magic == NULL) if ((magic = load(magicfile, flags)) == NULL) -@@ -271,6 +273,8 @@ +@@ -273,6 +275,8 @@ ++didsomefiles; break; case 'F': @@ -27,7 +27,7 @@ separator = optarg; break; case 'i': -@@ -283,6 +287,8 @@ +@@ -285,6 +289,8 @@ action = FILE_LIST; break; case 'm': ++++++ file-5.18-javacheck.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.334424381 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.334424381 +0200 @@ -1,11 +1,13 @@ ---- magic/Magdir/cafebabe -+++ magic/Magdir/cafebabe 2014-03-28 10:15:13.354235294 +0000 -@@ -15,7 +15,7 @@ - # might add another one or two as time goes by... - # +Index: magic/Magdir/cafebabe +=================================================================== +--- magic/Magdir/cafebabe.orig ++++ magic/Magdir/cafebabe +@@ -17,7 +17,7 @@ ### JAVA START ### + # Reference: http://en.wikipedia.org/wiki/Java_class_file + # Update: Joerg Jenderek -0 belong 0xcafebabe +0 belong 0xcafebabe Cafe Babe - >4 belong >30 compiled Java class data, + >4 ubelong >30 compiled Java class data, !:mime application/x-java-applet - >>6 beshort x version %d. + #!:mime application/java-byte-code ++++++ file-5.19-biorad.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.346424398 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.346424398 +0200 @@ -4,7 +4,7 @@ --- magic/Magdir/images +++ magic/Magdir/images 2019-05-27 08:52:51.674238380 +0000 -@@ -1290,6 +1290,8 @@ +@@ -1348,6 +1348,8 @@ # https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt # Samples: https://www.loci.wisc.edu/software/sample-data 14 leshort <2 ++++++ file-5.19-printf.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.366424426 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.366424426 +0200 @@ -4,7 +4,7 @@ --- src/apprentice.c +++ src/apprentice.c 2019-02-21 06:39:25.249091320 +0000 -@@ -2465,6 +2465,12 @@ check_format_type(const char *ptr, int t +@@ -2476,6 +2476,12 @@ check_format_type(const char *ptr, int t ptr++; if (*ptr == '#') ptr++; ++++++ file-5.19-zip2.0.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.378424443 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.382424449 +0200 @@ -4,7 +4,7 @@ --- magic/Magdir/archive +++ magic/Magdir/archive 2019-02-21 06:49:05.298138025 +0000 -@@ -1102,6 +1102,11 @@ +@@ -1117,6 +1117,11 @@ 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract !:mime application/zip !:ext zip/cbz ++++++ file-5.22-elf.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.390424461 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.390424461 +0200 @@ -4,7 +4,7 @@ --- src/readelf.c +++ src/readelf.c 2019-02-21 06:41:38.598573505 +0000 -@@ -818,7 +818,7 @@ do_core_note(struct magic_set *ms, unsig +@@ -824,7 +824,7 @@ do_core_note(struct magic_set *ms, unsig default: if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) { @@ -13,7 +13,7 @@ unsigned char c; /* * Extract the program name. We assume -@@ -830,7 +830,9 @@ do_core_note(struct magic_set *ms, unsig +@@ -836,7 +836,9 @@ do_core_note(struct magic_set *ms, unsig * If the characters aren't all printable, * reject it. */ ++++++ file-5.23-endian.patch ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.402424477 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.406424483 +0200 @@ -29,7 +29,7 @@ private char *mkdbname(struct magic_set *, const char *, int); private struct magic_map *apprentice_buf(struct magic_set *, struct magic *, size_t); -@@ -3336,67 +3338,6 @@ byteswap(struct magic *magic, uint32_t n +@@ -3347,67 +3349,6 @@ byteswap(struct magic *magic, uint32_t n } /* ++++++ file-5.28-btrfs-image.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.414424494 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.414424494 +0200 @@ -16,47 +16,47 @@ diff --git a/magic/Magdir/filesystems b/magic/Magdir/filesystems --- a/magic/Magdir/filesystems +++ b/magic/Magdir/filesystems -@@ -2281,20 +2281,29 @@ +@@ -2296,20 +2296,29 @@ >>0x10060 string >\0 lockproto %s) # Russell Coker <[email protected]> --0x10040 string _BHRfS_M BTRFS Filesystem -->0x1012b string >\0 label "%s", -->0x10090 lelong x sectorsize %d, -->0x10094 lelong x nodesize %d, -->0x10098 lelong x leafsize %d, -->0x10020 belong x UUID=%08x- -->0x10024 beshort x \b%04x- -->0x10026 beshort x \b%04x- -->0x10028 beshort x \b%04x- -->0x1002a beshort x \b%04x -->0x1002c belong x \b%08x, -->0x10078 lequad x %lld/ -->0x10070 lequad x \b%lld bytes used, -->0x10088 lequad x %lld devices -+0x10040 string _BHRfS_M -+>0x10000 use btrfs_super_block -+0 name btrfs_super_block -+>0x40 string _BHRfS_M BTRFS Filesystem -+>0x12b string >\0 label "%s", -+>0x90 lelong x sectorsize %d, -+>0x94 lelong x nodesize %d, -+>0x98 lelong x leafsize %d, -+>0x20 belong x UUID=%08x- -+>0x24 beshort x \b%04x- -+>0x26 beshort x \b%04x- -+>0x28 beshort x \b%04x- -+>0x2a beshort x \b%04x -+>0x2c belong x \b%08x, -+>0x78 lequad x %lld/ -+>0x70 lequad x \b%lld bytes used, -+>0x88 lequad x %lld devices +-0x10040 string _BHRfS_M BTRFS Filesystem +->0x1012b string >\0 label "%s", +->0x10090 lelong x sectorsize %d, +->0x10094 lelong x nodesize %d, +->0x10098 lelong x leafsize %d, +->0x10020 ubelong x UUID=%08x- +->0x10024 ubeshort x \b%04x- +->0x10026 ubeshort x \b%04x- +->0x10028 ubeshort x \b%04x- +->0x1002a ubeshort x \b%04x +->0x1002c ubelong x \b%08x, +->0x10078 lequad x %lld/ +->0x10070 lequad x \b%lld bytes used, +->0x10088 lequad x %lld devices ++0x10040 string _BHRfS_M ++>0x10000 use btrfs_super_block ++0 name btrfs_super_block ++>0x40 string _BHRfS_M BTRFS Filesystem ++>0x12b string >\0 label "%s", ++>0x90 lelong x sectorsize %d, ++>0x94 lelong x nodesize %d, ++>0x98 lelong x leafsize %d, ++>0x20 ubelong x UUID=%08x- ++>0x24 ubeshort x \b%04x- ++>0x26 ubeshort x \b%04x- ++>0x28 ubeshort x \b%04x- ++>0x2a ubeshort x \b%04x ++>0x2c ubelong x \b%08x, ++>0x78 lequad x %lld/ ++>0x70 lequad x \b%lld bytes used, ++>0x88 lequad x %lld devices + -+0 lequad 0xbd5c25e27295668b BTRFS Filesystem Metadata Image -+>20 byte 1 \b, zlib compressed -+>20 byte 0 \b, uncompressed -+>>0x440 string _BHRfS_M \b, contains -+>>>0x400 use btrfs_super_block ++0 lequad 0xbd5c25e27295668b BTRFS Filesystem Metadata Image ++>20 byte 1 \b, zlib compressed ++>20 byte 0 \b, uncompressed ++>>0x440 string _BHRfS_M \b, contains ++>>>0x400 use btrfs_super_block # dvdisaster's .ecc # From: "Nelson A. de Oliveira" <[email protected]> ++++++ file-5.38-allow-readlinkat.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.426424512 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.426424512 +0200 @@ -2,7 +2,7 @@ =================================================================== --- file-5.38.orig/src/seccomp.c +++ file-5.38/src/seccomp.c -@@ -206,6 +206,9 @@ enable_sandbox_full(void) +@@ -205,6 +205,9 @@ enable_sandbox_full(void) #ifdef __NR_newfstatat ALLOW_RULE(newfstatat); #endif ++++++ file-5.39.dif ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.438424528 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.438424528 +0200 @@ -9,9 +9,11 @@ src/dcore.c | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 312 insertions(+), 67 deletions(-) ---- magic/Magdir/elf -+++ magic/Magdir/elf 2020-07-01 07:22:26.488294151 +0000 -@@ -136,7 +136,7 @@ +Index: magic/Magdir/elf +=================================================================== +--- magic/Magdir/elf.orig ++++ magic/Magdir/elf +@@ -152,7 +152,7 @@ >18 leshort 47 Renesas H8/300H, >18 leshort 48 Renesas H8S, >18 leshort 49 Renesas H8/500, @@ -20,8 +22,10 @@ >18 leshort 51 Stanford MIPS-X, >18 leshort 52 Motorola Coldfire, >18 leshort 53 Motorola M68HC12, ---- magic/Magdir/linux -+++ magic/Magdir/linux 2020-07-01 07:22:26.488294151 +0000 +Index: magic/Magdir/linux +=================================================================== +--- magic/Magdir/linux.orig ++++ magic/Magdir/linux @@ -140,27 +140,31 @@ # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29 # Linux kernel boot images (i386 arch) (Wolfram Kleff) @@ -70,17 +74,21 @@ # This also matches new kernels, which were caught above by "HdrS". 0 belong 0xb8c0078e Linux kernel >0x1e3 string Loading version 1.3.79 or older ---- magic/Magdir/msad -+++ magic/Magdir/msad 2020-07-01 07:22:26.488294151 +0000 +Index: magic/Magdir/msad +=================================================================== +--- /dev/null ++++ magic/Magdir/msad @@ -0,0 +1,5 @@ +#------------------------------------------------------------------------------ +# msad: file(1) magic for msad +# Microsoft visual C +# This must precede the heuristic for raw G3 data +4 string Standard\ Jet\ DB Microsoft Access Database ---- magic/Magdir/msdos -+++ magic/Magdir/msdos 2020-07-01 07:22:26.492294076 +0000 -@@ -143,9 +143,9 @@ +Index: magic/Magdir/msdos +=================================================================== +--- magic/Magdir/msdos.orig ++++ magic/Magdir/msdos +@@ -145,9 +145,9 @@ >>(0x3c.l+22) leshort&0x0200 >0 (stripped to external PDB) >>(0x3c.l+22) leshort&0x1000 >0 system file >>(0x3c.l+24) leshort 0x010b @@ -92,7 +100,7 @@ # hooray, there's a DOS extender using the PE format, with a valid PE # executable inside (which just prints a message and exits if run in win) -@@ -532,7 +532,7 @@ +@@ -554,7 +554,7 @@ # negative offset, must not lead into PSP >1 short <-259 # that offset must be accessible @@ -101,8 +109,10 @@ >>>0 use msdos-com # updated by Joerg Jenderek at Oct 2008,2015 ---- magic/Makefile.am -+++ magic/Makefile.am 2020-07-01 07:22:26.492294076 +0000 +Index: magic/Makefile.am +=================================================================== +--- magic/Makefile.am.orig ++++ magic/Makefile.am @@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) @@ -112,7 +122,7 @@ EXTRA_DIST = \ $(MAGIC_DIR)/Header \ -@@ -23,7 +23,6 @@ $(MAGIC_FRAGMENT_DIR)/animation \ +@@ -24,7 +24,6 @@ $(MAGIC_FRAGMENT_DIR)/animation \ $(MAGIC_FRAGMENT_DIR)/aout \ $(MAGIC_FRAGMENT_DIR)/apache \ $(MAGIC_FRAGMENT_DIR)/apl \ @@ -120,7 +130,7 @@ $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ -@@ -96,7 +95,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ +@@ -100,7 +99,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ $(MAGIC_FRAGMENT_DIR)/espressif \ $(MAGIC_FRAGMENT_DIR)/esri \ $(MAGIC_FRAGMENT_DIR)/fcs \ @@ -128,7 +138,7 @@ $(MAGIC_FRAGMENT_DIR)/finger \ $(MAGIC_FRAGMENT_DIR)/flash \ $(MAGIC_FRAGMENT_DIR)/flif \ -@@ -142,6 +140,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ +@@ -146,6 +144,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ $(MAGIC_FRAGMENT_DIR)/java \ $(MAGIC_FRAGMENT_DIR)/javascript \ $(MAGIC_FRAGMENT_DIR)/jpeg \ @@ -137,14 +147,15 @@ $(MAGIC_FRAGMENT_DIR)/karma \ $(MAGIC_FRAGMENT_DIR)/kde \ $(MAGIC_FRAGMENT_DIR)/keepass \ -@@ -151,14 +151,12 @@ $(MAGIC_FRAGMENT_DIR)/kml \ +@@ -156,7 +156,6 @@ $(MAGIC_FRAGMENT_DIR)/lammps \ $(MAGIC_FRAGMENT_DIR)/lecter \ $(MAGIC_FRAGMENT_DIR)/lex \ $(MAGIC_FRAGMENT_DIR)/lif \ -$(MAGIC_FRAGMENT_DIR)/linux \ $(MAGIC_FRAGMENT_DIR)/lisp \ $(MAGIC_FRAGMENT_DIR)/llvm \ - $(MAGIC_FRAGMENT_DIR)/lua \ + $(MAGIC_FRAGMENT_DIR)/locoscript \ +@@ -164,7 +163,6 @@ $(MAGIC_FRAGMENT_DIR)/lua \ $(MAGIC_FRAGMENT_DIR)/luks \ $(MAGIC_FRAGMENT_DIR)/m4 \ $(MAGIC_FRAGMENT_DIR)/mach \ @@ -152,7 +163,7 @@ $(MAGIC_FRAGMENT_DIR)/macos \ $(MAGIC_FRAGMENT_DIR)/magic \ $(MAGIC_FRAGMENT_DIR)/mail.news \ -@@ -182,11 +180,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ +@@ -188,11 +186,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ $(MAGIC_FRAGMENT_DIR)/mkid \ $(MAGIC_FRAGMENT_DIR)/mlssa \ $(MAGIC_FRAGMENT_DIR)/mmdf \ @@ -165,7 +176,7 @@ $(MAGIC_FRAGMENT_DIR)/msooxml \ $(MAGIC_FRAGMENT_DIR)/msvc \ $(MAGIC_FRAGMENT_DIR)/msx \ -@@ -242,6 +240,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ +@@ -250,6 +248,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ $(MAGIC_FRAGMENT_DIR)/qt \ $(MAGIC_FRAGMENT_DIR)/revision \ $(MAGIC_FRAGMENT_DIR)/riff \ @@ -174,7 +185,7 @@ $(MAGIC_FRAGMENT_DIR)/rpi \ $(MAGIC_FRAGMENT_DIR)/rpm \ $(MAGIC_FRAGMENT_DIR)/rpmsg \ -@@ -325,8 +325,20 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ +@@ -334,8 +334,20 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ $(MAGIC_FRAGMENT_DIR)/zip \ $(MAGIC_FRAGMENT_DIR)/zyxel @@ -196,7 +207,7 @@ # FIXME: Build file natively as well so that it can be used to compile # the target's magic file; for now we bail if the local version does not match -@@ -338,19 +350,22 @@ FILE_COMPILE = $(top_builddir)/src/file$ +@@ -347,19 +359,22 @@ FILE_COMPILE = $(top_builddir)/src/file$ FILE_COMPILE_DEP = $(FILE_COMPILE) endif @@ -235,8 +246,10 @@ +# fi) +# $(FILE_COMPILE) -C -m magic +# @rm -fr magic ---- magic/Makefile.in -+++ magic/Makefile.in 2020-07-01 07:22:26.492294076 +0000 +Index: magic/Makefile.in +=================================================================== +--- magic/Makefile.in.orig ++++ magic/Makefile.in @@ -279,7 +279,7 @@ top_srcdir = @top_srcdir@ MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic @@ -246,7 +259,7 @@ EXTRA_DIST = \ $(MAGIC_DIR)/Header \ $(MAGIC_DIR)/Localstuff \ -@@ -296,7 +296,6 @@ $(MAGIC_FRAGMENT_DIR)/animation \ +@@ -297,7 +297,6 @@ $(MAGIC_FRAGMENT_DIR)/animation \ $(MAGIC_FRAGMENT_DIR)/aout \ $(MAGIC_FRAGMENT_DIR)/apache \ $(MAGIC_FRAGMENT_DIR)/apl \ @@ -254,7 +267,7 @@ $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ -@@ -369,7 +368,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ +@@ -373,7 +372,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ $(MAGIC_FRAGMENT_DIR)/espressif \ $(MAGIC_FRAGMENT_DIR)/esri \ $(MAGIC_FRAGMENT_DIR)/fcs \ @@ -262,7 +275,7 @@ $(MAGIC_FRAGMENT_DIR)/finger \ $(MAGIC_FRAGMENT_DIR)/flash \ $(MAGIC_FRAGMENT_DIR)/flif \ -@@ -415,6 +413,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ +@@ -419,6 +417,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ $(MAGIC_FRAGMENT_DIR)/java \ $(MAGIC_FRAGMENT_DIR)/javascript \ $(MAGIC_FRAGMENT_DIR)/jpeg \ @@ -271,14 +284,15 @@ $(MAGIC_FRAGMENT_DIR)/karma \ $(MAGIC_FRAGMENT_DIR)/kde \ $(MAGIC_FRAGMENT_DIR)/keepass \ -@@ -424,14 +424,12 @@ $(MAGIC_FRAGMENT_DIR)/kml \ +@@ -429,7 +429,6 @@ $(MAGIC_FRAGMENT_DIR)/lammps \ $(MAGIC_FRAGMENT_DIR)/lecter \ $(MAGIC_FRAGMENT_DIR)/lex \ $(MAGIC_FRAGMENT_DIR)/lif \ -$(MAGIC_FRAGMENT_DIR)/linux \ $(MAGIC_FRAGMENT_DIR)/lisp \ $(MAGIC_FRAGMENT_DIR)/llvm \ - $(MAGIC_FRAGMENT_DIR)/lua \ + $(MAGIC_FRAGMENT_DIR)/locoscript \ +@@ -437,7 +436,6 @@ $(MAGIC_FRAGMENT_DIR)/lua \ $(MAGIC_FRAGMENT_DIR)/luks \ $(MAGIC_FRAGMENT_DIR)/m4 \ $(MAGIC_FRAGMENT_DIR)/mach \ @@ -286,7 +300,7 @@ $(MAGIC_FRAGMENT_DIR)/macos \ $(MAGIC_FRAGMENT_DIR)/magic \ $(MAGIC_FRAGMENT_DIR)/mail.news \ -@@ -455,11 +453,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ +@@ -461,11 +459,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ $(MAGIC_FRAGMENT_DIR)/mkid \ $(MAGIC_FRAGMENT_DIR)/mlssa \ $(MAGIC_FRAGMENT_DIR)/mmdf \ @@ -299,7 +313,7 @@ $(MAGIC_FRAGMENT_DIR)/msooxml \ $(MAGIC_FRAGMENT_DIR)/msvc \ $(MAGIC_FRAGMENT_DIR)/msx \ -@@ -515,6 +513,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ +@@ -523,6 +521,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ $(MAGIC_FRAGMENT_DIR)/qt \ $(MAGIC_FRAGMENT_DIR)/revision \ $(MAGIC_FRAGMENT_DIR)/riff \ @@ -308,7 +322,7 @@ $(MAGIC_FRAGMENT_DIR)/rpi \ $(MAGIC_FRAGMENT_DIR)/rpm \ $(MAGIC_FRAGMENT_DIR)/rpmsg \ -@@ -598,10 +598,22 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ +@@ -607,10 +607,22 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ $(MAGIC_FRAGMENT_DIR)/zip \ $(MAGIC_FRAGMENT_DIR)/zyxel @@ -332,7 +346,7 @@ # FIXME: Build file natively as well so that it can be used to compile # the target's magic file; for now we bail if the local version does not match @IS_CROSS_COMPILE_TRUE@FILE_COMPILE = file${EXEEXT} -@@ -826,23 +838,25 @@ uninstall-am: uninstall-pkgdataDATA +@@ -835,23 +847,25 @@ uninstall-am: uninstall-pkgdataDATA .PRECIOUS: Makefile @@ -374,16 +388,20 @@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. ---- src/Makefile.am -+++ src/Makefile.am 2020-07-01 07:22:26.504293856 +0000 +Index: src/Makefile.am +=================================================================== +--- src/Makefile.am.orig ++++ src/Makefile.am @@ -1,4 +1,4 @@ -MAGIC = $(pkgdatadir)/magic +MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic lib_LTLIBRARIES = libmagic.la nodist_include_HEADERS = magic.h ---- src/dcore.c -+++ src/dcore.c 2020-07-01 07:22:26.504293856 +0000 +Index: src/dcore.c +=================================================================== +--- /dev/null ++++ src/dcore.c @@ -0,0 +1,207 @@ +/* + * Show goo about ELF core files ++++++ file-5.16-ocloexec.patch -> file-5.40-1c677c04.patch ++++++ --- /work/SRC/openSUSE:Factory/file/file-5.16-ocloexec.patch 2020-07-05 01:09:35.631290783 +0200 +++ /work/SRC/openSUSE:Factory/.file.new.12324/file-5.40-1c677c04.patch 2021-04-29 01:36:33.886422329 +0200 @@ -1,69 +1,36 @@ +From 1c677c04c0fa43ecfeccdb9705dbbd19fb356891 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas <[email protected]> +Date: Sun, 4 Apr 2021 21:02:19 +0000 +Subject: [PATCH] Don't count each byte encounter as 1, count the total number + of bytes found (Anatol Belski). This makes it behave like 5.39. + --- - src/apprentice.c | 6 +++--- - src/compress.c | 2 +- - src/file.c | 2 +- - src/magic.c | 2 +- - 4 files changed, 6 insertions(+), 6 deletions(-) + src/encoding.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) ---- src/apprentice.c -+++ src/apprentice.c 2019-05-27 08:53:31.057488035 +0000 -@@ -1184,7 +1184,7 @@ load_1(struct magic_set *ms, int action, - ssize_t len; - struct magic_entry me; - -- FILE *f = fopen(ms->file = fn, "r"); -+ FILE *f = fopen(ms->file = fn, "re"); - if (f == NULL) { - if (errno != ENOENT) - file_error(ms, errno, "cannot read magic file `%s'", -@@ -3108,7 +3108,7 @@ apprentice_map(struct magic_set *ms, con - if (dbname == NULL) - goto error; +diff --git src/encoding.c src/encoding.c +index c8b40439..c66703bb 100644 +--- src/encoding.c ++++ src/encoding.c +@@ -35,7 +35,7 @@ + #include "file.h" -- if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1) -+ if ((fd = open(dbname, O_RDONLY|O_BINARY|O_CLOEXEC)) == -1) - goto error; + #ifndef lint +-FILE_RCSID("@(#)$File: encoding.c,v 1.27 2021/02/05 21:33:49 christos Exp $") ++FILE_RCSID("@(#)$File: encoding.c,v 1.28 2021/04/04 21:02:19 christos Exp $") + #endif /* lint */ - if (fstat(fd, &st) == -1) { -@@ -3243,7 +3243,7 @@ apprentice_compile(struct magic_set *ms, - if (dbname == NULL) - goto out; - -- if ((fd = open(dbname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644)) == -1) -+ if ((fd = open(dbname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY|O_CLOEXEC, 0644)) == -1) - { - file_error(ms, errno, "cannot open `%s'", dbname); - goto out; ---- src/compress.c -+++ src/compress.c 2019-05-27 08:53:31.057488035 +0000 -@@ -462,7 +462,7 @@ file_pipe2file(struct magic_set *ms, int - { - int te; - mode_t ou = umask(0); -- tfd = mkstemp(buf); -+ tfd = mkostemp(buf, O_CLOEXEC); - (void)umask(ou); - te = errno; - (void)unlink(buf); ---- src/file.c -+++ src/file.c 2019-05-27 08:53:31.057488035 +0000 -@@ -509,7 +509,7 @@ unwrap(struct magic_set *ms, const char - f = stdin; - wid = 1; - } else { -- if ((f = fopen(fn, "r")) == NULL) { -+ if ((f = fopen(fn, "re")) == NULL) { - file_warn("Cannot open `%s'", fn); - return 1; - } ---- src/magic.c -+++ src/magic.c 2019-05-27 09:00:04.010005617 +0000 -@@ -436,7 +436,7 @@ file_or_fd(struct magic_set *ms, const c - _setmode(STDIN_FILENO, O_BINARY); - #endif - if (inname != NULL) { -- int flags = O_RDONLY|O_BINARY|O_NONBLOCK; -+ int flags = O_RDONLY|O_BINARY|O_NONBLOCK|O_CLOEXEC; - errno = 0; - if ((fd = open(inname, flags)) < 0) { - okstat = stat(inname, &sb) == 0; + #include "magic.h" +@@ -282,8 +282,7 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \ + } \ + u = 0; \ + for (i = 0; i < __arraycount(dist); i++) { \ +- if (dist[i]) \ +- u++; \ ++ u+= dist[i]; \ + } \ + if (u < 3) \ + return 0; \ +-- +2.26.2 + ++++++ file-5.40-3096f87f.patch ++++++ >From 3096f87f823e1e936139e48d6a3bae9a95557861 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Fri, 9 Apr 2021 19:16:19 +0000 Subject: [PATCH] No point returning 0 twice, also don't return -1 as an error where 0 is expected. --- src/encoding.c | 14 +++++++++++--- src/readelf.c | 19 ++++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git src/encoding.c src/encoding.c index c66703bb..691e3e16 100644 --- src/encoding.c +++ src/encoding.c @@ -1,3 +1,5 @@ +/* $NetBSD: encoding.c,v 1.1.1.13 2021/04/09 18:58:01 christos Exp $ */ + /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; @@ -35,7 +37,11 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: encoding.c,v 1.28 2021/04/04 21:02:19 christos Exp $") +#if 0 +FILE_RCSID("@(#)$File: encoding.c,v 1.29 2021/04/09 19:16:19 christos Exp $") +#else +__RCSID("$NetBSD: encoding.c,v 1.1.1.13 2021/04/09 18:58:01 christos Exp $"); +#endif #endif /* lint */ #include "magic.h" @@ -282,7 +288,8 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \ } \ u = 0; \ for (i = 0; i < __arraycount(dist); i++) { \ - u+= dist[i]; \ + if (dist[i]) \ + u++; \ } \ if (u < 3) \ return 0; \ @@ -386,7 +393,8 @@ file_looks_utf8(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, } else { /* 11xxxxxx begins UTF-8 */ int following; uint8_t x = first[buf[i]]; - const struct accept_range *ar = &accept_ranges[x >> 4]; + const struct accept_range *ar = + &accept_ranges[(unsigned int)x >> 4]; if (x == XX) return -1; diff --git src/readelf.c src/readelf.c index 0cd119a6..633fd2e8 100644 --- src/readelf.c +++ src/readelf.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.175 2020/12/17 20:43:37 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.176 2021/04/09 19:16:19 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -982,9 +982,8 @@ get_string_on_virtaddr(struct magic_set *ms, fsize, virtaddr); if (offset < 0 || (buflen = pread(fd, buf, CAST(size_t, buflen), offset)) <= 0) { - if (file_printf(ms, ", can't read elf string at %jd", - (intmax_t)offset) == -1) - return -1; + (void)file_printf(ms, ", can't read elf string at %jd", + (intmax_t)offset); return 0; } @@ -1185,17 +1184,15 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, } if (namesz & 0x80000000) { - if (file_printf(ms, ", bad note name size %#lx", - CAST(unsigned long, namesz)) == -1) - return -1; + (void)file_printf(ms, ", bad note name size %#lx", + CAST(unsigned long, namesz); return 0; } if (descsz & 0x80000000) { - if (file_printf(ms, ", bad note description size %#lx", - CAST(unsigned long, descsz)) == -1) - return -1; - return 0; + (void)file_printf(ms, ", bad note description size %#lx", + CAST(unsigned long, descsz); + return 0; } noff = offset; -- 2.28.0 ++++++ file-5.40-4c5fe1ad.patch ++++++ >From 4c5fe1ad1daa798eda3265e09a382d4ede548981 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Fri, 9 Apr 2021 20:40:56 +0000 Subject: [PATCH] Add missing parens, use reinterpret-casr --- src/readelf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git src/readelf.c src/readelf.c index 633fd2e8..10902f09 100644 --- src/readelf.c +++ src/readelf.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.176 2021/04/09 19:16:19 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.177 2021/04/09 20:40:56 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -918,7 +918,7 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, if (file_printf(ms, ", from '%s'", file_copystr(buf, sizeof(buf), CAST(size_t, cp - cname), - CAST(const char *, cname))) == -1) + RCAST(char *, cname))) == -1) return -1; *flags |= FLAGS_DID_CORE; return 1; @@ -1185,13 +1185,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 %#lx", - CAST(unsigned long, namesz); + CAST(unsigned long, namesz)); return 0; } if (descsz & 0x80000000) { (void)file_printf(ms, ", bad note description size %#lx", - CAST(unsigned long, descsz); + CAST(unsigned long, descsz)); return 0; } -- 2.28.0 ++++++ file-5.40-6b34436a.patch ++++++ >From 6b34436ac766dae64749b8d14f18c6910be40131 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Mon, 5 Apr 2021 16:36:14 +0000 Subject: [PATCH] remove "u" from the pattern (Joerg Jenderek) --- magic/Magdir/mail.news | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git magic/Magdir/mail.news magic/Magdir/mail.news index 3a2eeb96..6a222910 100644 --- magic/Magdir/mail.news +++ magic/Magdir/mail.news @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: mail.news,v 1.26 2021/03/21 14:37:03 christos Exp $ +# $File: mail.news,v 1.27 2021/04/05 16:36:14 christos Exp $ # mail.news: file(1) magic for mail and news # # Unfortunately, saved netnews also has From line added in some news software. @@ -81,4 +81,4 @@ # File format spec: https://wiki.dovecot.org/Design/Dcrypt/#File_format # From: Stephen Gildea 0 string CRYPTED\003\007 Dovecot encrypted message ->9 byte xu \b, dcrypt version %d +>9 byte x \b, dcrypt version %d -- 2.26.2 ++++++ file-5.40-749e1ecf.patch ++++++ >From 749e1ecfc3d333e5ec8b1a2e639da7ccb2498c34 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Mon, 19 Apr 2021 18:38:04 +0000 Subject: [PATCH] PR/256: mutableVoid: If the file is less than 3 bytes, use the file length to determine type --- src/encoding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git src/encoding.c src/encoding.c index 0fb1f47b..31d4d125 100644 --- src/encoding.c +++ src/encoding.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: encoding.c,v 1.30 2021/04/09 19:16:51 christos Exp $") +FILE_RCSID("@(#)$File: encoding.c,v 1.31 2021/04/19 18:38:04 christos Exp $") #endif /* lint */ #include "magic.h" @@ -285,7 +285,7 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \ if (dist[i]) \ u++; \ } \ - if (u < 3) \ + if (u < MIN(nbytes, 3)) \ return 0; \ \ return 1; \ -- 2.28.0 ++++++ file-5.40-9b0459af.patch ++++++ >From 9b0459afab309a82aa4e46f73a4e50dd641f3d39 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Mon, 19 Apr 2021 17:01:45 +0000 Subject: [PATCH] PR/257: cuihao: put attributes inside the xz magic. --- magic/Magdir/compress | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git magic/Magdir/compress magic/Magdir/compress index 64d11a73..41a65738 100644 --- magic/Magdir/compress +++ magic/Magdir/compress @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.80 2021/03/15 17:49:24 christos Exp $ +# $File: compress,v 1.81 2021/04/19 17:01:45 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -265,14 +265,13 @@ # http://tukaani.org/xz/xz-file-format.txt 0 ustring \xFD7zXZ\x00 XZ compressed data, checksum +!:strength * 2 +!:mime application/x-xz >7 byte&0xf 0x0 NONE >7 byte&0xf 0x1 CRC32 >7 byte&0xf 0x4 CRC64 >7 byte&0xf 0xa SHA-256 -!:strength * 2 -!:mime application/x-xz - # https://github.com/ckolivas/lrzip/blob/master/doc/magic.header.txt 0 string LRZI LRZIP compressed data >4 byte x - version %d -- 2.28.0 ++++++ file-5.40-9e2becec.patch ++++++ >From 9e2becec20d023409a1671bf10a682f699350e85 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Sun, 4 Apr 2021 21:03:43 +0000 Subject: [PATCH] Encoding bug fix. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git ChangeLog ChangeLog index 23a93cf4..2238ba6f 100644 --- ChangeLog +++ ChangeLog @@ -1,3 +1,8 @@ +2021-04-04 17:02 Christos Zoulas <[email protected]> + + * count the total bytes found not the total byte positions + in order to determine encoding (Anatol Belski) + 2021-03-30 20:21 Christos Zoulas <[email protected]> * release 5.40 -- 2.26.2 ++++++ file-5.40-ascii.patch ++++++ >From a806b7c99870f76c5fcf3d34f9d91f37685e1a1c Mon Sep 17 00:00:00 2001 From: Werner Fink <[email protected]> Date: Fri, 23 Apr 2021 09:32:09 +0200 Subject: [PATCH] Count every ASCII character Signed-off-by: Werner Fink <[email protected]> --- src/encoding.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git src/encoding.c src/encoding.c index 31d4d125..686be210 100644 --- src/encoding.c +++ src/encoding.c @@ -282,8 +282,7 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \ } \ u = 0; \ for (i = 0; i < __arraycount(dist); i++) { \ - if (dist[i]) \ - u++; \ + u += dist[i]; \ } \ if (u < MIN(nbytes, 3)) \ return 0; \ -- 2.28.0 ++++++ file-5.40-f0601504.patch ++++++ >From f06015040e7ffb3be21bb7622f9f8291b749aaf9 Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Sun, 4 Apr 2021 17:46:17 +0000 Subject: [PATCH] Fix regression after unsigned/signed printing changes by making types unsigned (Richard W.M. Jones) --- magic/Magdir/filesystems | 54 +++++++++++++++++++-------------------- magic/Magdir/linux | 30 +++++++++++----------- tests/Makefile.am | 1 + tests/ext4.result | 1 + tests/ext4.testfile | Bin 0 -> 2048 bytes 5 files changed, 44 insertions(+), 42 deletions(-) create mode 100644 tests/ext4.result create mode 100644 tests/ext4.testfile diff --git magic/Magdir/filesystems magic/Magdir/filesystems index 0cb45cbf..81966d6c 100644 --- magic/Magdir/filesystems +++ magic/Magdir/filesystems @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: filesystems,v 1.140 2021/02/23 00:51:10 christos Exp $ +# $File: filesystems,v 1.141 2021/04/04 17:46:17 christos Exp $ # filesystems: file(1) magic for different filesystems # 0 name partid @@ -1739,12 +1739,12 @@ >>>0x464 lelong >0x0000007 ext4 filesystem data # else large INCOMPAT? >>0x460 lelong >0x000003f ext4 filesystem data ->0x468 belong x \b, UUID=%08x ->0x46c beshort x \b-%04x ->0x46e beshort x \b-%04x ->0x470 beshort x \b-%04x ->0x472 belong x \b-%08x ->0x476 beshort x \b%04x +>0x468 ubelong x \b, UUID=%08x +>0x46c ubeshort x \b-%04x +>0x46e ubeshort x \b-%04x +>0x470 ubeshort x \b-%04x +>0x472 ubelong x \b-%08x +>0x476 ubeshort x \b%04x >0x478 string >0 \b, volume name "%s" # General flags for any ext* fs >0x460 lelong &0x0000004 (needs journal recovery) @@ -1767,12 +1767,12 @@ # f2fs filesystem - Tuomas Tynkkynen <[email protected]> 0x400 lelong 0xF2F52010 F2FS filesystem ->0x46c belong x \b, UUID=%08x ->0x470 beshort x \b-%04x ->0x472 beshort x \b-%04x ->0x474 beshort x \b-%04x ->0x476 belong x \b-%08x ->0x47a beshort x \b%04x +>0x46c ubelong x \b, UUID=%08x +>0x470 ubeshort x \b-%04x +>0x472 ubeshort x \b-%04x +>0x474 ubeshort x \b-%04x +>0x476 ubelong x \b-%08x +>0x47a ubeshort x \b%04x >0x147c lestring16 x \b, volume name "%s" # Minix filesystems - Juan Cespedes <[email protected]> @@ -2296,20 +2296,20 @@ >>0x10060 string >\0 lockproto %s) # Russell Coker <[email protected]> -0x10040 string _BHRfS_M BTRFS Filesystem ->0x1012b string >\0 label "%s", ->0x10090 lelong x sectorsize %d, ->0x10094 lelong x nodesize %d, ->0x10098 lelong x leafsize %d, ->0x10020 belong x UUID=%08x- ->0x10024 beshort x \b%04x- ->0x10026 beshort x \b%04x- ->0x10028 beshort x \b%04x- ->0x1002a beshort x \b%04x ->0x1002c belong x \b%08x, ->0x10078 lequad x %lld/ ->0x10070 lequad x \b%lld bytes used, ->0x10088 lequad x %lld devices +0x10040 string _BHRfS_M BTRFS Filesystem +>0x1012b string >\0 label "%s", +>0x10090 lelong x sectorsize %d, +>0x10094 lelong x nodesize %d, +>0x10098 lelong x leafsize %d, +>0x10020 ubelong x UUID=%08x- +>0x10024 ubeshort x \b%04x- +>0x10026 ubeshort x \b%04x- +>0x10028 ubeshort x \b%04x- +>0x1002a ubeshort x \b%04x +>0x1002c ubelong x \b%08x, +>0x10078 lequad x %lld/ +>0x10070 lequad x \b%lld bytes used, +>0x10088 lequad x %lld devices # dvdisaster's .ecc # From: "Nelson A. de Oliveira" <[email protected]> diff --git magic/Magdir/linux magic/Magdir/linux index 693cef6f..f25243e2 100644 --- magic/Magdir/linux +++ magic/Magdir/linux @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: linux,v 1.77 2021/02/24 23:05:02 christos Exp $ +# $File: linux,v 1.78 2021/04/04 17:46:17 christos Exp $ # linux: file(1) magic for Linux files # # Values for Linux/i386 binaries, from Daniel Quinlan <[email protected]> @@ -83,20 +83,20 @@ # format v1, supported since 1998 0 name linux-swap ->0x400 lelong 1 little endian, version %u, ->>0x404 lelong x size %u pages, ->>0x408 lelong x %u bad pages, ->0x400 belong 1 big endian, version %u, ->>0x404 belong x size %u pages, ->>0x408 belong x %u bad pages, ->0x41c string \0 no label, ->0x41c 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 +>0x400 lelong 1 little endian, version %u, +>>0x404 lelong x size %u pages, +>>0x408 lelong x %u bad pages, +>0x400 belong 1 big endian, version %u, +>>0x404 belong x size %u pages, +>>0x408 belong x %u bad pages, +>0x41c string \0 no label, +>0x41c string >\0 LABEL=%s, +>0x40c ubelong x UUID=%08x +>0x410 ubeshort x \b-%04x +>0x412 ubeshort x \b-%04x +>0x414 ubeshort x \b-%04x +>0x416 ubelong x \b-%08x +>0x41a ubeshort x \b%04x 0xff6 string SWAPSPACE2 Linux swap file, 4k page size, >0 use linux-swap diff --git tests/Makefile.am tests/Makefile.am index b38a25b3..a63c2f65 100644 --- tests/Makefile.am +++ tests/Makefile.am @@ -7,6 +7,7 @@ regex-eol.magic \ CVE-2014-1943.testfile \ JW07022A.mp3.testfile \ escapevel.testfile \ +ext4.testfile \ fit-map-data.testfile \ gedcom.testfile \ hddrawcopytool.testfile \ diff --git tests/ext4.result tests/ext4.result new file mode 100644 index 00000000..e48ac193 --- /dev/null +++ tests/ext4.result @@ -0,0 +1 @@ +Linux rev 1.0 ext4 filesystem data, UUID=d32bbb08-3a76-4510-a064-3045f887dbdf (extents) (64bit) (large files) (huge files) diff --git tests/ext4.testfile tests/ext4.testfile --- /dev/null 2021-03-01 14:57:59.415743101 +0100 +++ tests/ext4.testfile 2021-04-06 09:18:36.952989015 +0200 @@ -0,0 +1,2 @@ +f? -?i`??S?-?i`?<?k?+?:vE?d0E???????o?2I<??b???@-?i` +?!#?4#Ma? ++++++ file-5.40-f7705dca.patch ++++++ >From f7705dca0be7aacc8ce96d842860c419f755c26e Mon Sep 17 00:00:00 2001 From: Christos Zoulas <[email protected]> Date: Fri, 9 Apr 2021 19:16:51 +0000 Subject: [PATCH] fix previous (cast >>) --- src/encoding.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git src/encoding.c src/encoding.c index 691e3e16..0fb1f47b 100644 --- src/encoding.c +++ src/encoding.c @@ -1,5 +1,3 @@ -/* $NetBSD: encoding.c,v 1.1.1.13 2021/04/09 18:58:01 christos Exp $ */ - /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; @@ -37,11 +35,7 @@ #include "file.h" #ifndef lint -#if 0 -FILE_RCSID("@(#)$File: encoding.c,v 1.29 2021/04/09 19:16:19 christos Exp $") -#else -__RCSID("$NetBSD: encoding.c,v 1.1.1.13 2021/04/09 18:58:01 christos Exp $"); -#endif +FILE_RCSID("@(#)$File: encoding.c,v 1.30 2021/04/09 19:16:51 christos Exp $") #endif /* lint */ #include "magic.h" -- 2.28.0 ++++++ file-5.39.tar.gz -> file-5.40.tar.gz ++++++ ++++ 7829 lines of diff (skipped) ++++++ file-secure_getenv.patch ++++++ --- /var/tmp/diff_new_pack.5cIfZr/_old 2021-04-29 01:36:35.722424931 +0200 +++ /var/tmp/diff_new_pack.5cIfZr/_new 2021-04-29 01:36:35.726424936 +0200 @@ -22,7 +22,7 @@ =================================================================== --- file-5.38.orig/src/file.h +++ file-5.38/src/file.h -@@ -676,4 +676,12 @@ static const char *rcsid(const char *p) +@@ -691,4 +691,12 @@ static const char *rcsid(const char *p) #define __RCSID(a) #endif
