aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_magic/patterns.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-24 09:06:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-24 09:06:12 +0100
commit231ab5e95dbe16bfcc9696b22536ab70d995c418 (patch)
tree0cb49083fcabb51804013df2d741eaabf7a3aa56 /lualib/lua_magic/patterns.lua
parent9d178a5c16b4db95e83cfe01510664ca59cbe720 (diff)
downloadrspamd-231ab5e95dbe16bfcc9696b22536ab70d995c418.tar.gz
rspamd-231ab5e95dbe16bfcc9696b22536ab70d995c418.zip
[Minor] Add starting mark to patterns with offset 0
Diffstat (limited to 'lualib/lua_magic/patterns.lua')
-rw-r--r--lualib/lua_magic/patterns.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua
index 31267de31..d9604b714 100644
--- a/lualib/lua_magic/patterns.lua
+++ b/lualib/lua_magic/patterns.lua
@@ -26,17 +26,17 @@ local patterns = {
-- These are alternatives
matches = {
{
- string = [[%PDF-\d]],
+ string = [[^%PDF-\d]],
position = 6, -- must be end of the match, as that's how hyperscan works (or use relative_position)
weight = 60,
},
{
- string = [[\012%PDF-\d]],
+ string = [[^\012%PDF-\d]],
position = 7,
weight = 60,
},
{
- string = [[%FDF-\d]],
+ string = [[^%FDF-\d]],
position = 6,
weight = 60,
},
@@ -55,7 +55,7 @@ local patterns = {
rtf = {
matches = {
{
- string = [[{\\rt]],
+ string = [[^{\\rt]],
position = 4,
weight = 60,
}
@@ -181,7 +181,7 @@ local patterns = {
bz2 = {
matches = {
{
- string = "BZ[h0]",
+ string = "^BZ[h0]",
position = 3,
weight = 60,
},
@@ -215,7 +215,7 @@ local patterns = {
zst = {
matches = {
{
- string = [[[\x{22}-\x{40}]\x{B5}\x{2F}\x{FD}]],
+ string = [[^[\x{22}-\x{40}]\x{B5}\x{2F}\x{FD}]],
position = 4,
weight = 60,
},
@@ -374,7 +374,7 @@ local patterns = {
dwg = {
matches = {
{
- string = 'AC10[12][2-9]',
+ string = '^AC10[12][2-9]',
position = 6,
weight = 60,
}