From c6dc6da310c1320b507e16fac5f24c704ecdfe1f6279c282509007983e94e659 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 1 Jul 2020 07:55:09 +0000 Subject: [PATCH] Altenate form(at) OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=215 --- file-5.12-zip.dif | 2 +- file-5.16-ocloexec.patch | 10 +++---- file-5.19-biorad.dif | 2 +- file-5.19-printf.dif | 2 +- file-5.19-zip2.0.dif | 2 +- file-5.22-elf.dif | 4 +-- file-5.23-endian.patch | 4 +-- file-5.38-allow-readlinkat.dif | 2 +- file-5.39-alternate_format.dif | 29 +++++++++++++++++++ file-5.38.dif => file-5.39.dif | 52 +++++++++++++++++----------------- file-secure_getenv.patch | 2 +- file.changes | 6 ++++ file.spec | 4 ++- 13 files changed, 79 insertions(+), 42 deletions(-) create mode 100644 file-5.39-alternate_format.dif rename file-5.38.dif => file-5.39.dif (92%) diff --git a/file-5.12-zip.dif b/file-5.12-zip.dif index 88a86b9..cab2d1d 100644 --- a/file-5.12-zip.dif +++ b/file-5.12-zip.dif @@ -4,7 +4,7 @@ --- magic/Magdir/archive +++ magic/Magdir/archive 2019-05-27 08:45:06.163107524 +0000 -@@ -1100,6 +1100,25 @@ +@@ -1110,6 +1110,25 @@ !:strength +1 0 string PK\003\004 !:strength +1 diff --git a/file-5.16-ocloexec.patch b/file-5.16-ocloexec.patch index ac29bf7..b13709c 100644 --- a/file-5.16-ocloexec.patch +++ b/file-5.16-ocloexec.patch @@ -7,7 +7,7 @@ --- src/apprentice.c +++ src/apprentice.c 2019-05-27 08:53:31.057488035 +0000 -@@ -1154,7 +1154,7 @@ load_1(struct magic_set *ms, int action, +@@ -1184,7 +1184,7 @@ load_1(struct magic_set *ms, int action, ssize_t len; struct magic_entry me; @@ -16,7 +16,7 @@ if (f == NULL) { if (errno != ENOENT) file_error(ms, errno, "cannot read magic file `%s'", -@@ -3052,7 +3052,7 @@ apprentice_map(struct magic_set *ms, con +@@ -3108,7 +3108,7 @@ apprentice_map(struct magic_set *ms, con if (dbname == NULL) goto error; @@ -25,7 +25,7 @@ goto error; if (fstat(fd, &st) == -1) { -@@ -3189,7 +3189,7 @@ apprentice_compile(struct magic_set *ms, +@@ -3243,7 +3243,7 @@ apprentice_compile(struct magic_set *ms, if (dbname == NULL) goto out; @@ -36,7 +36,7 @@ goto out; --- src/compress.c +++ src/compress.c 2019-05-27 08:53:31.057488035 +0000 -@@ -460,7 +460,7 @@ file_pipe2file(struct magic_set *ms, int +@@ -462,7 +462,7 @@ file_pipe2file(struct magic_set *ms, int { int te; mode_t ou = umask(0); @@ -47,7 +47,7 @@ (void)unlink(buf); --- src/file.c +++ src/file.c 2019-05-27 08:53:31.057488035 +0000 -@@ -496,7 +496,7 @@ unwrap(struct magic_set *ms, const char +@@ -509,7 +509,7 @@ unwrap(struct magic_set *ms, const char f = stdin; wid = 1; } else { diff --git a/file-5.19-biorad.dif b/file-5.19-biorad.dif index 482cd89..ee76a01 100644 --- a/file-5.19-biorad.dif +++ b/file-5.19-biorad.dif @@ -4,7 +4,7 @@ --- magic/Magdir/images +++ magic/Magdir/images 2019-05-27 08:52:51.674238380 +0000 -@@ -1277,6 +1277,8 @@ +@@ -1290,6 +1290,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 diff --git a/file-5.19-printf.dif b/file-5.19-printf.dif index 6370438..e59d2fd 100644 --- a/file-5.19-printf.dif +++ b/file-5.19-printf.dif @@ -4,7 +4,7 @@ --- src/apprentice.c +++ src/apprentice.c 2019-02-21 06:39:25.249091320 +0000 -@@ -2418,6 +2418,12 @@ check_format_type(const char *ptr, int t +@@ -2465,6 +2465,12 @@ check_format_type(const char *ptr, int t ptr++; if (*ptr == '#') ptr++; diff --git a/file-5.19-zip2.0.dif b/file-5.19-zip2.0.dif index 59b94ba..b5610d3 100644 --- a/file-5.19-zip2.0.dif +++ b/file-5.19-zip2.0.dif @@ -4,7 +4,7 @@ --- magic/Magdir/archive +++ magic/Magdir/archive 2019-02-21 06:49:05.298138025 +0000 -@@ -1092,6 +1092,11 @@ +@@ -1102,6 +1102,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 diff --git a/file-5.22-elf.dif b/file-5.22-elf.dif index f8fe3c8..cee62d6 100644 --- a/file-5.22-elf.dif +++ b/file-5.22-elf.dif @@ -4,7 +4,7 @@ --- src/readelf.c +++ src/readelf.c 2019-02-21 06:41:38.598573505 +0000 -@@ -810,7 +810,7 @@ do_core_note(struct magic_set *ms, unsig +@@ -818,7 +818,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 -@@ -822,7 +822,9 @@ do_core_note(struct magic_set *ms, unsig +@@ -830,7 +830,9 @@ do_core_note(struct magic_set *ms, unsig * If the characters aren't all printable, * reject it. */ diff --git a/file-5.23-endian.patch b/file-5.23-endian.patch index 734c375..d9a44f3 100644 --- a/file-5.23-endian.patch +++ b/file-5.23-endian.patch @@ -14,7 +14,7 @@ #define EATAB {while (isascii(CAST(unsigned char, *l)) && \ isspace(CAST(unsigned char, *l))) ++l;} -@@ -123,9 +123,11 @@ private struct mlist *mlist_alloc(void); +@@ -124,9 +124,11 @@ private struct mlist *mlist_alloc(void); private void mlist_free(struct mlist *); private void byteswap(struct magic *, uint32_t); private void bs1(struct magic *); @@ -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); -@@ -3282,67 +3284,6 @@ byteswap(struct magic *magic, uint32_t n +@@ -3336,67 +3338,6 @@ byteswap(struct magic *magic, uint32_t n } /* diff --git a/file-5.38-allow-readlinkat.dif b/file-5.38-allow-readlinkat.dif index d36886c..7b3db02 100644 --- a/file-5.38-allow-readlinkat.dif +++ b/file-5.38-allow-readlinkat.dif @@ -2,7 +2,7 @@ Index: file-5.38/src/seccomp.c =================================================================== --- file-5.38.orig/src/seccomp.c +++ file-5.38/src/seccomp.c -@@ -202,6 +202,9 @@ enable_sandbox_full(void) +@@ -206,6 +206,9 @@ enable_sandbox_full(void) #ifdef __NR_newfstatat ALLOW_RULE(newfstatat); #endif diff --git a/file-5.39-alternate_format.dif b/file-5.39-alternate_format.dif new file mode 100644 index 0000000..49ce8ba --- /dev/null +++ b/file-5.39-alternate_format.dif @@ -0,0 +1,29 @@ +commit 85b7ab83257b3191a1a7ca044589a092bcef2bb3 +Author: Christos Zoulas +Date: Thu Jun 25 16:52:48 2020 +0000 + + Include # (alternate format) to the list of uninteresting formats + Reported by Werner Fink + +diff --git src/funcs.c src/funcs.c +index 299b8f02..ecbfa28c 100644 +--- src/funcs.c ++++ src/funcs.c +@@ -27,7 +27,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: funcs.c,v 1.116 2020/06/15 00:56:48 christos Exp $") ++FILE_RCSID("@(#)$File: funcs.c,v 1.117 2020/06/25 16:52:48 christos Exp $") + #endif /* lint */ + + #include "magic.h" +@@ -93,7 +93,7 @@ file_checkfmt(char *msg, size_t mlen, const char *fmt) + if (*++p == '%') + continue; + // Skip uninteresting. +- while (strchr("0.'+- ", *p) != NULL) ++ while (strchr("#0.'+- ", *p) != NULL) + p++; + if (*p == '*') { + if (msg) diff --git a/file-5.38.dif b/file-5.39.dif similarity index 92% rename from file-5.38.dif rename to file-5.39.dif index 510a39a..7c71d4e 100644 --- a/file-5.38.dif +++ b/file-5.39.dif @@ -10,8 +10,8 @@ 8 files changed, 312 insertions(+), 67 deletions(-) --- magic/Magdir/elf -+++ magic/Magdir/elf 2019-12-17 09:32:49.679457205 +0000 -@@ -135,7 +135,7 @@ ++++ magic/Magdir/elf 2020-07-01 07:22:26.488294151 +0000 +@@ -136,7 +136,7 @@ >18 leshort 47 Renesas H8/300H, >18 leshort 48 Renesas H8S, >18 leshort 49 Renesas H8/500, @@ -21,8 +21,8 @@ >18 leshort 52 Motorola Coldfire, >18 leshort 53 Motorola M68HC12, --- magic/Magdir/linux -+++ magic/Magdir/linux 2019-12-17 09:32:49.679457205 +0000 -@@ -112,27 +112,31 @@ ++++ magic/Magdir/linux 2020-07-01 07:22:26.488294151 +0000 +@@ -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) # URL: https://www.kernel.org/doc/Documentation/x86/boot.txt @@ -71,7 +71,7 @@ 0 belong 0xb8c0078e Linux kernel >0x1e3 string Loading version 1.3.79 or older --- magic/Magdir/msad -+++ magic/Magdir/msad 2019-12-17 09:32:49.679457205 +0000 ++++ magic/Magdir/msad 2020-07-01 07:22:26.488294151 +0000 @@ -0,0 +1,5 @@ +#------------------------------------------------------------------------------ +# msad: file(1) magic for msad @@ -79,8 +79,8 @@ +# This must precede the heuristic for raw G3 data +4 string Standard\ Jet\ DB Microsoft Access Database --- magic/Magdir/msdos -+++ magic/Magdir/msdos 2019-12-17 09:39:04.532385769 +0000 -@@ -142,9 +142,9 @@ ++++ magic/Magdir/msdos 2020-07-01 07:22:26.492294076 +0000 +@@ -143,9 +143,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 +92,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) -@@ -531,7 +531,7 @@ +@@ -532,7 +532,7 @@ # negative offset, must not lead into PSP >1 short <-259 # that offset must be accessible @@ -102,7 +102,7 @@ # updated by Joerg Jenderek at Oct 2008,2015 --- magic/Makefile.am -+++ magic/Makefile.am 2019-12-17 09:39:43.019659705 +0000 ++++ magic/Makefile.am 2020-07-01 07:22:26.492294076 +0000 @@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) @@ -120,7 +120,7 @@ $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ -@@ -94,7 +93,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ +@@ -96,7 +95,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ $(MAGIC_FRAGMENT_DIR)/espressif \ $(MAGIC_FRAGMENT_DIR)/esri \ $(MAGIC_FRAGMENT_DIR)/fcs \ @@ -128,7 +128,7 @@ $(MAGIC_FRAGMENT_DIR)/finger \ $(MAGIC_FRAGMENT_DIR)/flash \ $(MAGIC_FRAGMENT_DIR)/flif \ -@@ -140,6 +138,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ +@@ -142,6 +140,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ $(MAGIC_FRAGMENT_DIR)/java \ $(MAGIC_FRAGMENT_DIR)/javascript \ $(MAGIC_FRAGMENT_DIR)/jpeg \ @@ -137,7 +137,7 @@ $(MAGIC_FRAGMENT_DIR)/karma \ $(MAGIC_FRAGMENT_DIR)/kde \ $(MAGIC_FRAGMENT_DIR)/keepass \ -@@ -149,14 +149,12 @@ $(MAGIC_FRAGMENT_DIR)/kml \ +@@ -151,14 +151,12 @@ $(MAGIC_FRAGMENT_DIR)/kml \ $(MAGIC_FRAGMENT_DIR)/lecter \ $(MAGIC_FRAGMENT_DIR)/lex \ $(MAGIC_FRAGMENT_DIR)/lif \ @@ -152,7 +152,7 @@ $(MAGIC_FRAGMENT_DIR)/macos \ $(MAGIC_FRAGMENT_DIR)/magic \ $(MAGIC_FRAGMENT_DIR)/mail.news \ -@@ -180,11 +178,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ +@@ -182,11 +180,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ $(MAGIC_FRAGMENT_DIR)/mkid \ $(MAGIC_FRAGMENT_DIR)/mlssa \ $(MAGIC_FRAGMENT_DIR)/mmdf \ @@ -165,7 +165,7 @@ $(MAGIC_FRAGMENT_DIR)/msooxml \ $(MAGIC_FRAGMENT_DIR)/msvc \ $(MAGIC_FRAGMENT_DIR)/msx \ -@@ -240,6 +238,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ +@@ -242,6 +240,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ $(MAGIC_FRAGMENT_DIR)/qt \ $(MAGIC_FRAGMENT_DIR)/revision \ $(MAGIC_FRAGMENT_DIR)/riff \ @@ -174,7 +174,7 @@ $(MAGIC_FRAGMENT_DIR)/rpi \ $(MAGIC_FRAGMENT_DIR)/rpm \ $(MAGIC_FRAGMENT_DIR)/rpmsg \ -@@ -319,8 +319,20 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ +@@ -325,8 +325,20 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ $(MAGIC_FRAGMENT_DIR)/zip \ $(MAGIC_FRAGMENT_DIR)/zyxel @@ -196,7 +196,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 -@@ -332,19 +344,22 @@ FILE_COMPILE = $(top_builddir)/src/file$ +@@ -338,19 +350,22 @@ FILE_COMPILE = $(top_builddir)/src/file$ FILE_COMPILE_DEP = $(FILE_COMPILE) endif @@ -236,7 +236,7 @@ +# $(FILE_COMPILE) -C -m magic +# @rm -fr magic --- magic/Makefile.in -+++ magic/Makefile.in 2019-12-17 09:40:11.435123643 +0000 ++++ magic/Makefile.in 2020-07-01 07:22:26.492294076 +0000 @@ -279,7 +279,7 @@ top_srcdir = @top_srcdir@ MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic @@ -254,7 +254,7 @@ $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ -@@ -367,7 +366,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ +@@ -369,7 +368,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ $(MAGIC_FRAGMENT_DIR)/espressif \ $(MAGIC_FRAGMENT_DIR)/esri \ $(MAGIC_FRAGMENT_DIR)/fcs \ @@ -262,7 +262,7 @@ $(MAGIC_FRAGMENT_DIR)/finger \ $(MAGIC_FRAGMENT_DIR)/flash \ $(MAGIC_FRAGMENT_DIR)/flif \ -@@ -413,6 +411,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ +@@ -415,6 +413,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ $(MAGIC_FRAGMENT_DIR)/java \ $(MAGIC_FRAGMENT_DIR)/javascript \ $(MAGIC_FRAGMENT_DIR)/jpeg \ @@ -271,7 +271,7 @@ $(MAGIC_FRAGMENT_DIR)/karma \ $(MAGIC_FRAGMENT_DIR)/kde \ $(MAGIC_FRAGMENT_DIR)/keepass \ -@@ -422,14 +422,12 @@ $(MAGIC_FRAGMENT_DIR)/kml \ +@@ -424,14 +424,12 @@ $(MAGIC_FRAGMENT_DIR)/kml \ $(MAGIC_FRAGMENT_DIR)/lecter \ $(MAGIC_FRAGMENT_DIR)/lex \ $(MAGIC_FRAGMENT_DIR)/lif \ @@ -286,7 +286,7 @@ $(MAGIC_FRAGMENT_DIR)/macos \ $(MAGIC_FRAGMENT_DIR)/magic \ $(MAGIC_FRAGMENT_DIR)/mail.news \ -@@ -453,11 +451,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ +@@ -455,11 +453,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ $(MAGIC_FRAGMENT_DIR)/mkid \ $(MAGIC_FRAGMENT_DIR)/mlssa \ $(MAGIC_FRAGMENT_DIR)/mmdf \ @@ -299,7 +299,7 @@ $(MAGIC_FRAGMENT_DIR)/msooxml \ $(MAGIC_FRAGMENT_DIR)/msvc \ $(MAGIC_FRAGMENT_DIR)/msx \ -@@ -513,6 +511,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ +@@ -515,6 +513,8 @@ $(MAGIC_FRAGMENT_DIR)/python \ $(MAGIC_FRAGMENT_DIR)/qt \ $(MAGIC_FRAGMENT_DIR)/revision \ $(MAGIC_FRAGMENT_DIR)/riff \ @@ -308,7 +308,7 @@ $(MAGIC_FRAGMENT_DIR)/rpi \ $(MAGIC_FRAGMENT_DIR)/rpm \ $(MAGIC_FRAGMENT_DIR)/rpmsg \ -@@ -592,10 +592,22 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ +@@ -598,10 +598,22 @@ $(MAGIC_FRAGMENT_DIR)/zilog \ $(MAGIC_FRAGMENT_DIR)/zip \ $(MAGIC_FRAGMENT_DIR)/zyxel @@ -332,7 +332,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} -@@ -820,23 +832,25 @@ uninstall-am: uninstall-pkgdataDATA +@@ -826,23 +838,25 @@ uninstall-am: uninstall-pkgdataDATA .PRECIOUS: Makefile @@ -375,7 +375,7 @@ # 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 2019-12-17 09:32:49.711456600 +0000 ++++ src/Makefile.am 2020-07-01 07:22:26.504293856 +0000 @@ -1,4 +1,4 @@ -MAGIC = $(pkgdatadir)/magic +MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic @@ -383,7 +383,7 @@ nodist_include_HEADERS = magic.h --- src/dcore.c -+++ src/dcore.c 2019-12-17 09:32:49.711456600 +0000 ++++ src/dcore.c 2020-07-01 07:22:26.504293856 +0000 @@ -0,0 +1,207 @@ +/* + * Show goo about ELF core files diff --git a/file-secure_getenv.patch b/file-secure_getenv.patch index 050e8cf..0de0b3f 100644 --- a/file-secure_getenv.patch +++ b/file-secure_getenv.patch @@ -22,7 +22,7 @@ Index: file-5.38/src/file.h =================================================================== --- file-5.38.orig/src/file.h +++ file-5.38/src/file.h -@@ -650,4 +650,12 @@ static const char *rcsid(const char *p) +@@ -676,4 +676,12 @@ static const char *rcsid(const char *p) #define __RCSID(a) #endif diff --git a/file.changes b/file.changes index e45e96e..1fb64fa 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 1 07:52:11 UTC 2020 - Dr. Werner Fink + +- Add upstream commit 85b7ab832 as patch file-5.39-alternate_format.dif + to also allow alternate format switch '#' + ------------------------------------------------------------------- Wed Jun 17 14:01:25 UTC 2020 - Paolo Stivanin diff --git a/file.spec b/file.spec index 827bf26..db68119 100644 --- a/file.spec +++ b/file.spec @@ -43,7 +43,7 @@ Source2: baselibs.conf Source3: file-rpmlintrc Source4: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz.asc Source5: file.keyring -Patch: file-5.38.dif +Patch: file-5.39.dif Patch1: file-5.19-misc.dif Patch4: file-4.24-autoconf.dif Patch5: file-5.14-tex.dif @@ -66,6 +66,7 @@ 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 BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -131,6 +132,7 @@ to develop applications that require the magic "file" interface. %patch37 -p1 -b .getenv %patch39 -p1 -b .btrfs %patch40 -p1 -b .readlinkat +%patch42 -p1 -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