]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Lua_magic: Add bat files detection
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2019 14:59:58 +0000 (15:59 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2019 14:59:58 +0000 (15:59 +0100)
lualib/lua_magic/patterns.lua
lualib/lua_magic/types.lua

index 8d90a45efd2032471eec489c09f47682f1a5e0f5..47026478bab45919848c813aca5b8541bf8b8d5f 100644 (file)
@@ -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,
index 5626b3445faddedf8b09c2686f8d341b64da6c23..4ed378ecdf4f42369c3b56dc762edc0dcc2c13cd 100644 (file)
@@ -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",