summaryrefslogtreecommitdiff
path: root/ext/fileinfo/magicdata.patch
blob: 566c0566da8f2fed9df01170401ceb5600fc3036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
diff --git a/magic/Magdir/rpm b/magic/Magdir/rpm
index 9a795f8..31db083 100644
--- a/magic/Magdir/rpm
+++ b/magic/Magdir/rpm
@@ -29,6 +29,7 @@
 >>8	beshort		17		SuperH
 >>8	beshort		18		Xtensa
 >>8	beshort		255		noarch
+>>10	string		x		%s
 
 #delta RPM    Daniel Novotny (dnovotny@redhat.com)
 0	string		drpm		Delta RPM
diff --git a/magic/Magdir/securitycerts b/magic/Magdir/securitycerts
index 8785dd8..1c340be 100644
--- a/magic/Magdir/securitycerts
+++ b/magic/Magdir/securitycerts
@@ -4,3 +4,5 @@
 0	search/1		-----BEGIN\ CERTIFICATE------	RFC1421 Security Certificate text
 0	search/1		-----BEGIN\ NEW\ CERTIFICATE	RFC1421 Security Certificate Signing Request text
 0	belong	0xedfeedfe	Sun 'jks' Java Keystore File data
+
+0	string \0volume_key	volume_key escrow packet
From 898f5d27b66b5d5592cb56fa9da5b776628ea6ca Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Wed, 31 May 2017 15:48:50 +0000
Subject: [PATCH] Fix \s vs \w confusion.

Upstream commit: https://github.com/file/file/commit/898f5d27b66b5d5592cb56fa9da5b776628ea6ca

Fixes awk/perl script recognition 

Signed-off-by: Marek Cermak <macermak@redhat.com>
---
 magic/Magdir/commands |  4 ++--
 magic/Magdir/images   | 14 +++++++-------
 magic/Magdir/python   |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/magic/Magdir/commands b/magic/Magdir/commands
index 1a46efd8..f4326a9e 100644
--- a/magic/Magdir/commands
+++ b/magic/Magdir/commands
@@ -56,7 +56,7 @@
 !:mime	text/x-awk
 0	string/wt	#!\ /usr/bin/awk	awk script text executable
 !:mime	text/x-awk
-0	regex/4096	=^[A-Za-z0-9_]{0,100}BEGIN[A-Za-z0-9_]{0,100}[{]	awk or perl script text
+0	regex/4096	=^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{]	awk or perl script text
 
 # AT&T Bell Labs' Plan 9 shell
 0	string/wt	#!\ /bin/rc	Plan 9 rc shell script text executable
diff --git a/magic/Magdir/images b/magic/Magdir/images
index ce68e00d..d14c1de1 100644
--- a/magic/Magdir/images
+++ b/magic/Magdir/images
@@ -175,42 +175,42 @@
 >>>&0	regex		=[0-9]{1,50}			\b %s
 
 0	search/1	P1
->0	regex/4		P1[A-Za-z0-9_]
+>0	regex/4		P1[\040\t\f\r\n]
 >>0	use		netpbm
 >>>0	string		x	\b, bitmap
 !:strength + 45
 !:mime	image/x-portable-bitmap
 
 0	search/1	P2
->0	regex/4		P2[A-Za-z0-9_]
+>0	regex/4		P2[\040\t\f\r\n]
 >>0	use		netpbm
 >>>0	string		x	\b, greymap
 !:strength + 45
 !:mime	image/x-portable-greymap
 
 0	search/1	P3
->0	regex/4		P3[A-Za-z0-9_]
+>0	regex/4		P3[\040\t\f\r\n]
 >>0	use		netpbm
 >>>0	string		x	\b, pixmap
 !:strength + 45
 !:mime	image/x-portable-pixmap
 
 0	string		P4
->0	regex/4		P4[A-Za-z0-9_]
+>0	regex/4		P4[\040\t\f\r\n]
 >>0	use		netpbm
 >>>0	string		x	\b, rawbits, bitmap
 !:strength + 45
 !:mime	image/x-portable-bitmap
 
 0	string		P5
->0	regex/4		P5[A-Za-z0-9_]
+>0	regex/4		P5[\040\t\f\r\n]
 >>0	use		netpbm
 >>>0	string		x	\b, rawbits, greymap
 !:strength + 45
 !:mime	image/x-portable-greymap
 
 0	string		P6
->0	regex/4		P6[A-Za-z0-9_]
+>0	regex/4		P6[\040\t\f\r\n]
 >>0	use		netpbm
 >>>0	string		x	\b, rawbits, pixmap
 !:strength + 45
diff --git a/magic/Magdir/python b/magic/Magdir/python
index 81d1cc39..d6c2220a 100644
--- a/magic/Magdir/python
+++ b/magic/Magdir/python
@@ -64,7 +64,7 @@
 # except: or finally:
 # block
 0	search/4096	try:
->&0	regex	\^[A-Za-z0-9_]*except.*:	Python script text executable
+>&0	regex	\^[\040\t\f\r\n]*except.*:	Python script text executable
 !:strength + 15
 !:mime text/x-python
 >&0	search/4096	finally:	Python script text executable
-- 
2.13.3

From 2e5e9e16a4847b2e60cabc70e6b9bd7d633cb68a Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Sat, 22 Jul 2017 17:21:24 +0000
Subject: [PATCH] Strength decreased in magic file magic/Magdir/dump for new-fs
 dump file (little endian) to correctly recognize '*.mo' GNU message catalog
 (little endian).

https://bugzilla.redhat.com/show_bug.cgi?id=1226215

Upstream commit: https://github.com/file/file/commit/2e5e9e16a4847b2e60cabc70e6b9bd7d633cb68a

Signed-off-by: Marek Cermak <macermak@redhat.com>
---
 magic/Magdir/dump | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/magic/Magdir/dump b/magic/Magdir/dump
index 64742b7a..c5711661 100644
--- a/magic/Magdir/dump
+++ b/magic/Magdir/dump
@@ -69,6 +69,8 @@
 >0	use	old-dump-be
 
 24	lelong	60012		new-fs dump file (little endian),
+# to correctly recognize '*.mo' GNU message catalog (little endian)
+!:strength - 15
 >0	use	\^new-dump-be
 
 24	lelong	60011		old-fs dump file (little endian),
-- 
2.13.3

From f0e846528e1c839ab44895a1f13d167a4ad8def3 Mon Sep 17 00:00:00 2001
From: Marek Cermak <macermak@redhat.com>
Date: Wed, 20 Dec 2017 16:18:46 +0100
Subject: [PATCH] Resolves: #1515180 - image/gif classifed as
 application/octet-stream

https://bugzilla.redhat.com/show_bug.cgi?id=1515180

Signed-off-by: Marek Cermak <macermak@redhat.com>
---
 magic/Magdir/images | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/magic/Magdir/images b/magic/Magdir/images
index 69e8e90f..76f7e7da 100644
--- a/magic/Magdir/images
+++ b/magic/Magdir/images
@@ -468,7 +468,9 @@
 !:mime	image/x-unknown
 
 # GIF
+# Strength set up to beat 0x55AA DOS/MBR signature word lookups (+65)
 0	string		GIF8		GIF image data
+!:strength +80
 !:mime	image/gif
 !:apple	8BIMGIFf
 >4	string		7a		\b, version 8%s,
-- 
2.13.6

From bb421c437d406760fb9f70f49e2eb5c504528450 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Mon, 5 Jun 2017 17:40:31 +0000
Subject: [PATCH] use default to avoid dup printing (Stephan Kulow)

---
 magic/Magdir/images | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/magic/Magdir/images b/magic/Magdir/images
index d14c1de19..7e6f74d5e 100644
--- a/magic/Magdir/images
+++ b/magic/Magdir/images
@@ -35,11 +35,6 @@
 >>>16	ubyte			<33
 # skip more by looking for pixel size 0Fh 10h 18h 20h
 >>>>16	ubyte&0xC0		0x00
-# skip 260-16.ico by looking for no color map
->>>>>1	ubyte			0
-# implies no first map entry
->>>>>>3	uleshort		0
->>>>>>>0	use		tga-image
 # Color Map
 >>>>>1	belong&0xfff7ffff	0x01010000
 >>>>>>0		use		tga-image
@@ -47,6 +42,12 @@
 >>>>>>0		use		tga-image
 >>>>>1	belong&0xfff7ffff	0x00030000
 >>>>>>0		use		tga-image
+>>>>>1	default			x
+# skip 260-16.ico by looking for no color map
+>>>>>>1	ubyte			0
+# implies no first map entry
+>>>>>>>3	uleshort		0
+>>>>>>>>0	use		tga-image
 #	display tga bitmap image information
 0	name				tga-image
 >2	ubyte		<34		Targa image data