]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #814 in SNORT/snort3 from snort2lua_smb_file to master
authorShawn Turner (shaturne) <shaturne@cisco.com>
Tue, 14 Feb 2017 17:14:57 +0000 (12:14 -0500)
committerShawn Turner (shaturne) <shaturne@cisco.com>
Tue, 14 Feb 2017 17:14:57 +0000 (12:14 -0500)
Squashed commit of the following:

commit 022682efddaa17849e1b74bd93173d8f2fc251b9
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date:   Mon Feb 13 15:21:03 2017 -0500

    snort2lua changes to add file_id when smb file inspection is on

tools/snort2lua/preprocessor_states/pps_dcerpc_server.cc

index 73e88e67b78288dfe61faa0f45dfc213ba2445b4..f0203037340952e12396891009970af62a9e3d2e 100644 (file)
@@ -712,9 +712,24 @@ bool DcerpcServer::convert(std::istringstream& data_stream)
         }
         else if (!keyword.compare("smb_file_inspection"))
         {
+            std::string val;
             table_api.open_table(table_name["smb"]);
             tmpval = parse_smb_file_inspection(data_stream);
-            table_api.close_table();
+            if (!table_api.get_option_value("smb_file_inspection", val))
+            {
+                table_api.close_table();
+            }
+            else
+            {
+                table_api.close_table();
+                if ( val.compare("on") == 0 )
+                {
+                    table_api.open_table("file_id");
+                    table_api.add_option("enable_type", true);
+                    table_api.close_table();
+                }
+            }
+
         }
         else if (!keyword.compare("smb2_max_compound"))
         {