xref: /PHP-7.2/ext/fileinfo/magicdata.patch (revision 855bbc88)
1diff --git a/magic/Magdir/rpm b/magic/Magdir/rpm
2index 9a795f8..31db083 100644
3--- a/magic/Magdir/rpm
4+++ b/magic/Magdir/rpm
5@@ -29,6 +29,7 @@
6 >>8	beshort		17		SuperH
7 >>8	beshort		18		Xtensa
8 >>8	beshort		255		noarch
9+>>10	string		x		%s
10
11 #delta RPM    Daniel Novotny (dnovotny@redhat.com)
12 0	string		drpm		Delta RPM
13diff --git a/magic/Magdir/securitycerts b/magic/Magdir/securitycerts
14index 8785dd8..1c340be 100644
15--- a/magic/Magdir/securitycerts
16+++ b/magic/Magdir/securitycerts
17@@ -4,3 +4,5 @@
18 0	search/1		-----BEGIN\ CERTIFICATE------	RFC1421 Security Certificate text
19 0	search/1		-----BEGIN\ NEW\ CERTIFICATE	RFC1421 Security Certificate Signing Request text
20 0	belong	0xedfeedfe	Sun 'jks' Java Keystore File data
21+
22+0	string \0volume_key	volume_key escrow packet
23From 898f5d27b66b5d5592cb56fa9da5b776628ea6ca Mon Sep 17 00:00:00 2001
24From: Christos Zoulas <christos@zoulas.com>
25Date: Wed, 31 May 2017 15:48:50 +0000
26Subject: [PATCH] Fix \s vs \w confusion.
27
28Upstream commit: https://github.com/file/file/commit/898f5d27b66b5d5592cb56fa9da5b776628ea6ca
29
30Fixes awk/perl script recognition
31
32Signed-off-by: Marek Cermak <macermak@redhat.com>
33---
34 magic/Magdir/commands |  4 ++--
35 magic/Magdir/images   | 14 +++++++-------
36 magic/Magdir/python   |  4 ++--
37 3 files changed, 11 insertions(+), 11 deletions(-)
38
39diff --git a/magic/Magdir/commands b/magic/Magdir/commands
40index 1a46efd8..f4326a9e 100644
41--- a/magic/Magdir/commands
42+++ b/magic/Magdir/commands
43@@ -56,7 +56,7 @@
44 !:mime	text/x-awk
45 0	string/wt	#!\ /usr/bin/awk	awk script text executable
46 !:mime	text/x-awk
47-0	regex/4096	=^[A-Za-z0-9_]{0,100}BEGIN[A-Za-z0-9_]{0,100}[{]	awk or perl script text
48+0	regex/4096	=^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{]	awk or perl script text
49
50 # AT&T Bell Labs' Plan 9 shell
51 0	string/wt	#!\ /bin/rc	Plan 9 rc shell script text executable
52diff --git a/magic/Magdir/images b/magic/Magdir/images
53index ce68e00d..d14c1de1 100644
54--- a/magic/Magdir/images
55+++ b/magic/Magdir/images
56@@ -175,42 +175,42 @@
57 >>>&0	regex		=[0-9]{1,50}			\b %s
58
59 0	search/1	P1
60->0	regex/4		P1[A-Za-z0-9_]
61+>0	regex/4		P1[\040\t\f\r\n]
62 >>0	use		netpbm
63 >>>0	string		x	\b, bitmap
64 !:strength + 45
65 !:mime	image/x-portable-bitmap
66
67 0	search/1	P2
68->0	regex/4		P2[A-Za-z0-9_]
69+>0	regex/4		P2[\040\t\f\r\n]
70 >>0	use		netpbm
71 >>>0	string		x	\b, greymap
72 !:strength + 45
73 !:mime	image/x-portable-greymap
74
75 0	search/1	P3
76->0	regex/4		P3[A-Za-z0-9_]
77+>0	regex/4		P3[\040\t\f\r\n]
78 >>0	use		netpbm
79 >>>0	string		x	\b, pixmap
80 !:strength + 45
81 !:mime	image/x-portable-pixmap
82
83 0	string		P4
84->0	regex/4		P4[A-Za-z0-9_]
85+>0	regex/4		P4[\040\t\f\r\n]
86 >>0	use		netpbm
87 >>>0	string		x	\b, rawbits, bitmap
88 !:strength + 45
89 !:mime	image/x-portable-bitmap
90
91 0	string		P5
92->0	regex/4		P5[A-Za-z0-9_]
93+>0	regex/4		P5[\040\t\f\r\n]
94 >>0	use		netpbm
95 >>>0	string		x	\b, rawbits, greymap
96 !:strength + 45
97 !:mime	image/x-portable-greymap
98
99 0	string		P6
100->0	regex/4		P6[A-Za-z0-9_]
101+>0	regex/4		P6[\040\t\f\r\n]
102 >>0	use		netpbm
103 >>>0	string		x	\b, rawbits, pixmap
104 !:strength + 45
105diff --git a/magic/Magdir/python b/magic/Magdir/python
106index 81d1cc39..d6c2220a 100644
107--- a/magic/Magdir/python
108+++ b/magic/Magdir/python
109@@ -64,7 +64,7 @@
110 # except: or finally:
111 # block
112 0	search/4096	try:
113->&0	regex	\^[A-Za-z0-9_]*except.*:	Python script text executable
114+>&0	regex	\^[\040\t\f\r\n]*except.*:	Python script text executable
115 !:strength + 15
116 !:mime text/x-python
117 >&0	search/4096	finally:	Python script text executable
118--
1192.13.3
120
121From 2e5e9e16a4847b2e60cabc70e6b9bd7d633cb68a Mon Sep 17 00:00:00 2001
122From: Christos Zoulas <christos@zoulas.com>
123Date: Sat, 22 Jul 2017 17:21:24 +0000
124Subject: [PATCH] Strength decreased in magic file magic/Magdir/dump for new-fs
125 dump file (little endian) to correctly recognize '*.mo' GNU message catalog
126 (little endian).
127
128https://bugzilla.redhat.com/show_bug.cgi?id=1226215
129
130Upstream commit: https://github.com/file/file/commit/2e5e9e16a4847b2e60cabc70e6b9bd7d633cb68a
131
132Signed-off-by: Marek Cermak <macermak@redhat.com>
133---
134 magic/Magdir/dump | 4 +++-
135 1 file changed, 3 insertions(+), 1 deletion(-)
136
137diff --git a/magic/Magdir/dump b/magic/Magdir/dump
138index 64742b7a..c5711661 100644
139--- a/magic/Magdir/dump
140+++ b/magic/Magdir/dump
141@@ -69,6 +69,8 @@
142 >0	use	old-dump-be
143
144 24	lelong	60012		new-fs dump file (little endian),
145+# to correctly recognize '*.mo' GNU message catalog (little endian)
146+!:strength - 15
147 >0	use	\^new-dump-be
148
149 24	lelong	60011		old-fs dump file (little endian),
150--
1512.13.3
152
153From f0e846528e1c839ab44895a1f13d167a4ad8def3 Mon Sep 17 00:00:00 2001
154From: Marek Cermak <macermak@redhat.com>
155Date: Wed, 20 Dec 2017 16:18:46 +0100
156Subject: [PATCH] Resolves: #1515180 - image/gif classifed as
157 application/octet-stream
158
159https://bugzilla.redhat.com/show_bug.cgi?id=1515180
160
161Signed-off-by: Marek Cermak <macermak@redhat.com>
162---
163 magic/Magdir/images | 2 ++
164 1 file changed, 2 insertions(+)
165
166diff --git a/magic/Magdir/images b/magic/Magdir/images
167index 69e8e90f..76f7e7da 100644
168--- a/magic/Magdir/images
169+++ b/magic/Magdir/images
170@@ -468,7 +468,9 @@
171 !:mime	image/x-unknown
172
173 # GIF
174+# Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
175 0	string		GIF8		GIF image data
176+!:strength +80
177 !:mime	image/gif
178 !:apple	8BIMGIFf
179 >4	string		7a		\b, version 8%s,
180--
1812.13.6
182
183From bb421c437d406760fb9f70f49e2eb5c504528450 Mon Sep 17 00:00:00 2001
184From: Christos Zoulas <christos@zoulas.com>
185Date: Mon, 5 Jun 2017 17:40:31 +0000
186Subject: [PATCH] use default to avoid dup printing (Stephan Kulow)
187
188---
189 magic/Magdir/images | 13 +++++++------
190 1 file changed, 7 insertions(+), 6 deletions(-)
191
192diff --git a/magic/Magdir/images b/magic/Magdir/images
193index d14c1de19..7e6f74d5e 100644
194--- a/magic/Magdir/images
195+++ b/magic/Magdir/images
196@@ -35,11 +35,6 @@
197 >>>16	ubyte			<33
198 # skip more by looking for pixel size 0Fh 10h 18h 20h
199 >>>>16	ubyte&0xC0		0x00
200-# skip 260-16.ico by looking for no color map
201->>>>>1	ubyte			0
202-# implies no first map entry
203->>>>>>3	uleshort		0
204->>>>>>>0	use		tga-image
205 # Color Map
206 >>>>>1	belong&0xfff7ffff	0x01010000
207 >>>>>>0		use		tga-image
208@@ -47,6 +42,12 @@
209 >>>>>>0		use		tga-image
210 >>>>>1	belong&0xfff7ffff	0x00030000
211 >>>>>>0		use		tga-image
212+>>>>>1	default			x
213+# skip 260-16.ico by looking for no color map
214+>>>>>>1	ubyte			0
215+# implies no first map entry
216+>>>>>>>3	uleshort		0
217+>>>>>>>>0	use		tga-image
218 #	display tga bitmap image information
219 0	name				tga-image
220 >2	ubyte		<34		Targa image data
221