Resolves: #1679455 - improve support for Apple formats

This commit is contained in:
Kamil Dudka 2019-03-01 17:58:18 +01:00
parent 325a9464bc
commit 048571427e
2 changed files with 175 additions and 1 deletions

168
file-5.36-apple.patch Normal file
View File

@ -0,0 +1,168 @@
From 9a4e136372fc586a1eb31555b9445612d09c1811 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Thu, 28 Feb 2019 00:52:57 +0000
Subject: [PATCH 1/2] More and fixes to existing apple formats from Greg
Wildman
Upstream-commit: 640752ca17c34f7c0fc9a654213b354553dedbe2
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
magic/Magdir/apple | 103 +++++++++++++++++++++++++++++++++++++++------
1 file changed, 89 insertions(+), 14 deletions(-)
diff --git a/magic/Magdir/apple b/magic/Magdir/apple
index 39e838b..4cc2448 100644
--- a/magic/Magdir/apple
+++ b/magic/Magdir/apple
@@ -11,22 +11,97 @@
0 belong 0x00051600 AppleSingle encoded Macintosh file
0 belong 0x00051607 AppleDouble encoded Macintosh file
+# Type: Apple Emulator WOZ format
+# From: Greg Wildman <greg@apple2.org.za>
+# Ref: https://applesaucefdc.com/woz/reference/
+# Ref: https://applesaucefdc.com/woz/reference2/
+#
+# Note: The following test are mostly identical. I would rather not
+# use a regex to identify the WOZ format number.
+0 string WOZ1
+>4 string \xFF\x0A\x0D\x0A Apple ][ WOZ 1.0 Disk Image
+>12 string INFO
+>>21 byte 01 \b, 5.25 inch
+>>21 byte 02 \b, 3.5 inch
+>>22 byte 01 \b, write protected
+>>23 byte 01 \b, cross track synchronized
+>>25 string/T x \b, %.32s
+0 string WOZ2
+>4 string \xFF\x0A\x0D\x0A Apple ][ WOZ 2.0 Disk Image
+>12 string INFO
+>>21 byte 01 \b, 5.25 inch
+>>21 byte 02 \b, 3.5 inch
+>>22 byte 01 \b, write protected
+>>23 byte 01 \b, cross track synchronized
+>>25 string/T x \b, %.32s
+
+# Type: Apple Emulator disk images
+# From: Greg Wildman <greg@apple2.org.za>
+# ProDOS boot loader?
+0 string \x01\x38\xB0\x03\x4C Apple ProDOS Image
+# Detect Volume Directory block ($02)
+>0x400 string \x00\x00\x03\x00
+>>0x404 byte &0xF0
+>>>0x405 string x \b, Volume /%s
+>>>0x429 leshort x \b, %u Blocks
+# ProDOS ordered ?
+>0xb00 string \x00\x00\x03\x00
+>>0xb04 byte &0xF0
+>>>0xb05 string x \b, Volume /%s
+>>>0xb29 leshort x \b, %u Blocks
+#
+# DOS3.3 boot loader?
+0 string \x01\xA5\x27\xC9\x09\xD0\x18\xA5\x2B
+>0x11001 string \x11\x0F\x03 Apple DOS 3.3 Image
+>>0x11006 byte x \b, Volume %u
+>>0x11034 byte x \b, %u Tracks
+>>0x11035 byte x \b, %u Sectors
+>>0x11036 leshort x \b, %u bytes per sector
+# DOS3.2 ?
+>0x11001 string \x11\x0C\x02 Apple DOS 3.2 Image
+>>0x11006 byte x \b, Volume %u
+>>0x11034 byte x \b, %u Tracks
+>>0x11035 byte x \b, %u Sectors
+>>0x11036 leshort x \b, %u bytes per sector
+# DOS3.1 ?
+>0x11001 string \x11\x0C\x01
+>>0x11c00 string \x00\x11\x0B Apple DOS 3.1 Image
+#
+# Pascal boot loader?
+0 string \x01\xE0\x60\xF0\x03\x4C\xE3\x08\xAD
+>0xd6 pstring SYSTEM.APPLE
+>>0xb00 leshort 0x0000
+>>>0xb04 leshort 0x0000 Apple Pascal Image
+>>>>0xb06 pstring x \b, Volume %s:
+>>>>0xb0e leshort x \b, %u Blocks
+>>>>0xb10 leshort x \b, %u Files
+
# Type: Apple Emulator 2IMG format
# From: Radek Vokal <rvokal@redhat.com>
-0 string 2IMG Apple ][ 2IMG Disk Image
->4 string XGS! \b, XGS
->4 string CTKG \b, Catakig
->4 string ShIm \b, Sheppy's ImageMaker
->4 string WOOF \b, Sweet 16
->4 string B2TR \b, Bernie ][ the Rescue
->4 string !nfc \b, ASIMOV2
->4 string x \b, Unknown Format
->0xc byte 00 \b, DOS 3.3 sector order
->>0x10 byte 00 \b, Volume 254
->>0x10 byte&0x7f x \b, Volume %u
->0xc byte 01 \b, ProDOS sector order
->>0x14 short x \b, %u Blocks
->0xc byte 02 \b, NIB data
+# Update: Greg Wildman <greg@apple2.org.za>
+0 string 2IMG Apple ][ 2IMG Disk Image
+>4 clear
+>4 string XGS! \b, XGS
+>4 string CTKG \b, Catakig
+>4 string ShIm \b, Sheppy's ImageMaker
+>4 string SHEP \b, Sheppy's ImageMaker
+>4 string WOOF \b, Sweet 16
+>4 string B2TR \b, Bernie ][ the Rescue
+>4 string \!nfc \b, ASIMOV2
+>4 string \>BD\< \b, Brutal Deluxe's Cadius
+>4 string CdrP \b, CiderPress
+>4 string Vi\]\[ \b, Virtual ][
+>4 string PRFS \b, ProFUSE
+>4 string FISH \b, FishWings
+>4 string RVLW \b, Revival for Windows
+>4 default x
+>>4 string x \b, Creator tag "%-4.4s"
+>0xc byte 00 \b, DOS 3.3 sector order
+>>0x10 byte 00 \b, Volume 254
+>>0x10 byte&0x7f x \b, Volume %u
+>0xc byte 01 \b, ProDOS sector order
+>>0x14 short x \b, %u Blocks
+>0xc byte 02 \b, NIB data
# magic for Newton PDA package formats
# from Ruda Moura <ruda@helllabs.org>
--
2.17.2
From 51187272ba3490474f2709d3488a219c28316794 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Thu, 28 Feb 2019 00:53:41 +0000
Subject: [PATCH 2/2] fix syntax
Upstream-commit: 4c41a4b6f9fbb95959edda00a2fd3d80e32a914a
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
magic/Magdir/apple | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/magic/Magdir/apple b/magic/Magdir/apple
index 4cc2448..9498cb7 100644
--- a/magic/Magdir/apple
+++ b/magic/Magdir/apple
@@ -80,7 +80,7 @@
# From: Radek Vokal <rvokal@redhat.com>
# Update: Greg Wildman <greg@apple2.org.za>
0 string 2IMG Apple ][ 2IMG Disk Image
->4 clear
+>4 clear x
>4 string XGS! \b, XGS
>4 string CTKG \b, Catakig
>4 string ShIm \b, Sheppy's ImageMaker
@@ -90,7 +90,7 @@
>4 string \!nfc \b, ASIMOV2
>4 string \>BD\< \b, Brutal Deluxe's Cadius
>4 string CdrP \b, CiderPress
->4 string Vi\]\[ \b, Virtual ][
+>4 string Vi][ \b, Virtual ][
>4 string PRFS \b, ProFUSE
>4 string FISH \b, FishWings
>4 string RVLW \b, Revival for Windows
--
2.17.2

View File

@ -15,7 +15,7 @@
Summary: A utility for determining file types
Name: file
Version: 5.36
Release: 1%{?dist}
Release: 2%{?dist}
License: BSD
Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
@ -26,6 +26,9 @@ Patch0: file-localmagic.patch
Patch1: file-4.17-rpm-name.patch
Patch2: file-5.04-volume_key.patch
# improve support for Apple formats (#1679455)
Patch3: file-5.36-apple.patch
URL: http://www.darwinsys.com/file/
Requires: file-libs = %{version}-%{release}
BuildRequires: zlib-devel
@ -202,6 +205,9 @@ cd %{py3dir}
%endif
%changelog
* Fri Mar 01 2019 Kamil Dudka <kdudka@redhat.com> - 5.36-2
- improve support for Apple formats (#1679455)
* Thu Feb 21 2019 Siteshwar Vashisht <svashisht@redhat.com> - 5.36-1
- update to new version 5.36, which fixes the following vulnerabilities:
CVE-2019-8907 - remote denial of service in do_core_note in readelf.c