git: 898496ee09ed - main - MFV: file 5.45.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 10 Sep 2023 19:21:45 UTC
The branch main has been updated by delphij:
URL: https://cgit.FreeBSD.org/src/commit/?id=898496ee09ed2b7d25f6807edc4515628196ec0a
commit 898496ee09ed2b7d25f6807edc4515628196ec0a
Merge: ef8abddf103d 72d4668c77f0
Author: Xin LI <delphij@FreeBSD.org>
AuthorDate: 2023-09-10 19:20:33 +0000
Commit: Xin LI <delphij@FreeBSD.org>
CommitDate: 2023-09-10 19:21:16 +0000
MFV: file 5.45.
MFC after: 3 days
contrib/file/ChangeLog | 64 ++-
contrib/file/README.md | 3 +-
contrib/file/acinclude.m4 | 5 +-
contrib/file/config.guess | 2 +
contrib/file/config.h.in | 21 +
contrib/file/config.sub | 1 +
contrib/file/configure | 184 ++++++-
contrib/file/configure.ac | 40 +-
contrib/file/doc/file.man | 21 +-
contrib/file/doc/libmagic.man | 26 +-
contrib/file/doc/magic.man | 88 ++--
contrib/file/libmagic.pc.in | 1 +
contrib/file/magic/Magdir/algol68 | 12 +-
contrib/file/magic/Magdir/android | 52 +-
contrib/file/magic/Magdir/animation | 25 +-
contrib/file/magic/Magdir/apple | 299 +++++++++--
contrib/file/magic/Magdir/archive | 547 ++++++++++++++++++++-
contrib/file/magic/Magdir/arm | 11 +-
contrib/file/magic/Magdir/asf | 4 +-
contrib/file/magic/Magdir/audio | 17 +-
contrib/file/magic/Magdir/blender | 15 +-
contrib/file/magic/Magdir/bytecode | 13 +-
contrib/file/magic/Magdir/c-lang | 8 +-
contrib/file/magic/Magdir/c64 | 357 +++++++++++++-
contrib/file/magic/Magdir/cad | 40 +-
contrib/file/magic/Magdir/coff | 3 +-
contrib/file/magic/Magdir/commands | 18 +-
contrib/file/magic/Magdir/compress | 88 +++-
contrib/file/magic/Magdir/console | 52 +-
contrib/file/magic/Magdir/crypto | 46 +-
contrib/file/magic/Magdir/database | 62 ++-
contrib/file/magic/Magdir/der | 9 +-
contrib/file/magic/Magdir/dsf | 25 -
contrib/file/magic/Magdir/dwarfs | 45 ++
contrib/file/magic/Magdir/elf | 10 +-
contrib/file/magic/Magdir/filesystems | 211 ++++----
contrib/file/magic/Magdir/firmware | 133 +++++
contrib/file/magic/Magdir/games | 198 +++++++-
contrib/file/magic/Magdir/gentoo | 9 +-
contrib/file/magic/Magdir/geo | 42 +-
contrib/file/magic/Magdir/images | 342 +++++++++++--
contrib/file/magic/Magdir/intel | 8 +-
contrib/file/magic/Magdir/java | 9 +-
contrib/file/magic/Magdir/javascript | 64 ++-
contrib/file/magic/Magdir/jpeg | 8 +-
contrib/file/magic/Magdir/lif | 9 +-
contrib/file/magic/Magdir/linux | 99 +++-
contrib/file/magic/Magdir/llvm | 3 +-
contrib/file/magic/Magdir/macintosh | 56 ++-
contrib/file/magic/Magdir/magic | 65 ++-
contrib/file/magic/Magdir/mail.news | 4 +-
contrib/file/magic/Magdir/map | 7 +-
contrib/file/magic/Magdir/mathematica | 69 ++-
contrib/file/magic/Magdir/meteorological | 8 +-
contrib/file/magic/Magdir/misctools | 66 ++-
contrib/file/magic/Magdir/modem | 12 +-
contrib/file/magic/Magdir/msdos | 460 +++++++++++++++--
contrib/file/magic/Magdir/msooxml | 12 +-
contrib/file/magic/Magdir/ole2compounddocs | 155 ++++--
contrib/file/magic/Magdir/pdf | 6 +-
contrib/file/magic/Magdir/perl | 8 +-
contrib/file/magic/Magdir/playdate | 57 +++
contrib/file/magic/Magdir/printer | 144 +++++-
contrib/file/magic/Magdir/qt | 13 +-
contrib/file/magic/Magdir/rst | 6 +-
contrib/file/magic/Magdir/rust | 21 +
contrib/file/magic/Magdir/scientific | 43 +-
contrib/file/magic/Magdir/sendmail | 4 +-
contrib/file/magic/Magdir/sgml | 13 +-
contrib/file/magic/Magdir/sniffer | 75 ++-
contrib/file/magic/Magdir/softquad | 9 +-
contrib/file/magic/Magdir/spectrum | 118 ++++-
contrib/file/magic/Magdir/sql | 65 ++-
contrib/file/magic/Magdir/ssh | 11 +-
contrib/file/magic/Magdir/svf | 5 +
contrib/file/magic/Magdir/sysex | 6 +-
contrib/file/magic/Magdir/terminfo | 3 +-
contrib/file/magic/Magdir/tex | 10 +-
contrib/file/magic/Magdir/tplink | 13 +-
contrib/file/magic/Magdir/troff | 8 +-
contrib/file/magic/Magdir/uterus | 4 +-
contrib/file/magic/Magdir/varied.script | 64 +--
contrib/file/magic/Magdir/web | 8 +-
contrib/file/magic/Magdir/windows | 532 ++++++++++++++++++--
contrib/file/magic/Magdir/wordprocessors | 72 ++-
contrib/file/magic/Magdir/xenix | 18 +-
contrib/file/magic/Magdir/xilinx | 20 +-
contrib/file/magic/Makefile.am | 8 +-
contrib/file/magic/Makefile.in | 8 +-
contrib/file/src/Makefile.am | 8 +-
contrib/file/src/Makefile.in | 23 +-
contrib/file/src/apprentice.c | 275 ++++++-----
contrib/file/src/apptype.c | 8 +-
contrib/file/src/ascmagic.c | 38 +-
contrib/file/src/asctime_r.c | 4 +-
contrib/file/src/asprintf.c | 2 +-
contrib/file/src/buffer.c | 11 +-
contrib/file/src/cdf.c | 2 +-
contrib/file/src/cdf_time.c | 6 +-
contrib/file/src/compress.c | 389 +++++++++++----
contrib/file/src/ctime_r.c | 4 +-
contrib/file/src/der.c | 12 +-
contrib/file/src/dprintf.c | 2 +-
contrib/file/src/encoding.c | 40 +-
contrib/file/src/file.c | 131 ++---
contrib/file/src/file.h | 187 +++----
contrib/file/src/file_opts.h | 4 +-
contrib/file/src/fmtcheck.c | 2 +-
contrib/file/src/fsmagic.c | 8 +-
contrib/file/src/funcs.c | 120 +++--
contrib/file/src/getline.c | 4 +-
contrib/file/src/getopt_long.c | 2 +-
contrib/file/src/gmtime_r.c | 4 +-
contrib/file/src/is_csv.c | 12 +-
contrib/file/src/is_json.c | 6 +-
contrib/file/src/is_simh.c | 209 ++++++++
contrib/file/src/is_tar.c | 14 +-
contrib/file/src/localtime_r.c | 4 +-
contrib/file/src/magic.c | 60 ++-
contrib/file/src/magic.h.in | 9 +-
contrib/file/src/memtest.c | 3 +-
contrib/file/src/pread.c | 2 +-
contrib/file/src/print.c | 30 +-
contrib/file/src/readcdf.c | 26 +-
contrib/file/src/readelf.c | 72 +--
contrib/file/src/seccomp.c | 3 +-
contrib/file/src/softmagic.c | 252 ++++++----
contrib/file/src/strlcat.c | 2 +-
contrib/file/src/strlcpy.c | 2 +-
contrib/file/src/tar.h | 4 +-
contrib/file/src/vasprintf.c | 7 +-
contrib/file/tests/CVE-2014-1943.result | 2 +-
contrib/file/tests/HWP2016.hwp.result | 1 +
contrib/file/tests/HWP2016.hwp.testfile | Bin 0 -> 9216 bytes
contrib/file/tests/HWP2016.hwpx.zip.result | 1 +
contrib/file/tests/HWP2016.hwpx.zip.testfile | Bin 0 -> 14377 bytes
contrib/file/tests/HWP97.hwp.result | 1 +
contrib/file/tests/HWP97.hwp.testfile | Bin 0 -> 8975 bytes
contrib/file/tests/JW07022A.mp3.result | 2 +-
contrib/file/tests/Makefile.am | 70 ++-
contrib/file/tests/Makefile.in | 70 ++-
contrib/file/tests/android-vdex-1.result | 2 +-
contrib/file/tests/android-vdex-2.result | 2 +-
contrib/file/tests/arj.result | 2 +-
contrib/file/tests/bcachefs.result | 2 +-
contrib/file/tests/bcachefs2.result | 1 +
contrib/file/tests/bcachefs2.testfile | Bin 0 -> 8192 bytes
contrib/file/tests/cl8m8ocofedso.result | 2 +-
contrib/file/tests/cmd1.result | 1 +
contrib/file/tests/cmd1.testfile | 1 +
contrib/file/tests/cmd2.result | 1 +
contrib/file/tests/cmd2.testfile | 1 +
contrib/file/tests/cmd3.result | 1 +
contrib/file/tests/cmd3.testfile | 2 +
contrib/file/tests/cmd4.result | 1 +
contrib/file/tests/cmd4.testfile | 2 +
contrib/file/tests/dsd64-dff.result | 2 +-
contrib/file/tests/dsd64-dsf.result | 2 +-
contrib/file/tests/escapevel.result | 2 +-
contrib/file/tests/ext4.result | 2 +-
contrib/file/tests/fit-map-data.result | 2 +-
contrib/file/tests/gedcom.result | 2 +-
contrib/file/tests/hddrawcopytool.result | 2 +-
contrib/file/tests/hello-racket_rkt.result | 1 +
contrib/file/tests/hello-racket_rkt.testfile | Bin 0 -> 1664 bytes
contrib/file/tests/issue311docx.result | 2 +-
contrib/file/tests/issue359xlsx.result | 2 +-
contrib/file/tests/jpeg-text.result | 1 +
contrib/file/tests/jpeg-text.testfile | 1 +
contrib/file/tests/json1.result | 2 +-
contrib/file/tests/json2.result | 2 +-
contrib/file/tests/json3.result | 2 +-
contrib/file/tests/json4.result | 2 +-
contrib/file/tests/json5.result | 2 +-
contrib/file/tests/json6.result | 2 +-
contrib/file/tests/json7.result | 2 +-
contrib/file/tests/json8.result | 2 +-
contrib/file/tests/jsonlines1.result | 2 +-
contrib/file/tests/matilde.arm.result | 2 +-
contrib/file/tests/multiple-A.magic | 2 +
contrib/file/tests/multiple-B.magic | 2 +
contrib/file/tests/multiple.flags | 1 +
contrib/file/tests/multiple.result | 1 +
contrib/file/tests/multiple.testfile | 1 +
contrib/file/tests/pcjr.result | 2 +-
contrib/file/tests/pgp-binary-key-v2-phil.result | 2 +-
contrib/file/tests/pgp-binary-key-v3-lutz.result | 2 +-
contrib/file/tests/pgp-binary-key-v4-dsa.result | 2 +-
.../pgp-binary-key-v4-ecc-no-userid-secret.result | 2 +-
.../tests/pgp-binary-key-v4-ecc-secret-key.result | 2 +-
.../file/tests/pgp-binary-key-v4-rsa-key.result | 2 +-
.../pgp-binary-key-v4-rsa-no-userid-secret.result | 2 +-
.../tests/pgp-binary-key-v4-rsa-secret-key.result | 2 +-
contrib/file/tests/pnm1.result | 1 +
contrib/file/tests/pnm1.testfile | 5 +
contrib/file/tests/pnm2.result | 1 +
contrib/file/tests/pnm2.testfile | Bin 0 -> 15 bytes
contrib/file/tests/pnm3.result | 1 +
contrib/file/tests/pnm3.testfile | 5 +
contrib/file/tests/regex-eol.result | 2 +-
contrib/file/tests/registry-pol.result | 1 +
contrib/file/tests/registry-pol.testfile | Bin 0 -> 7094 bytes
contrib/file/tests/test.c | 70 ++-
contrib/file/tests/uf2.result | 2 +-
contrib/file/tests/xclbin.result | 1 +
contrib/file/tests/xclbin.testfile | Bin 0 -> 512 bytes
contrib/file/tests/zstd-3-skippable-frames.result | 2 +-
contrib/file/tests/zstd-dictionary-0.result | 2 +-
contrib/file/tests/zstd-dictionary-1.result | 2 +-
contrib/file/tests/zstd-dictionary-2.result | 2 +-
contrib/file/tests/zstd-skippable-frame-0.result | 2 +-
contrib/file/tests/zstd-skippable-frame-4.result | 2 +-
contrib/file/tests/zstd-skippable-frame-8.result | 2 +-
contrib/file/tests/zstd-skippable-frame-C.result | 2 +-
contrib/file/tests/zstd-v0.2-FF.result | 2 +-
contrib/file/tests/zstd-v0.3-FF.result | 2 +-
contrib/file/tests/zstd-v0.4-FF.result | 2 +-
contrib/file/tests/zstd-v0.5-FF.result | 2 +-
contrib/file/tests/zstd-v0.6-FF.result | 2 +-
contrib/file/tests/zstd-v0.7-00.result | 2 +-
contrib/file/tests/zstd-v0.7-21.result | 2 +-
contrib/file/tests/zstd-v0.7-22.result | 2 +-
contrib/file/tests/zstd-v0.8-00.result | 2 +-
contrib/file/tests/zstd-v0.8-01.result | 2 +-
contrib/file/tests/zstd-v0.8-02.result | 2 +-
contrib/file/tests/zstd-v0.8-03.result | 2 +-
contrib/file/tests/zstd-v0.8-16.result | 2 +-
contrib/file/tests/zstd-v0.8-20.result | 2 +-
contrib/file/tests/zstd-v0.8-21.result | 2 +-
contrib/file/tests/zstd-v0.8-22.result | 2 +-
contrib/file/tests/zstd-v0.8-23.result | 2 +-
contrib/file/tests/zstd-v0.8-F4.result | 2 +-
contrib/file/tests/zstd-v0.8-FF.result | 2 +-
lib/libmagic/Makefile | 1 +
lib/libmagic/config.h | 29 +-
235 files changed, 6485 insertions(+), 1560 deletions(-)
diff --cc contrib/file/README.md
index 37a3b17856c6,000000000000..26e38045812c
mode 100644,000000..100644
--- a/contrib/file/README.md
+++ b/contrib/file/README.md
@@@ -1,155 -1,0 +1,156 @@@
+## README for file(1) Command and the libmagic(3) library ##
+
- @(#) $File: README.md,v 1.4 2021/10/21 01:51:31 christos Exp $
++ @(#) $File: README.md,v 1.5 2023/05/28 13:59:47 christos Exp $
+
+- Bug Tracker: <https://bugs.astron.com/>
+- Build Status: <https://travis-ci.org/file/file>
+- Download link: <ftp://ftp.astron.com/pub/file/>
+- E-mail: <christos@astron.com>
+- Fuzzing link: <https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:file>
+- Home page: https://www.darwinsys.com/file/
+- Mailing List archives: <https://mailman.astron.com/pipermail/file/>
+- Mailing List: <file@astron.com>
+- Public repo: <https://github.com/file/file>
+- Test framework: <https://github.com/file/file-tests>
+
+Phone: Do not even think of telephoning me about this program. Send
+cash first!
+
+This is Release 5.x of Ian Darwin's (copyright but distributable)
+file(1) command, an implementation of the Unix File(1) command.
+It knows the 'magic number' of several thousands of file types.
+This version is the standard "file" command for Linux, *BSD, and
+other systems. (See "patchlevel.h" for the exact release number).
+
+The major changes for 5.x are CDF file parsing, indirect magic,
+name/use (recursion) and overhaul in mime and ascii encoding
+handling.
+
+The major feature of 4.x is the refactoring of the code into a
+library, and the re-write of the file command in terms of that
+library. The library itself, libmagic can be used by 3rd party
+programs that wish to identify file types without having to fork()
+and exec() file. The prime contributor for 4.0 was Mans Rullgard.
+
+UNIX is a trademark of UNIX System Laboratories.
+
+The prime contributor to Release 3.8 was Guy Harris, who put in
+megachanges including byte-order independence.
+
+The prime contributor to Release 3.0 was Christos Zoulas, who put
+in hundreds of lines of source code changes, including his own
+ANSIfication of the code (I liked my own ANSIfication better, but
+his (__P()) is the "Berkeley standard" way of doing it, and I wanted
+UCB to include the code...), his HP-like "indirection" (a feature
+of the HP file command, I think), and his mods that finally got
+the uncompress (-z) mode finished and working.
+
+This release has compiled in numerous environments; see PORTING
+for a list and problems.
+
+This fine freeware file(1) follows the USG (System V) model of the
+file command, rather than the Research (V7) version or the V7-derived
+4.[23] Berkeley one. That is, the file /etc/magic contains much of
+the ritual information that is the source of this program's power.
+My version knows a little more magic (including tar archives) than
+System V; the /etc/magic parsing seems to be compatible with the
+(poorly documented) System V /etc/magic format (with one exception;
+see the man page).
+
+In addition, the /etc/magic file is built from a subdirectory
+for easier(?) maintenance. I will act as a clearinghouse for
+magic numbers assigned to all sorts of data files that
+are in reasonable circulation. Send your magic numbers,
+in magic(5) format please, to the maintainer, Christos Zoulas.
+
+COPYING - read this first.
+* `README` - read this second (you are currently reading this file).
+* `INSTALL` - read on how to install
+* `src/apprentice.c` - parses /etc/magic to learn magic
+* `src/apptype.c` - used for OS/2 specific application type magic
+* `src/ascmagic.c` - third & last set of tests, based on hardwired assumptions.
+* `src/asctime_r.c` - replacement for OS's that don't have it.
+* `src/asprintf.c` - replacement for OS's that don't have it.
+* `src/buffer.c` - buffer handling functions.
+* `src/cdf.[ch]` - parser for Microsoft Compound Document Files
+* `src/cdf_time.c` - time converter for CDF.
+* `src/compress.c` - handles decompressing files to look inside.
+* `src/ctime_r.c` - replacement for OS's that don't have it.
+* `src/der.[ch]` - parser for Distinguished Encoding Rules
+* `src/dprintf.c` - replacement for OS's that don't have it.
+* `src/elfclass.h` - common code for elf 32/64.
+* `src/encoding.c` - handles unicode encodings
+* `src/file.c` - the main program
+* `src/file.h` - header file
+* `src/file_opts.h` - list of options
+* `src/fmtcheck.c` - replacement for OS's that don't have it.
+* `src/fsmagic.c` - first set of tests the program runs, based on filesystem info
+* `src/funcs.c` - utilility functions
+* `src/getline.c` - replacement for OS's that don't have it.
+* `src/getopt_long.c` - replacement for OS's that don't have it.
+* `src/gmtime_r.c` - replacement for OS's that don't have it.
+* `src/is_csv.c` - knows about Comma Separated Value file format (RFC 4180).
+* `src/is_json.c` - knows about JavaScript Object Notation format (RFC 8259).
++* `src/is_simh.c` - knows about SIMH tape file format.
+* `src/is_tar.c, tar.h` - knows about Tape ARchive format (courtesy John Gilmore).
+* `src/localtime_r.c` - replacement for OS's that don't have it.
+* `src/magic.h.in` - source file for magic.h
+* `src/mygetopt.h` - replacement for OS's that don't have it.
+* `src/magic.c` - the libmagic api
+* `src/names.h` - header file for ascmagic.c
+* `src/pread.c` - replacement for OS's that don't have it.
+* `src/print.c` - print results, errors, warnings.
+* `src/readcdf.c` - CDF wrapper.
+* `src/readelf.[ch]` - Stand-alone elf parsing code.
+* `src/softmagic.c` - 2nd set of tests, based on /etc/magic
+* `src/mygetopt.h` - replacement for OS's that don't have it.
+* `src/strcasestr.c` - replacement for OS's that don't have it.
+* `src/strlcat.c` - replacement for OS's that don't have it.
+* `src/strlcpy.c` - replacement for OS's that don't have it.
+* `src/strndup.c` - replacement for OS's that don't have it.
+* `src/tar.h` - tar file definitions
+* `src/vasprintf.c` - for systems that don't have it.
+* `doc/file.man` - man page for the command
+* `doc/magic.man` - man page for the magic file, courtesy Guy Harris.
+ Install as magic.4 on USG and magic.5 on V7 or Berkeley; cf Makefile.
+
+Magdir - directory of /etc/magic pieces
+------------------------------------------------------------------------------
+
+If you submit a new magic entry please make sure you read the following
+guidelines:
+
+- Initial match is preferably at least 32 bits long, and is a _unique_ match
+- If this is not feasible, use additional check
+- Match of <= 16 bits are not accepted
+- Delay printing string as much as possible, don't print output too early
+- Avoid printf arbitrary byte as string, which can be a source of
+ crash and buffer overflow
+
+- Provide complete information with entry:
+ * One line short summary
+ * Optional long description
+ * File extension, if applicable
+ * Full name and contact method (for discussion when entry has problem)
+ * Further reference, such as documentation of format
+
+gpg for dummies:
+------------------------------------------------------------------------------
+
+```
+$ gpg --verify file-X.YY.tar.gz.asc file-X.YY.tar.gz
+gpg: assuming signed data in `file-X.YY.tar.gz'
+gpg: Signature made WWW MMM DD HH:MM:SS YYYY ZZZ using DSA key ID KKKKKKKK
+```
+
+To download the key:
+
+```
+$ gpg --keyserver hkp://keys.gnupg.net --recv-keys KKKKKKKK
+```
+------------------------------------------------------------------------------
+
+
+Parts of this software were developed at SoftQuad Inc., developers
+of SGML/HTML/XML publishing software, in Toronto, Canada.
+SoftQuad was swallowed up by Corel in 2002 and does not exist any longer.
diff --cc contrib/file/magic/Magdir/dwarfs
index 000000000000,3700a33c5d7a..3700a33c5d7a
mode 000000,100644..100644
--- a/contrib/file/magic/Magdir/dwarfs
+++ b/contrib/file/magic/Magdir/dwarfs
diff --cc contrib/file/magic/Magdir/firmware
index 000000000000,4835b12e8d04..4835b12e8d04
mode 000000,100644..100644
--- a/contrib/file/magic/Magdir/firmware
+++ b/contrib/file/magic/Magdir/firmware
diff --cc contrib/file/magic/Magdir/playdate
index 000000000000,77f8c689378d..77f8c689378d
mode 000000,100644..100644
--- a/contrib/file/magic/Magdir/playdate
+++ b/contrib/file/magic/Magdir/playdate
diff --cc contrib/file/magic/Magdir/rust
index 000000000000,b1bbd9d9702c..b1bbd9d9702c
mode 000000,100644..100644
--- a/contrib/file/magic/Magdir/rust
+++ b/contrib/file/magic/Magdir/rust
diff --cc contrib/file/magic/Magdir/svf
index 000000000000,b0d5c980f944..b0d5c980f944
mode 000000,100644..100644
--- a/contrib/file/magic/Magdir/svf
+++ b/contrib/file/magic/Magdir/svf
diff --cc contrib/file/src/is_simh.c
index 000000000000,4e78173fc44c..4e78173fc44c
mode 000000,100644..100644
--- a/contrib/file/src/is_simh.c
+++ b/contrib/file/src/is_simh.c
diff --cc contrib/file/tests/HWP2016.hwp.result
index 000000000000,2edd0b53aca7..2edd0b53aca7
mode 000000,100644..100644
--- a/contrib/file/tests/HWP2016.hwp.result
+++ b/contrib/file/tests/HWP2016.hwp.result
diff --cc contrib/file/tests/HWP2016.hwp.testfile
index 000000000000,75ab61d2103b..75ab61d2103b
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/HWP2016.hwpx.zip.result
index 000000000000,6077a602a5cf..6077a602a5cf
mode 000000,100644..100644
--- a/contrib/file/tests/HWP2016.hwpx.zip.result
+++ b/contrib/file/tests/HWP2016.hwpx.zip.result
diff --cc contrib/file/tests/HWP2016.hwpx.zip.testfile
index 000000000000,7f1706369900..7f1706369900
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/HWP97.hwp.result
index 000000000000,d77b46e2935f..d77b46e2935f
mode 000000,100644..100644
--- a/contrib/file/tests/HWP97.hwp.result
+++ b/contrib/file/tests/HWP97.hwp.result
diff --cc contrib/file/tests/HWP97.hwp.testfile
index 000000000000,eeabcce5e090..eeabcce5e090
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/bcachefs2.result
index 000000000000,9ebf64bb55bc..9ebf64bb55bc
mode 000000,100644..100644
--- a/contrib/file/tests/bcachefs2.result
+++ b/contrib/file/tests/bcachefs2.result
diff --cc contrib/file/tests/bcachefs2.testfile
index 000000000000,3391822a79a4..3391822a79a4
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/cmd1.result
index 000000000000,d77043f6046c..d77043f6046c
mode 000000,100644..100644
--- a/contrib/file/tests/cmd1.result
+++ b/contrib/file/tests/cmd1.result
diff --cc contrib/file/tests/cmd1.testfile
index 000000000000,8277edf20418..8277edf20418
mode 000000,100644..100644
--- a/contrib/file/tests/cmd1.testfile
+++ b/contrib/file/tests/cmd1.testfile
diff --cc contrib/file/tests/cmd2.result
index 000000000000,77627c3607e9..77627c3607e9
mode 000000,100644..100644
--- a/contrib/file/tests/cmd2.result
+++ b/contrib/file/tests/cmd2.result
diff --cc contrib/file/tests/cmd2.testfile
index 000000000000,104a0170d847..104a0170d847
mode 000000,100644..100644
--- a/contrib/file/tests/cmd2.testfile
+++ b/contrib/file/tests/cmd2.testfile
diff --cc contrib/file/tests/cmd3.result
index 000000000000,2d100e007008..2d100e007008
mode 000000,100644..100644
--- a/contrib/file/tests/cmd3.result
+++ b/contrib/file/tests/cmd3.result
diff --cc contrib/file/tests/cmd3.testfile
index 000000000000,8287acab425d..8287acab425d
mode 000000,100644..100644
--- a/contrib/file/tests/cmd3.testfile
+++ b/contrib/file/tests/cmd3.testfile
diff --cc contrib/file/tests/cmd4.result
index 000000000000,af635a43ae80..af635a43ae80
mode 000000,100644..100644
--- a/contrib/file/tests/cmd4.result
+++ b/contrib/file/tests/cmd4.result
diff --cc contrib/file/tests/cmd4.testfile
index 000000000000,529053ee86de..529053ee86de
mode 000000,100644..100644
--- a/contrib/file/tests/cmd4.testfile
+++ b/contrib/file/tests/cmd4.testfile
diff --cc contrib/file/tests/hello-racket_rkt.result
index 000000000000,ca2000968f42..ca2000968f42
mode 000000,100644..100644
--- a/contrib/file/tests/hello-racket_rkt.result
+++ b/contrib/file/tests/hello-racket_rkt.result
diff --cc contrib/file/tests/hello-racket_rkt.testfile
index 000000000000,22e944001066..22e944001066
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/jpeg-text.result
index 000000000000,c35c5b716e7f..c35c5b716e7f
mode 000000,100644..100644
--- a/contrib/file/tests/jpeg-text.result
+++ b/contrib/file/tests/jpeg-text.result
diff --cc contrib/file/tests/jpeg-text.testfile
index 000000000000,fe119bdce020..fe119bdce020
mode 000000,100644..100644
--- a/contrib/file/tests/jpeg-text.testfile
+++ b/contrib/file/tests/jpeg-text.testfile
diff --cc contrib/file/tests/multiple-A.magic
index 000000000000,7709bb2c6bf7..7709bb2c6bf7
mode 000000,100644..100644
--- a/contrib/file/tests/multiple-A.magic
+++ b/contrib/file/tests/multiple-A.magic
diff --cc contrib/file/tests/multiple-B.magic
index 000000000000,ccc452d7ab34..ccc452d7ab34
mode 000000,100644..100644
--- a/contrib/file/tests/multiple-B.magic
+++ b/contrib/file/tests/multiple-B.magic
diff --cc contrib/file/tests/multiple.flags
index 000000000000,b68fde2a051d..b68fde2a051d
mode 000000,100644..100644
--- a/contrib/file/tests/multiple.flags
+++ b/contrib/file/tests/multiple.flags
diff --cc contrib/file/tests/multiple.result
index 000000000000,8a8c5dfad20f..8a8c5dfad20f
mode 000000,100644..100644
--- a/contrib/file/tests/multiple.result
+++ b/contrib/file/tests/multiple.result
diff --cc contrib/file/tests/multiple.testfile
index 000000000000,388979a6a744..388979a6a744
mode 000000,100644..100644
--- a/contrib/file/tests/multiple.testfile
+++ b/contrib/file/tests/multiple.testfile
diff --cc contrib/file/tests/pnm1.result
index 000000000000,15d9e82d3edd..15d9e82d3edd
mode 000000,100644..100644
--- a/contrib/file/tests/pnm1.result
+++ b/contrib/file/tests/pnm1.result
diff --cc contrib/file/tests/pnm1.testfile
index 000000000000,448108c5596d..448108c5596d
mode 000000,100644..100644
--- a/contrib/file/tests/pnm1.testfile
+++ b/contrib/file/tests/pnm1.testfile
diff --cc contrib/file/tests/pnm2.result
index 000000000000,e1d9ec93eff0..e1d9ec93eff0
mode 000000,100644..100644
--- a/contrib/file/tests/pnm2.result
+++ b/contrib/file/tests/pnm2.result
diff --cc contrib/file/tests/pnm2.testfile
index 000000000000,baaeb2a1a14c..baaeb2a1a14c
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/pnm3.result
index 000000000000,49b800049583..49b800049583
mode 000000,100644..100644
--- a/contrib/file/tests/pnm3.result
+++ b/contrib/file/tests/pnm3.result
diff --cc contrib/file/tests/pnm3.testfile
index 000000000000,e28b9ab8b80b..e28b9ab8b80b
mode 000000,100644..100644
--- a/contrib/file/tests/pnm3.testfile
+++ b/contrib/file/tests/pnm3.testfile
diff --cc contrib/file/tests/registry-pol.result
index 000000000000,7ca512f0c402..7ca512f0c402
mode 000000,100644..100644
--- a/contrib/file/tests/registry-pol.result
+++ b/contrib/file/tests/registry-pol.result
diff --cc contrib/file/tests/registry-pol.testfile
index 000000000000,643e4a6dffd7..643e4a6dffd7
mode 000000,100644..100644
Binary files differ
diff --cc contrib/file/tests/xclbin.result
index 000000000000,11e31fe5e253..11e31fe5e253
mode 000000,100644..100644
--- a/contrib/file/tests/xclbin.result
+++ b/contrib/file/tests/xclbin.result
diff --cc contrib/file/tests/xclbin.testfile
index 000000000000,7a965c15075d..7a965c15075d
mode 000000,100644..100644
Binary files differ
diff --cc lib/libmagic/Makefile
index 98fcc7168d79,000000000000..5aff4c1a478d
mode 100644,000000..100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@@ -1,90 -1,0 +1,91 @@@
+# Copyright (c) David E. O'Brien, 2000-2004, 2006, 2009
+
+PACKAGE=lib${LIB}
+CONTRDIR= ${SRCTOP}/contrib/file
+.PATH: ${CONTRDIR}
+.PATH: ${CONTRDIR}/src
+.PATH: ${CONTRDIR}/doc
+
+LIB= magic
+SHLIB_MAJOR= 4
+.if !make(build-tools)
+LIBADD= z
+.endif
+MAN= libmagic.3 magic.5
+
+SRCS= apprentice.c apptype.c ascmagic.c buffer.c cdf.c cdf_time.c \
+ compress.c der.c encoding.c fsmagic.c funcs.c is_json.c \
+ is_csv.c \
++ is_simh.c \
+ is_tar.c magic.c print.c readcdf.c readelf.c seccomp.c softmagic.c
+INCS= magic.h
+
+MAGICPATH?= /usr/share/misc
+
+CFLAGS+= -DMAGIC='"${MAGICPATH}/magic"' -DHAVE_CONFIG_H
+CFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${CONTRDIR}/src
+
+WARNS?= 3
+
+CLEANFILES+= magic magic.mgc
+
+FILES= magic magic.mgc
+FILESDIR= ${MAGICPATH}
+
+MAGFILES= ${CONTRDIR}/magic/Header \
+ ${CONTRDIR}/magic/Localstuff \
+ ${CONTRDIR}/magic/Magdir/[a-z]*
+
+
+PACKAGE_VERSION!= sed -n '/define.*PACKAGE_VERSION/{s,[^0-9.],,gp;q;}' ${.CURDIR}/config.h
+
+libmagic.pc: libmagic.pc.in
+ sed -e 's,@prefix@,/usr,g ; \
+ s,@exec_prefix@,$${prefix},g ; \
+ s,@libdir@,${LIBDIR},g ; \
+ s,@sharedlibdir@,${SHLIBDIR},g ; \
+ s,@includedir@,${INCLUDEDIR},g ; \
+ s,@VERSION@,${PACKAGE_VERSION},g ; \
+ s,@LIBS@,,g ;' \
+ ${.ALLSRC} > ${.TARGET}
+
+magic: ${MAGFILES}
+ cat ${.ALLSRC:O} > ${.TARGET}
+
+magic.mgc: magic
+ ${BTOOLSPATH:U.}/mkmagic magic
+
+.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no"
+CLEANFILES+= mkmagic
+DEPENDOBJS+= mkmagic
+build-tools: mkmagic
+mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META}
+ ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \
+ ${.ALLSRC:N*.h:O:u} ${LDADD}
+
+.endif
+.if ${MK_DIRDEPS_BUILD} == "yes"
+BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR}
+.else
+magic.mgc: mkmagic
+.endif
+
+FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \
+ ${.CURDIR}/config.h
+CLEANFILES+= ${MAN}
+.for mp in ${MAN}
+${mp}: ${mp:C/[0-9]/man/}
+ sed -e 's/__FSECTION__/5/g' -e 's/__CSECTION__/1/g' \
+ -e 's/__VERSION__/${FILEVER}/g' \
+ -e 's,__MAGIC__,${MAGICPATH}/magic,g' ${.ALLSRC} > ${.TARGET}
+.endfor
+
+CLEANFILES+= ${INCS}
+.for inc in ${INCS}
+${inc}: ${inc}.in
+ sed -e 's,X.YY,${FILEVER:S,",,g:S,.,,g},g' ${.ALLSRC} > ${.TARGET}
+.endfor
+
+PCFILES= libmagic.pc
+
+.include <bsd.lib.mk>
diff --cc lib/libmagic/config.h
index 220321c64af7,000000000000..b842859fc2ab
mode 100644,000000..100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@@ -1,502 -1,0 +1,523 @@@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Define in built-in ELF support is used */
+#define BUILTIN_ELF 1
+
+/* Enable bzlib compression support */
+/* #undef BZLIBSUPPORT */
+
+/* Define for ELF core file support */
+#define ELFCORE 1
+
+/* Define to 1 if you have the `asctime_r' function. */
+#define HAVE_ASCTIME_R 1
+
+/* Define to 1 if you have the `asprintf' function. */
+#define HAVE_ASPRINTF 1
+
+/* Define to 1 if you have the <byteswap.h> header file. */
- /* #undef HAVE_BYTESWAP_H */
++#define HAVE_BYTESWAP_H 1
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+/* #undef HAVE_BZLIB_H */
+
+/* Define to 1 if you have the `ctime_r' function. */
+#define HAVE_CTIME_R 1
+
+/* HAVE_DAYLIGHT */
+/* #undef HAVE_DAYLIGHT */
+
+/* Define to 1 if you have the declaration of `daylight', and to 0 if you
+ don't. */
+#define HAVE_DECL_DAYLIGHT 0
+
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+ */
+#define HAVE_DECL_TZNAME 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `dprintf' function. */
+#define HAVE_DPRINTF 1
+
+/* Define to 1 if you have the <err.h> header file. */
+#define HAVE_ERR_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fmtcheck' function. */
+#define HAVE_FMTCHECK 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `freelocale' function. */
+#define HAVE_FREELOCALE 1
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
+/* Define to 1 if you have the `getline' function. */
+#define HAVE_GETLINE 1
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
+
+/* Define to 1 if you have the `getopt_long' function. */
+#define HAVE_GETOPT_LONG 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#define HAVE_GMTIME_R 1
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#define HAVE_INTPTR_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+/* #undef HAVE_LIBBZ2 */
+
+/* Define to 1 if you have the `gnurx' library (-lgnurx). */
+/* #undef HAVE_LIBGNURX */
+
++/* Define to 1 if you have the `lz' library (-llz). */
++/* #undef HAVE_LIBLZ */
++
+/* Define to 1 if you have the `lzma' library (-llzma). */
+/* #undef HAVE_LIBLZMA */
+
+/* Define to 1 if you have the `seccomp' library (-lseccomp). */
+/* #undef HAVE_LIBSECCOMP */
+
+/* Define to 1 if you have the `z' library (-lz). */
+#define HAVE_LIBZ 1
+
++/* Define to 1 if you have the `zstd' library (-lzstd). */
++/* #undef HAVE_LIBZSTD */
++
+/* Define to 1 if you have the `localtime_r' function. */
+#define HAVE_LOCALTIME_R 1
+
++/* Define to 1 if you have the <lzlib.h> header file. */
++/* #undef HAVE_LZLIB_H */
++
+/* Define to 1 if you have the <lzma.h> header file. */
+/* #undef HAVE_LZMA_H */
+
+/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
+#define HAVE_MBRTOWC 1
+
+/* Define to 1 if <wchar.h> declares mbstate_t. */
+#define HAVE_MBSTATE_T 1
+
+/* Define to 1 if you have the `memmem' function. */
+#define HAVE_MEMMEM 1
+
+/* Define to 1 if you have the <minix/config.h> header file. */
+/* #undef HAVE_MINIX_CONFIG_H */
+
+/* Define to 1 if you have the `mkostemp' function. */
+#define HAVE_MKOSTEMP 1
+
+/* Define to 1 if you have the `mkstemp' function. */
+#define HAVE_MKSTEMP 1
+
+/* Define to 1 if you have a working `mmap' system call. */
+#define HAVE_MMAP 1
+
+/* Define to 1 if you have the `newlocale' function. */
+#define HAVE_NEWLOCALE 1
+
+/* Define to 1 if you have the `pipe2' function. */
+#ifndef __APPLE__ /* Cross building tools on macOS */
+#define HAVE_PIPE2 1
+#endif
+
+/* Define to 1 if you have the `posix_spawnp' function. */
+#define HAVE_POSIX_SPAWNP 1
+
+/* Define to 1 if you have the `pread' function. */
+#define HAVE_PREAD 1
+
+/* Have sig_t type */
+#define HAVE_SIG_T 1
+
+/* Define to 1 if you have the <spawn.h> header file. */
+#define HAVE_SPAWN_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasestr' function. */
+#define HAVE_STRCASESTR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strndup' function. */
+#define HAVE_STRNDUP 1
+
+/* Define to 1 if you have the `strtof' function. */
+#define HAVE_STRTOF 1
+
+/* HAVE_STRUCT_OPTION */
+#define HAVE_STRUCT_OPTION 1
+
+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+
+/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
+#define HAVE_STRUCT_TM_TM_ZONE 1
+
+/* Define to 1 if you have the <sys/bswap.h> header file. */
+/* #undef HAVE_SYS_BSWAP_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+/* #undef HAVE_SYS_SYSMACROS_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/utime.h> header file. */
+/* #undef HAVE_SYS_UTIME_H */
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* HAVE_TM_ISDST */
+#define HAVE_TM_ISDST 1
+
+/* HAVE_TM_ZONE */
+#define HAVE_TM_ZONE 1
+
+/* HAVE_TZNAME */
+#define HAVE_TZNAME 1
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#define HAVE_UINTPTR_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `uselocale' function. */
+#define HAVE_USELOCALE 1
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimes' function. */
+#define HAVE_UTIMES 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vasprintf' function. */
+#define HAVE_VASPRINTF 1
+
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the <vfork.h> header file. */
+/* #undef HAVE_VFORK_H */
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+ declarations. */
+#define HAVE_VISIBILITY 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
*** 255 LINES SKIPPED ***