xref: /PHP-7.3/ext/fileinfo/magicdata.patch (revision 855bbc88)
1diff -u a/magic/Magdir/c-lang b/magic/Magdir/c-lang
2--- a/magic/Magdir/c-lang	2017-08-14 09:40:38.000000000 +0200
3+++ b/magic/Magdir/c-lang	2018-11-10 13:06:33.171398452 +0100
4@@ -13,61 +13,61 @@
5 # C
6 # Check for class if include is found, otherwise class is beaten by include becouse of lowered strength
7 0	regex	\^#include			C
8->0	regex	\^class[[:space:]]+
9+>0	regex/4096	\^class[[:space:]]+
10 >>&0	regex 	\\{[\.\*]\\}(;)?$			\b++
11 >&0	clear	x				source text
12 !:strength + 13
13 !:mime	text/x-c
14-0	regex	\^#[[:space:]]*pragma	C source text
15+0	regex/4096	\^#[[:space:]]*pragma	C source text
16 !:mime	text/x-c
17-0	regex	\^#[[:space:]]*(if\|ifn)def
18->&0	regex	\^#[[:space:]]*endif$	C source text
19+0	regex/4096	\^#[[:space:]]*(if\|ifn)def
20+>&0	regex/4096	\^#[[:space:]]*endif$	C source text
21 !:mime	text/x-c
22-0	regex	\^#[[:space:]]*(if\|ifn)def
23->&0	regex	\^#[[:space:]]*define	C source text
24+0	regex/4096	\^#[[:space:]]*(if\|ifn)def
25+>&0	regex/4096	\^#[[:space:]]*define	C source text
26 !:mime	text/x-c
27-0	regex	\^[[:space:]]*char(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$			C source text
28+0	regex/4096	\^[[:space:]]*char(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$			C source text
29 !:mime	text/x-c
30-0	regex	\^[[:space:]]*double(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$			C source text
31+0	regex/4096	\^[[:space:]]*double(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$			C source text
32 !:mime	text/x-c
33-0	regex	\^[[:space:]]*extern[[:space:]]+		C source text
34+0	regex/4096	\^[[:space:]]*extern[[:space:]]+		C source text
35 !:mime	text/x-c
36-0	regex	\^[[:space:]]*float(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$			C source text
37+0	regex/4096	\^[[:space:]]*float(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$			C source text
38 !:mime	text/x-c
39-0	regex	\^struct[[:space:]]+		C source text
40+0	regex/4096	\^struct[[:space:]]+		C source text
41 !:mime	text/x-c
42-0	regex	\^union[[:space:]]+		C source text
43+0	regex/4096	\^union[[:space:]]+		C source text
44 !:mime	text/x-c
45 0	search/8192	main(
46->&0 regex	\\)[[:space:]]*\\{		C source text
47+>&0 regex/4096	\\)[[:space:]]*\\{		C source text
48 !:mime	text/x-c
49
50 # C++
51 # The strength of these rules is increased so they beat the C rules above
52-0	regex	\^namespace[[:space:]]+[_[:alpha:]]{1,30}[[:space:]]*\\{	C++ source text
53+0	regex/4096	\^namespace[[:space:]]+[_[:alpha:]]{1,30}[[:space:]]*\\{	C++ source text
54 !:strength + 30
55 !:mime	text/x-c++
56 # using namespace [namespace] or using std::[lib]
57-0	regex	\^using[[:space:]]+(namespace\ )?std(::)?[[:alpha:]]*[[:space:]]*;		C++ source text
58+0	regex/4096	\^using[[:space:]]+(namespace\ )?std(::)?[[:alpha:]]*[[:space:]]*;		C++ source text
59 !:strength + 30
60 !:mime	text/x-c++
61-0	regex	\^[[:space:]]*template[[:space:]]*<.*>[[:space:]]*$	C++ source text
62+0	regex/4096	\^[[:space:]]*template[[:space:]]*<.*>[[:space:]]*$	C++ source text
63 !:strength + 30
64 !:mime	text/x-c++
65-0	regex	\^[[:space:]]*virtual[[:space:]]+.*[};][[:space:]]*$		C++ source text
66+0	regex/4096	\^[[:space:]]*virtual[[:space:]]+.*[};][[:space:]]*$		C++ source text
67 !:strength + 30
68 !:mime	text/x-c++
69 # But class alone is reduced to avoid beating php (Jens Schleusener)
70-0	regex	\^[[:space:]]*class[[:space:]]+[[:digit:][:alpha:]:_]+[[:space:]]*\\{(.*[\n]*)*\\}(;)?$		C++ source text
71+0	regex/4096	\^[[:space:]]*class[[:space:]]+[[:digit:][:alpha:]:_]+[[:space:]]*\\{(.*[\n]*)*\\}(;)?$		C++ source text
72 !:strength + 13
73 !:mime	text/x-c++
74-0	regex	\^[[:space:]]*public:		C++ source text
75+0	regex/4096	\^[[:space:]]*public:		C++ source text
76 !:strength + 30
77 !:mime	text/x-c++
78-0	regex	\^[[:space:]]*private:		C++ source text
79+0	regex/4096	\^[[:space:]]*private:		C++ source text
80 !:strength + 30
81 !:mime	text/x-c++
82-0	regex	\^[[:space:]]*protected:		C++ source text
83+0	regex/4096	\^[[:space:]]*protected:		C++ source text
84 !:strength + 30
85 !:mime	text/x-c++
86
87diff -u a/magic/Magdir/python b/magic/Magdir/python
88--- a/magic/Magdir/python	2017-08-14 09:40:38.000000000 +0200
89+++ b/magic/Magdir/python	2018-11-10 13:06:36.799268528 +0100
90@@ -63,7 +63,7 @@
91 !:mime text/x-python
92
93 # import module [as abrev]
94-0	regex	\^import\ [_[:alpha:]]+\ as\ [[:alpha:]][[:space:]]*$ Python script text executable
95+0	regex/4096	\^import\ [_[:alpha:]]+\ as\ [[:alpha:]][[:space:]]*$ Python script text executable
96 !:mime text/x-python
97
98 # comments
99@@ -79,7 +79,7 @@
100 # except: or finally:
101 # block
102 0	search/4096	try:
103->&0	regex	\^[[:space:]]*except.*:$	Python script text executable
104+>&0	regex/4096	\^[[:space:]]*except.*:$	Python script text executable
105 !:strength + 15
106 !:mime text/x-python
107 >&0	search/4096	finally:	Python script text executable
108@@ -91,7 +91,7 @@
109 !:mime text/x-python
110
111 # def name(*args, **kwargs):
112-0	regex	 \^[[:space:]]{0,50}def\ {1,50}[_a-zA-Z]{1,100}
113+0	regex/4096	 \^[[:space:]]{0,50}def\ {1,50}[_a-zA-Z]{1,100}
114 >&0	regex	 \\(([[:alpha:]*_,\ ]){0,255}\\):$ Python script text executable
115 !:strength + 15
116 !:mime text/x-python
117diff -u a/magic/Magdir/rpm b/magic/Magdir/rpm
118--- a/magic/Magdir/rpm	2013-01-11 17:45:23.000000000 +0100
119+++ b/magic/Magdir/rpm	2018-11-10 12:27:29.858619326 +0100
120@@ -29,6 +29,7 @@
121 >>8	beshort		17		SuperH
122 >>8	beshort		18		Xtensa
123 >>8	beshort		255		noarch
124+>>10	string		x		%s
125
126 #delta RPM    Daniel Novotny (dnovotny@redhat.com)
127 0	string		drpm		Delta RPM
128diff -u a/magic/Magdir/ruby b/magic/Magdir/ruby
129--- a/magic/Magdir/ruby	2017-08-14 15:39:18.000000000 +0200
130+++ b/magic/Magdir/ruby	2018-11-10 13:06:28.703557761 +0100
131@@ -22,30 +22,30 @@
132 # What looks like ruby, but does not have a shebang
133 # (modules and such)
134 # From: Lubomir Rintel <lkundrak@v3.sk>
135-0	regex		\^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
136+0	regex/4096		\^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
137 >0	regex		def\ [a-z]|\ do$
138->>&0	regex		\^[[:space:]]*end([[:space:]]+[;#].*)?$		Ruby script text
139+>>&0	regex/4096		\^[[:space:]]*end([[:space:]]+[;#].*)?$		Ruby script text
140 !:strength + 30
141 !:mime	text/x-ruby
142-0	regex		\^[[:space:]]*(class|module)[[:space:]][A-Z]
143+0	regex/4096		\^[[:space:]]*(class|module)[[:space:]][A-Z]
144 >0	regex		(modul|includ)e\ [A-Z]|def\ [a-z]
145->>&0	regex		\^[[:space:]]*end([[:space:]]+[;#].*)?$		Ruby script text
146+>>&0	regex/4096		\^[[:space:]]*end([[:space:]]+[;#].*)?$		Ruby script text
147 !:strength + 30
148 !:mime	text/x-ruby
149 # Classes with no modules or defs, beats simple ASCII
150-0	regex		\^[[:space:]]*(class|module)[[:space:]][A-Z]
151->&0	regex	\^[[:space:]]*end([[:space:]]+[;#if].*)?$		Ruby script text
152+0	regex/4096		\^[[:space:]]*(class|module)[[:space:]][A-Z]
153+>&0	regex/4096	\^[[:space:]]*end([[:space:]]+[;#if].*)?$		Ruby script text
154 !:strength + 10
155 !:mime	text/x-ruby
156 # Looks for function definition to balance python magic
157 # def name (args)
158 # end
159-0	regex		\^[[:space:]]*def\ [a-z]|def\ [[:alpha:]]+::[a-z]
160->&0	regex		\^[[:space:]]*end([[:space:]]+[;#].*)?$		Ruby script text
161+0	regex/4096		\^[[:space:]]*def\ [a-z]|def\ [[:alpha:]]+::[a-z]
162+>&0	regex/4096		\^[[:space:]]*end([[:space:]]+[;#].*)?$		Ruby script text
163 !:strength + 10
164 !:mime	text/x-ruby
165
166-0	regex		\^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'	Ruby script text
167+0	regex/4096		\^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'	Ruby script text
168 !:mime	text/x-ruby
169-0 regex 	\^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+	Ruby script text
170+0 regex/4096 	\^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+	Ruby script text
171 !:mime	text/x-ruby
172diff -u a/magic/Magdir/securitycerts b/magic/Magdir/securitycerts
173--- a/magic/Magdir/securitycerts	2009-09-19 18:28:12.000000000 +0200
174+++ b/magic/Magdir/securitycerts	2018-11-10 12:27:29.858619326 +0100
175@@ -4,3 +4,5 @@
176 0	search/1		-----BEGIN\ CERTIFICATE------	RFC1421 Security Certificate text
177 0	search/1		-----BEGIN\ NEW\ CERTIFICATE	RFC1421 Security Certificate Signing Request text
178 0	belong	0xedfeedfe	Sun 'jks' Java Keystore File data
179+
180+0	string \0volume_key	volume_key escrow packet
181