From 630e3b25f95e997290db4e2b78feeab78d709fe86bb42d9493ad382670695d6c Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 9 Jan 2023 14:41:18 +0000 Subject: [PATCH] Update to file-5.44 OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=261 --- 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.28-btrfs-image.dif | 2 +- file-5.43.tar.gz | 3 - file-5.43.tar.gz.asc | 6 -- file-5.42.dif => file-5.44.dif | 82 ++++++--------- file-5.44.tar.gz | 3 + file-5.44.tar.gz.asc | 6 ++ file-secure_getenv.patch | 2 +- file-zstd.patch | 179 --------------------------------- file.changes | 14 +++ file.spec | 13 +-- python-magic.changes | 7 +- python-magic.spec | 2 +- 16 files changed, 75 insertions(+), 254 deletions(-) delete mode 100644 file-5.43.tar.gz delete mode 100644 file-5.43.tar.gz.asc rename file-5.42.dif => file-5.44.dif (90%) create mode 100644 file-5.44.tar.gz create mode 100644 file-5.44.tar.gz.asc delete mode 100644 file-zstd.patch diff --git a/file-5.19-biorad.dif b/file-5.19-biorad.dif index 5e7fd59..616f118 100644 --- a/file-5.19-biorad.dif +++ b/file-5.19-biorad.dif @@ -6,7 +6,7 @@ Index: magic/Magdir/images =================================================================== --- magic/Magdir/images.orig +++ magic/Magdir/images -@@ -1969,6 +1969,8 @@ +@@ -2167,6 +2167,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 uleshort <2 diff --git a/file-5.19-printf.dif b/file-5.19-printf.dif index 2762581..f2a2636 100644 --- a/file-5.19-printf.dif +++ b/file-5.19-printf.dif @@ -6,7 +6,7 @@ Index: src/apprentice.c =================================================================== --- src/apprentice.c.orig +++ src/apprentice.c -@@ -2619,7 +2619,7 @@ check_format_type(const char *ptr, int t +@@ -2623,7 +2623,7 @@ check_format_type(const char *ptr, int t } } else h = 0; diff --git a/file-5.19-zip2.0.dif b/file-5.19-zip2.0.dif index 410bff9..313c646 100644 --- a/file-5.19-zip2.0.dif +++ b/file-5.19-zip2.0.dif @@ -6,7 +6,7 @@ Index: magic/Magdir/archive =================================================================== --- magic/Magdir/archive.orig +++ magic/Magdir/archive -@@ -1421,6 +1421,11 @@ +@@ -1504,6 +1504,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 09bfa98..f996930 100644 --- a/file-5.22-elf.dif +++ b/file-5.22-elf.dif @@ -6,7 +6,7 @@ Index: src/readelf.c =================================================================== --- src/readelf.c.orig +++ src/readelf.c -@@ -825,7 +825,7 @@ do_core_note(struct magic_set *ms, unsig +@@ -828,7 +828,7 @@ do_core_note(struct magic_set *ms, unsig default: if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) { @@ -15,7 +15,7 @@ Index: src/readelf.c unsigned char c; /* * Extract the program name. We assume -@@ -837,7 +837,9 @@ do_core_note(struct magic_set *ms, unsig +@@ -840,7 +840,9 @@ do_core_note(struct magic_set *ms, unsig * If the characters aren't all printable, * reject it. */ diff --git a/file-5.28-btrfs-image.dif b/file-5.28-btrfs-image.dif index f4a3e89..1150383 100644 --- a/file-5.28-btrfs-image.dif +++ b/file-5.28-btrfs-image.dif @@ -17,7 +17,7 @@ Index: file-5.43/magic/Magdir/filesystems =================================================================== --- file-5.43.orig/magic/Magdir/filesystems +++ file-5.43/magic/Magdir/filesystems -@@ -2302,20 +2302,29 @@ +@@ -2257,20 +2257,29 @@ >>0x10060 string >\0 lockproto %s) # Russell Coker diff --git a/file-5.43.tar.gz b/file-5.43.tar.gz deleted file mode 100644 index 889e34b..0000000 --- a/file-5.43.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c8015e91ae0e8d0321d94c78239892ef9dbc70c4ade0008c0e95894abfb1991 -size 1162786 diff --git a/file-5.43.tar.gz.asc b/file-5.43.tar.gz.asc deleted file mode 100644 index 9ab5968..0000000 --- a/file-5.43.tar.gz.asc +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iF0EABECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYyDSYwAKCRBxESqxbLM7 -Oq5DAJ4i24Hoo/BQ/twN6reZthvb2VyUsQCfb4+yj6JJW5C0fA++P/KYbrJChug= -=3+aN ------END PGP SIGNATURE----- diff --git a/file-5.42.dif b/file-5.44.dif similarity index 90% rename from file-5.42.dif rename to file-5.44.dif index 17720a2..0cf948a 100644 --- a/file-5.42.dif +++ b/file-5.44.dif @@ -9,10 +9,8 @@ src/dcore.c | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 313 insertions(+), 68 deletions(-) -Index: magic/Magdir/elf -=================================================================== ---- magic/Magdir/elf.orig -+++ magic/Magdir/elf +--- magic/Magdir/elf ++++ magic/Magdir/elf 2023-01-09 14:36:25.751054574 +0000 @@ -152,7 +152,7 @@ >18 leshort 47 Renesas H8/300H, >18 leshort 48 Renesas H8S, @@ -22,10 +20,8 @@ Index: magic/Magdir/elf >18 leshort 51 Stanford MIPS-X, >18 leshort 52 Motorola Coldfire, >18 leshort 53 Motorola M68HC12, -Index: magic/Magdir/linux -=================================================================== ---- magic/Magdir/linux.orig -+++ magic/Magdir/linux +--- magic/Magdir/linux ++++ magic/Magdir/linux 2023-01-09 14:36:25.751054574 +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) @@ -74,21 +70,17 @@ Index: magic/Magdir/linux # 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 -Index: magic/Magdir/msad -=================================================================== ---- /dev/null -+++ magic/Magdir/msad +--- magic/Magdir/msad ++++ magic/Magdir/msad 2023-01-09 14:36:25.751054574 +0000 @@ -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 -Index: magic/Magdir/msdos -=================================================================== ---- magic/Magdir/msdos.orig -+++ magic/Magdir/msdos -@@ -145,9 +145,9 @@ +--- magic/Magdir/msdos ++++ magic/Magdir/msdos 2023-01-09 14:36:25.751054574 +0000 +@@ -296,9 +296,9 @@ >>(0x3c.l+22) leshort&0x0200 >0 (stripped to external PDB) >>(0x3c.l+22) leshort&0x1000 >0 system file >>(0x3c.l+24) leshort 0x010b @@ -100,7 +92,7 @@ Index: magic/Magdir/msdos # 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) -@@ -750,7 +750,7 @@ +@@ -1020,7 +1020,7 @@ >1 leshort <-259 # that offset must be accessible # add 10000h to jump at end of 64 KiB segment, add 1 for jump instruction and 2 for 16-bit offset @@ -109,10 +101,8 @@ Index: magic/Magdir/msdos # after jump next instruction for DEBUGGING! #>>>&-1 ubelong x \b, NEXT instruction %#8.8x >>>0 use msdos-com -Index: magic/Makefile.am -=================================================================== ---- magic/Makefile.am.orig -+++ magic/Makefile.am +--- magic/Makefile.am ++++ magic/Makefile.am 2023-01-09 14:37:10.602219227 +0000 @@ -5,7 +5,7 @@ MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) @@ -130,14 +120,14 @@ Index: magic/Makefile.am $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ -@@ -106,7 +105,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ +@@ -105,7 +104,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ $(MAGIC_FRAGMENT_DIR)/espressif \ $(MAGIC_FRAGMENT_DIR)/esri \ $(MAGIC_FRAGMENT_DIR)/fcs \ -$(MAGIC_FRAGMENT_DIR)/filesystems \ $(MAGIC_FRAGMENT_DIR)/finger \ + $(MAGIC_FRAGMENT_DIR)/firmware \ $(MAGIC_FRAGMENT_DIR)/flash \ - $(MAGIC_FRAGMENT_DIR)/flif \ @@ -152,6 +150,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ $(MAGIC_FRAGMENT_DIR)/java \ $(MAGIC_FRAGMENT_DIR)/javascript \ @@ -176,7 +166,7 @@ Index: magic/Makefile.am $(MAGIC_FRAGMENT_DIR)/msooxml \ $(MAGIC_FRAGMENT_DIR)/msvc \ $(MAGIC_FRAGMENT_DIR)/msx \ -@@ -261,6 +259,8 @@ $(MAGIC_FRAGMENT_DIR)/qt \ +@@ -262,6 +260,8 @@ $(MAGIC_FRAGMENT_DIR)/qt \ $(MAGIC_FRAGMENT_DIR)/revision \ $(MAGIC_FRAGMENT_DIR)/ringdove \ $(MAGIC_FRAGMENT_DIR)/riff \ @@ -185,7 +175,7 @@ Index: magic/Makefile.am $(MAGIC_FRAGMENT_DIR)/rpi \ $(MAGIC_FRAGMENT_DIR)/rpm \ $(MAGIC_FRAGMENT_DIR)/rpmsg \ -@@ -351,9 +351,21 @@ EXTRA_DIST = \ +@@ -353,9 +353,21 @@ EXTRA_DIST = \ $(MAGIC_DIR)/scripts/create_filemagic_flac \ $(MAGIC_FRAGMENTS) @@ -209,7 +199,7 @@ Index: magic/Makefile.am # 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 -@@ -365,19 +377,22 @@ FILE_COMPILE = $(top_builddir)/src/file$ +@@ -367,19 +379,22 @@ FILE_COMPILE = $(top_builddir)/src/file$ FILE_COMPILE_DEP = $(FILE_COMPILE) endif @@ -248,11 +238,9 @@ Index: magic/Makefile.am +# fi) +# $(FILE_COMPILE) -C -m magic +# @rm -fr magic -Index: magic/Makefile.in -=================================================================== ---- magic/Makefile.in.orig -+++ magic/Makefile.in -@@ -283,7 +283,7 @@ top_srcdir = @top_srcdir@ +--- magic/Makefile.in ++++ magic/Makefile.in 2023-01-09 14:37:31.561828862 +0000 +@@ -280,7 +280,7 @@ top_srcdir = @top_srcdir@ MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE) @@ -261,7 +249,7 @@ Index: magic/Makefile.in MAGIC_FRAGMENTS = \ $(MAGIC_DIR)/Header \ $(MAGIC_DIR)/Localstuff \ -@@ -301,7 +301,6 @@ $(MAGIC_FRAGMENT_DIR)/animation \ +@@ -298,7 +298,6 @@ $(MAGIC_FRAGMENT_DIR)/animation \ $(MAGIC_FRAGMENT_DIR)/aout \ $(MAGIC_FRAGMENT_DIR)/apache \ $(MAGIC_FRAGMENT_DIR)/apl \ @@ -269,15 +257,15 @@ Index: magic/Makefile.in $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ -@@ -383,7 +382,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ +@@ -379,7 +378,6 @@ $(MAGIC_FRAGMENT_DIR)/erlang \ $(MAGIC_FRAGMENT_DIR)/espressif \ $(MAGIC_FRAGMENT_DIR)/esri \ $(MAGIC_FRAGMENT_DIR)/fcs \ -$(MAGIC_FRAGMENT_DIR)/filesystems \ $(MAGIC_FRAGMENT_DIR)/finger \ + $(MAGIC_FRAGMENT_DIR)/firmware \ $(MAGIC_FRAGMENT_DIR)/flash \ - $(MAGIC_FRAGMENT_DIR)/flif \ -@@ -429,6 +427,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ +@@ -426,6 +424,8 @@ $(MAGIC_FRAGMENT_DIR)/isz \ $(MAGIC_FRAGMENT_DIR)/java \ $(MAGIC_FRAGMENT_DIR)/javascript \ $(MAGIC_FRAGMENT_DIR)/jpeg \ @@ -286,7 +274,7 @@ Index: magic/Makefile.in $(MAGIC_FRAGMENT_DIR)/karma \ $(MAGIC_FRAGMENT_DIR)/kde \ $(MAGIC_FRAGMENT_DIR)/keepass \ -@@ -439,7 +439,6 @@ $(MAGIC_FRAGMENT_DIR)/lammps \ +@@ -436,7 +436,6 @@ $(MAGIC_FRAGMENT_DIR)/lammps \ $(MAGIC_FRAGMENT_DIR)/lecter \ $(MAGIC_FRAGMENT_DIR)/lex \ $(MAGIC_FRAGMENT_DIR)/lif \ @@ -294,7 +282,7 @@ Index: magic/Makefile.in $(MAGIC_FRAGMENT_DIR)/lisp \ $(MAGIC_FRAGMENT_DIR)/llvm \ $(MAGIC_FRAGMENT_DIR)/locoscript \ -@@ -447,7 +446,6 @@ $(MAGIC_FRAGMENT_DIR)/lua \ +@@ -444,7 +443,6 @@ $(MAGIC_FRAGMENT_DIR)/lua \ $(MAGIC_FRAGMENT_DIR)/luks \ $(MAGIC_FRAGMENT_DIR)/m4 \ $(MAGIC_FRAGMENT_DIR)/mach \ @@ -302,7 +290,7 @@ Index: magic/Makefile.in $(MAGIC_FRAGMENT_DIR)/macos \ $(MAGIC_FRAGMENT_DIR)/magic \ $(MAGIC_FRAGMENT_DIR)/mail.news \ -@@ -471,11 +469,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ +@@ -468,11 +466,11 @@ $(MAGIC_FRAGMENT_DIR)/misctools \ $(MAGIC_FRAGMENT_DIR)/mkid \ $(MAGIC_FRAGMENT_DIR)/mlssa \ $(MAGIC_FRAGMENT_DIR)/mmdf \ @@ -315,7 +303,7 @@ Index: magic/Makefile.in $(MAGIC_FRAGMENT_DIR)/msooxml \ $(MAGIC_FRAGMENT_DIR)/msvc \ $(MAGIC_FRAGMENT_DIR)/msx \ -@@ -538,6 +536,8 @@ $(MAGIC_FRAGMENT_DIR)/qt \ +@@ -536,6 +534,8 @@ $(MAGIC_FRAGMENT_DIR)/qt \ $(MAGIC_FRAGMENT_DIR)/revision \ $(MAGIC_FRAGMENT_DIR)/ringdove \ $(MAGIC_FRAGMENT_DIR)/riff \ @@ -324,7 +312,7 @@ Index: magic/Makefile.in $(MAGIC_FRAGMENT_DIR)/rpi \ $(MAGIC_FRAGMENT_DIR)/rpm \ $(MAGIC_FRAGMENT_DIR)/rpmsg \ -@@ -628,10 +628,22 @@ EXTRA_DIST = \ +@@ -627,10 +627,22 @@ EXTRA_DIST = \ $(MAGIC_DIR)/scripts/create_filemagic_flac \ $(MAGIC_FRAGMENTS) @@ -390,20 +378,16 @@ Index: magic/Makefile.in # 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. -Index: src/Makefile.am -=================================================================== ---- src/Makefile.am.orig -+++ src/Makefile.am +--- src/Makefile.am ++++ src/Makefile.am 2023-01-09 14:36:25.751054574 +0000 @@ -1,4 +1,4 @@ -MAGIC = $(pkgdatadir)/magic +MAGIC = $(sysconfdir)/magic:$(pkgdatadir)/magic lib_LTLIBRARIES = libmagic.la nodist_include_HEADERS = magic.h -Index: src/dcore.c -=================================================================== ---- /dev/null -+++ src/dcore.c +--- src/dcore.c ++++ src/dcore.c 2023-01-09 14:36:25.751054574 +0000 @@ -0,0 +1,207 @@ +/* + * Show goo about ELF core files diff --git a/file-5.44.tar.gz b/file-5.44.tar.gz new file mode 100644 index 0000000..e88de38 --- /dev/null +++ b/file-5.44.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3751c7fba8dbc831cb8d7cc8aff21035459b8ce5155ef8b0880a27d028475f3b +size 1186437 diff --git a/file-5.44.tar.gz.asc b/file-5.44.tar.gz.asc new file mode 100644 index 0000000..09c0df8 --- /dev/null +++ b/file-5.44.tar.gz.asc @@ -0,0 +1,6 @@ +-----BEGIN PGP SIGNATURE----- + +iF0EABECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCY6nndwAKCRBxESqxbLM7 +OiUWAJ9ygauXJ3pohF38SQuLYu+J8qayuwCeIFPcEukUyNuYv04B9FIXkumreI8= +=/CFO +-----END PGP SIGNATURE----- diff --git a/file-secure_getenv.patch b/file-secure_getenv.patch index 4191c61..24030c7 100644 --- a/file-secure_getenv.patch +++ b/file-secure_getenv.patch @@ -6,7 +6,7 @@ --- file-5.42/configure.ac +++ file-5.42/configure.ac 2022-06-13 08:34:50.347521415 +0000 -@@ -122,6 +122,8 @@ if test "$enable_xzlib" != "no"; then +@@ -130,6 +130,8 @@ if test "$enable_xzlib" != "no"; then fi AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[#include ]) diff --git a/file-zstd.patch b/file-zstd.patch deleted file mode 100644 index 24f4834..0000000 --- a/file-zstd.patch +++ /dev/null @@ -1,179 +0,0 @@ -Uses the streaming decompression API of libzstd to obtain inflated info for -magic processing from Zstandard compressed data. ---- - configure.ac | 19 ++++++++++++++ - src/compress.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 87 insertions(+) - -diff --git a/configure.ac b/configure.ac -index ffbe0f69..9172be9d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -49,6 +49,11 @@ AC_ARG_ENABLE([xzlib], - [AS_HELP_STRING([--disable-xzlib], [disable liblzma/xz compression support @<:@default=auto@:>@])]) - AC_MSG_RESULT($enable_xzlib) - -+AC_MSG_CHECKING(for zstdlib support) -+AC_ARG_ENABLE([zstdlib], -+[AS_HELP_STRING([--disable-zstdlib], [disable zstdlib compression support @<:@default=auto@:>@])]) -+AC_MSG_RESULT($enable_zstdlib) -+ - AC_MSG_CHECKING(for libseccomp support) - AC_ARG_ENABLE([libseccomp], - [AS_HELP_STRING([--disable-libseccomp], [disable libseccomp sandboxing @<:@default=auto@:>@])]) -@@ -112,6 +117,9 @@ fi - if test "$enable_xzlib" != "no"; then - AC_CHECK_HEADERS(lzma.h) - fi -+if test "$enable_zstdlib" != "no"; then -+ AC_CHECK_HEADERS(zstd.h zstd_errors.h) -+fi - AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[#include ]) - - dnl Checks for typedefs, structures, and compiler characteristics. -@@ -180,6 +188,9 @@ fi - if test "$enable_xzlib" != "no"; then - AC_CHECK_LIB(lzma, lzma_stream_decoder) - fi -+if test "$enable_zstdlib" != "no"; then -+ AC_CHECK_LIB(zstd, ZSTD_createDStream) -+fi - if test "$enable_libseccomp" != "no"; then - AC_CHECK_LIB(seccomp, seccomp_init) - fi -@@ -215,6 +226,14 @@ fi - if test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_stream_decoder" = "yesyes"; then - AC_DEFINE([XZLIBSUPPORT], 1, [Enable xzlib compression support]) - fi -+if test "$enable_zstdlib" = "yes"; then -+ if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" != "yesyes"; then -+ AC_MSG_ERROR([zstdlib support requested but not found]) -+ fi -+fi -+if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" = "yesyes"; then -+ AC_DEFINE([ZSTDLIBSUPPORT], 1, [Enable zstdlib compression support]) -+fi - - AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc]) - AC_OUTPUT -diff --git a/src/compress.c b/src/compress.c -index 113077ae..abb8e766 100644 ---- a/src/compress.c -+++ b/src/compress.c -@@ -79,6 +79,12 @@ typedef void (*sig_t)(int); - #include - #endif - -+#if defined(HAVE_ZSTD_H) && defined(ZSTDLIBSUPPORT) -+#define BUILTIN_ZSTDLIB -+#include -+#include -+#endif -+ - #ifdef DEBUG - int tty = -1; - #define DPRINTF(...) do { \ -@@ -175,6 +181,7 @@ private const struct { - #define METH_FROZEN 2 - #define METH_BZIP 7 - #define METH_XZ 9 -+#define METH_ZSTD 12 - #define METH_LZMA 13 - #define METH_ZLIB 14 - { { .magic = "\037\235" }, 2, gzip_args, NULL }, /* 0, compressed */ -@@ -223,6 +230,10 @@ private int uncompressbzlib(const unsigned char *, unsigned char **, size_t, - private int uncompressxzlib(const unsigned char *, unsigned char **, size_t, - size_t *); - #endif -+#ifdef BUILTIN_ZSTDLIB -+private int uncompresszstd(const unsigned char *, unsigned char **, size_t, -+ size_t *); -+#endif - - static int makeerror(unsigned char **, size_t *, const char *, ...) - __attribute__((__format__(__printf__, 3, 4))); -@@ -697,6 +708,55 @@ err: - } - #endif - -+#ifdef BUILTIN_ZSTDLIB -+private int -+uncompresszstd(const unsigned char *old, unsigned char **newch, -+ size_t bytes_max, size_t *n) -+{ -+ size_t rc; -+ ZSTD_DStream *zstd; -+ ZSTD_inBuffer in; -+ ZSTD_outBuffer out; -+ -+ if ((zstd = ZSTD_createDStream()) == NULL) -+ return makeerror(newch, n, "No ZSTD decompression stream, %s", strerror(errno)); -+ -+ rc = ZSTD_DCtx_reset(zstd, ZSTD_reset_session_only); -+ if (ZSTD_isError(rc)) -+ goto err; -+ -+ if ((*newch = CAST(unsigned char *, malloc(bytes_max + 1))) == NULL) { -+ ZSTD_freeDStream(zstd); -+ return makeerror(newch, n, "No buffer, %s", strerror(errno)); -+ } -+ -+ in.src = CCAST(const void *, old); -+ in.size = *n; -+ in.pos = 0; -+ out.dst = RCAST(void *, *newch); -+ out.size = bytes_max; -+ out.pos = 0; -+ -+ rc = ZSTD_decompressStream(zstd, &out, &in); -+ if (ZSTD_isError(rc)) -+ goto err; -+ -+ *n = out.pos; -+ -+ ZSTD_freeDStream(zstd); -+ -+ /* let's keep the nul-terminate tradition */ -+ (*newch)[*n] = '\0'; -+ -+ return OKDATA; -+err: -+ ZSTD_freeDStream(zstd); -+ snprintf(RCAST(char *, *newch), bytes_max, "zstd error %d", ZSTD_getErrorCode(rc)); -+ *n = strlen(RCAST(char *, *newch)); -+ return ERRDATA; -+} -+#endif -+ - - static int - makeerror(unsigned char **buf, size_t *len, const char *fmt, ...) -@@ -863,6 +923,10 @@ methodname(size_t method) - case METH_XZ: - case METH_LZMA: - return "xzlib"; -+#endif -+#ifdef BUILTIN_ZSTDLIB -+ case METH_ZSTD: -+ return "zstd"; - #endif - default: - return compr[method].argv[0]; -@@ -899,6 +963,10 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old, - case METH_XZ: - case METH_LZMA: - return uncompressxzlib(old, newch, bytes_max, n); -+#endif -+#ifdef BUILTIN_ZSTDLIB -+ case METH_ZSTD: -+ return uncompresszstd(old, newch, bytes_max, n); - #endif - default: - break; --- -2.37.3 - --- -File mailing list -File@astron.com -https://mailman.astron.com/mailman/listinfo/file diff --git a/file.changes b/file.changes index dda09d1..0e7f738 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Jan 9 14:30:30 UTC 2023 - Dr. Werner Fink + +- Update to 5.43: + * Handle nan's so that we don't get internal floating point exceptions + when they are enabled (Vincent Mihalkovic) + * PR/397: Restore the ability to process files from stdin immediately. + * fixed various clustefuzz issues + * Fix error detection for decompression code (Vincent Mihalkovic) + * Add MAGIC_NO_COMPRESS_FORK and use it to produce a more + meaningful error message if we are sandboxing. + * Add built-in lzip decompression support (Michal Gorny) + * Add built-in zstd decompression support (Martin Rodriguez Reboredo) + ------------------------------------------------------------------- Wed Sep 14 08:58:50 UTC 2022 - Dr. Werner Fink diff --git a/file.spec b/file.spec index ead525e..e8797b5 100644 --- a/file.spec +++ b/file.spec @@ -1,7 +1,7 @@ # # spec file for package file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -34,17 +34,17 @@ Obsoletes: file-64bit %endif # # Set Version also in python-magic.spec -Version: 5.43 +Version: 5.44 Release: 0 Summary: A Tool to Determine File Types License: BSD-2-Clause Group: Productivity/File utilities -Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz +Source0: https://www.astron.com/pub/file/file-%{version}.tar.gz Source2: baselibs.conf Source3: file-rpmlintrc -Source4: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz.asc +Source4: https://www.astron.com/pub/file/file-%{version}.tar.gz.asc Source5: file.keyring -Patch: file-5.42.dif +Patch: file-5.44.dif Patch1: file-5.19-misc.dif Patch4: file-4.24-autoconf.dif Patch5: file-5.14-tex.dif @@ -63,8 +63,6 @@ Patch31: file-5.19-biorad.dif Patch32: file-5.19-clicfs.dif Patch37: file-secure_getenv.patch Patch39: file-5.28-btrfs-image.dif -# Upstream mailing list -Patch42: file-zstd.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global magicdir %{_datadir}/file @@ -109,7 +107,6 @@ to develop applications that require the magic "file" interface. %prep %setup -q -n file-%{version} -%patch42 -p1 %patch1 -p0 -b .misc %patch4 -p0 -b .conf %patch5 -p0 -b .tex diff --git a/python-magic.changes b/python-magic.changes index 7d66fd6..ee680c4 100644 --- a/python-magic.changes +++ b/python-magic.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 9 14:29:09 UTC 2023 - Dr. Werner Fink + +- Update to 5.44 + ------------------------------------------------------------------- Mon Dec 12 08:58:58 UTC 2022 - Dirk Müller @@ -17,7 +22,7 @@ Sat Mar 19 18:01:52 UTC 2022 - Dirk Müller ------------------------------------------------------------------- Tue Oct 19 09:55:47 UTC 2021 - Dr. Werner Fink -- Update to 5.41 +- Update to 5.41 ------------------------------------------------------------------- Sat Apr 3 07:32:11 UTC 2021 - Andreas Stieger diff --git a/python-magic.spec b/python-magic.spec index 70d4bd0..ab83e2e 100644 --- a/python-magic.spec +++ b/python-magic.spec @@ -1,7 +1,7 @@ # # spec file for package python-magic # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed