From: Vsevolod Stakhov Date: Tue, 24 Sep 2019 14:59:58 +0000 (+0100) Subject: [Minor] Lua_magic: Add bat files detection X-Git-Tag: 2.0~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=415bcce9f46adc023de100c535ac53981ce8851f;p=thirdparty%2Frspamd.git [Minor] Lua_magic: Add bat files detection --- diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua index 8d90a45efd..47026478ba 100644 --- a/lualib/lua_magic/patterns.lua +++ b/lualib/lua_magic/patterns.lua @@ -129,6 +129,15 @@ local patterns = { }, } }, + bat = { + matches = { + { + string = [[(?i)@\s*ECHO\s+OFF]], + position = {'>=', 0}, + weight = 60, + }, + } + }, class = { -- Technically, this also matches MachO files, but I don't care about -- Apple and their mental health problems here: just consider Java files, diff --git a/lualib/lua_magic/types.lua b/lualib/lua_magic/types.lua index 5626b3445f..4ed378ecdf 100644 --- a/lualib/lua_magic/types.lua +++ b/lualib/lua_magic/types.lua @@ -47,6 +47,10 @@ local types = { ct = 'application/vnd.android.package-archive', type = 'archive', }, + bat = { + ct = 'application/x-bat', + type = 'executable', + }, -- text rtf = { ct = "application/rtf",