From 6f36aa7620ecd2728eeb9b266491823028c94419 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:00:11 +0200 Subject: Adding debian version 1:5.45-2. Signed-off-by: Daniel Baumann --- ...E5_45-1-g218fdf81.deal-with-32-bit-time-t.patch | 21 +++++ .../local.don-t-include-libs-in-build.patch | 17 ++++ debian/patches/local.extra-magic.patch | 15 ++++ .../local.manpage-seccomp-is-disabled.patch | 18 +++++ ...al.support-local-definitions-in-etc-magic.patch | 92 ++++++++++++++++++++++ debian/patches/series | 13 +++ debian/patches/upstream.disable.att3b.patch | 43 ++++++++++ 7 files changed, 219 insertions(+) create mode 100644 debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch create mode 100644 debian/patches/local.don-t-include-libs-in-build.patch create mode 100644 debian/patches/local.extra-magic.patch create mode 100644 debian/patches/local.manpage-seccomp-is-disabled.patch create mode 100644 debian/patches/local.support-local-definitions-in-etc-magic.patch create mode 100644 debian/patches/series create mode 100644 debian/patches/upstream.disable.att3b.patch (limited to 'debian/patches') diff --git a/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch b/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch new file mode 100644 index 0000000..178ec54 --- /dev/null +++ b/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch @@ -0,0 +1,21 @@ +Subject: Deal with 32 bit time_t +Origin: FILE5_45-1-g218fdf81 +Upstream-Author: Christos Zoulas +Date: Fri Jul 28 14:38:25 2023 +0000 + +--- a/src/file.h ++++ b/src/file.h +@@ -159,9 +159,11 @@ + /* + * Dec 31, 23:59:59 9999 + * we need to make sure that we don't exceed 9999 because some libc +- * implementations like muslc crash otherwise ++ * implementations like muslc crash otherwise. If you are unlucky ++ * to be running on a system with a 32 bit time_t, then it is even less. + */ +-#define MAX_CTIME CAST(time_t, 0x3afff487cfULL) ++#define MAX_CTIME \ ++ CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL) + + #define FILE_BADSIZE CAST(size_t, ~0ul) + #define MAXDESC 64 /* max len of text description/MIME type */ diff --git a/debian/patches/local.don-t-include-libs-in-build.patch b/debian/patches/local.don-t-include-libs-in-build.patch new file mode 100644 index 0000000..7d0541d --- /dev/null +++ b/debian/patches/local.don-t-include-libs-in-build.patch @@ -0,0 +1,17 @@ +Description: Don't include libs in build +Author: Michael Piefel +Last-Update: 2016-06-27 + + (Reason for this is not at all clear -CB) + +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -502,7 +502,7 @@ + + file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) $(EXTRA_file_DEPENDENCIES) + @rm -f file$(EXEEXT) +- $(AM_V_CCLD)$(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS) ++ $(AM_V_CCLD)$(LINK) $(file_OBJECTS) $(file_LDADD) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) diff --git a/debian/patches/local.extra-magic.patch b/debian/patches/local.extra-magic.patch new file mode 100644 index 0000000..b38154f --- /dev/null +++ b/debian/patches/local.extra-magic.patch @@ -0,0 +1,15 @@ +Subject: Extra magic file, to be upstreamed +Author: Christoph Biedl +Date: 2018-07-18 +Forwarded: not-yet + +--- a/magic/Makefile.am ++++ b/magic/Makefile.am +@@ -10,6 +10,7 @@ + MAGIC_FRAGMENTS = \ + $(MAGIC_DIR)/Header \ + $(MAGIC_DIR)/Localstuff \ ++$(MAGIC_FRAGMENT_DIR)/../../debian/debian-extra-magic \ + $(MAGIC_FRAGMENT_DIR)/acorn \ + $(MAGIC_FRAGMENT_DIR)/adi \ + $(MAGIC_FRAGMENT_DIR)/adventure \ diff --git a/debian/patches/local.manpage-seccomp-is-disabled.patch b/debian/patches/local.manpage-seccomp-is-disabled.patch new file mode 100644 index 0000000..fdc4d2e --- /dev/null +++ b/debian/patches/local.manpage-seccomp-is-disabled.patch @@ -0,0 +1,18 @@ +Subject: Clarify manpage: seccomp is disabled for the time being +Author: Christoph Biedl +Date: 2019-01-11 +Bug-Debian: https://bugs.debian.org/917930 + +--- a/doc/file.man ++++ b/doc/file.man +@@ -390,6 +390,10 @@ + .Fl z + option is specified and the built-in decompressors are not available. + On systems where sandboxing is not available, this option has no effect. ++.Pp ++.Em Note: ++This Debian version of file was built without seccomp support, so this option ++has no effect. + .It Fl v , Fl Fl version + Print the version of the program and exit. + .It Fl z , Fl Fl uncompress diff --git a/debian/patches/local.support-local-definitions-in-etc-magic.patch b/debian/patches/local.support-local-definitions-in-etc-magic.patch new file mode 100644 index 0000000..7d40543 --- /dev/null +++ b/debian/patches/local.support-local-definitions-in-etc-magic.patch @@ -0,0 +1,92 @@ +Description: Support local definitions in /etc/magic +Author: + Michael Piefel , + Judit Foglszinger +Forwarded: no +Last-Update: 2016-06-27 + +--- a/magic/Header ++++ b/magic/Header +@@ -1,5 +1,6 @@ + # Magic data for file(1) command. +-# Format is described in magic(files), where: +-# files is 5 on V7 and BSD, 4 on SV, and ?? on SVID. ++# Format is described in in magic(5). + # Don't edit this file, edit /etc/magic or send your magic improvements +-# to the maintainers, at file@astron.com ++# to the upstream maintainers, at file@astron.com ++# or send your suggested inclusions ++# as a wishlist bug against the file package (using the reportbug utility). +--- /dev/null ++++ b/magic/magic.local +@@ -0,0 +1,3 @@ ++# Magic local data for file(1) command. ++# Insert here your local magic data. Format is described in magic(5). ++ +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -495,7 +495,7 @@ + #ifndef COMPILE_ONLY + map = apprentice_map(ms, fn); + if (map == NULL) { +- if (ms->flags & MAGIC_CHECK) ++ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0) + file_magwarn(NULL, "using regular magic file `%s'", fn); + map = apprentice_load(ms, fn, action); + if (map == NULL) +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -4,7 +4,7 @@ + + bin_PROGRAMS = file + +-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' ++AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"' + AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@ + + libmagic_la_SOURCES = buffer.c magic.c apprentice.c softmagic.c ascmagic.c \ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -361,7 +361,7 @@ + MAGIC = $(pkgdatadir)/magic + lib_LTLIBRARIES = libmagic.la + nodist_include_HEADERS = magic.h +-AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' ++AM_CPPFLAGS = -DMAGIC='"/etc/magic:$(MAGIC)"' + AM_CFLAGS = $(CFLAG_VISIBILITY) @WARNINGS@ + libmagic_la_SOURCES = buffer.c magic.c apprentice.c softmagic.c ascmagic.c \ + encoding.c compress.c is_csv.c is_json.c is_simh.c is_tar.c readelf.c \ +--- a/doc/file.man ++++ b/doc/file.man +@@ -59,7 +59,7 @@ + Exceptions are well-known file formats (core files, tar archives) + that are known to contain binary data. + When modifying magic files or the program itself, make sure to +-.Em preserve these keywords . ++.Em "preserve these keywords" . + Users depend on knowing that all the readable files in a directory + have the word + .Dq text +@@ -102,7 +102,8 @@ + has been applied by extension to data files. + Any file with some invariant identifier at a small fixed + offset into the file can usually be described in this way. +-The information identifying these files is read from the compiled ++The information identifying these files is read from /etc/magic ++and the compiled + magic file + .Pa __MAGIC__.mgc , + or the files in the directory +@@ -575,12 +576,6 @@ + The order of entries in the magic file is significant. + Depending on what system you are using, the order that + they are put together may be incorrect. +-If your old +-.Nm +-command uses a magic file, +-keep the old magic file around for comparison purposes +-(rename it to +-.Pa __MAGIC__.orig ) . + .Sh HISTORY + There has been a + .Nm diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..b6152e1 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,13 @@ +# reverted upstream commits + +# cherry-picked commits. Keep in upstream's chronological order +1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch + +# patches that should go upstream +upstream.disable.att3b.patch + +# local modifications +local.support-local-definitions-in-etc-magic.patch +local.don-t-include-libs-in-build.patch +local.extra-magic.patch +local.manpage-seccomp-is-disabled.patch diff --git a/debian/patches/upstream.disable.att3b.patch b/debian/patches/upstream.disable.att3b.patch new file mode 100644 index 0000000..4e0c61b --- /dev/null +++ b/debian/patches/upstream.disable.att3b.patch @@ -0,0 +1,43 @@ +Subject: Disable att3b/WE32K executables like 3B20 +Author: Christoph Biedl +Date: 2019-12-19 +Bug-Debian: https://bugs.debian.org/913867 +Forwarded: Not yet + +--- a/magic/Magdir/att3b ++++ b/magic/Magdir/att3b +@@ -18,20 +18,20 @@ + # + # WE32K + # +-0 beshort 0560 WE32000 COFF +->18 beshort ^00000020 object +->18 beshort &00000020 executable +->12 belong >0 not stripped +->18 beshort ^00010000 N/A on 3b2/300 w/paging +->18 beshort &00020000 32100 required +->18 beshort &00040000 and MAU hardware required +->20 beshort 0407 (impure) +->20 beshort 0410 (pure) +->20 beshort 0413 (demand paged) +->20 beshort 0443 (target shared library) +->22 beshort >0 - version %d +-0 beshort 0561 WE32000 COFF executable (TV) +->12 belong >0 not stripped ++#0 beshort 0560 WE32000 COFF ++#>18 beshort ^00000020 object ++#>18 beshort &00000020 executable ++#>12 belong >0 not stripped ++#>18 beshort ^00010000 N/A on 3b2/300 w/paging ++#>18 beshort &00020000 32100 required ++#>18 beshort &00040000 and MAU hardware required ++#>20 beshort 0407 (impure) ++#>20 beshort 0410 (pure) ++#>20 beshort 0413 (demand paged) ++#>20 beshort 0443 (target shared library) ++#>22 beshort >0 - version %d ++#0 beshort 0561 WE32000 COFF executable (TV) ++#>12 belong >0 not stripped + #>18 beshort &00020000 - 32100 required + #>18 beshort &00040000 and MAU hardware required + #>22 beshort >0 - version %d -- cgit v1.2.3