]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #721 in SNORT/snort3 from double_lua to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Wed, 23 Nov 2016 22:45:02 +0000 (17:45 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Wed, 23 Nov 2016 22:45:02 +0000 (17:45 -0500)
Squashed commit of the following:

commit b5229dc110c61a58eb586c2a6ef681001dcfacc1
Author: Carter Waxman <cwaxman@cisco.com>
Date:   Mon Nov 21 15:05:39 2016 -0500

    added multiple passes to lua so variables are always set before used

src/managers/snort_config.lua

index 8821730dab2df3ffaf34af472350aca264c76eed..28c87a8124e15e94049f91b3ddd544b7280c4521 100644 (file)
@@ -42,7 +42,18 @@ function snort_traverse(tab, fqn)
     for key,val in pairs(tab) do
         -- skip Lua reserved symbols
         if ( string.sub(key, 1, 1) ~= '_' ) then
-            snort_set(fqn, key, val)
+            if ( type(val) == 'string' ) then
+                snort_set(fqn, key, val)
+            end
+        end
+    end
+
+    for key,val in pairs(tab) do
+        -- skip Lua reserved symbols
+        if ( string.sub(key, 1, 1) ~= '_' ) then
+            if ( type(val) ~= 'string' ) then
+                snort_set(fqn, key, val)
+            end
         end
     end
 end