]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
tweaking rule_content and changing 'config profile' to reflect changed module name
authorJosh <jrosenba@cisco.com>
Thu, 17 Jul 2014 18:53:51 +0000 (14:53 -0400)
committerJosh <jrosenba@cisco.com>
Thu, 17 Jul 2014 18:53:51 +0000 (14:53 -0400)
tools/snort2lua/config_states/config_profile.cc
tools/snort2lua/rule_states/rule_content.cc

index 258725319db9803853ea0609b627563ba0a9a7cb..d5da9738e7698f1078ec111167e564933c4a7b2b 100644 (file)
@@ -139,7 +139,7 @@ static ConversionState* ctor(Converter* cv, LuaData* ld)
  **************************/
 
 static const std::string rules = "rules";
-static const std::string preprocs = "preprocs";
+static const std::string modules = "modules";
 
 
 static const ConvertMap profile_rules_api =
@@ -151,7 +151,7 @@ static const ConvertMap profile_rules_api =
 static const ConvertMap profile_preprocs_api =
 {
     "profile_preprocs",
-    ctor<&preprocs>,
+    ctor<&modules>,
 };
 
 const ConvertMap* profile_rules_map = &profile_rules_api;
index 2bd45c9e046187e51950ae57574ffec4554adb73..aab5ed1d79a63e8f7208818fb901b7766e4f90b8 100644 (file)
@@ -64,25 +64,17 @@ bool Content<option_name>::convert(std::istringstream& data_stream)
     val = util::get_rule_option_args(data_stream);
     std::istringstream subopts(val);
 
-    while(subopts >> val)
+    while(util::get_string(subopts, keyword, ":"))
     {
         bool tmpval = true;
-        util::trim(val);
-        std::size_t keyword_pos = val.find_first_of(':');
-        std::string keyword;
+        val = std::string();
+        std::string tmp_str;
 
-        if (keyword_pos != std::string::npos)
-        {
-            keyword = val.substr(0, keyword_pos);
-            val = val.substr(keyword_pos + 1, std::string::npos);
-        }
-        else
-        {
-            keyword = val;
-            val = std::string();
-        }
+        // get the rest of this option
+        while(subopts >> tmp_str)
+            val += tmp_str + " ";
 
-        // necessary since get_line and substr return strings with whitespace.
+        // necessary since options contain whitespace
         util::trim(keyword);
         util::trim(val);