]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #3113 in SNORT/snort3 from ~SBAIGAL/snort3:policy_clone_fix to...
authorRuss Combs (rucombs) <rucombs@cisco.com>
Sun, 17 Oct 2021 22:09:17 +0000 (22:09 +0000)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Sun, 17 Oct 2021 22:09:17 +0000 (22:09 +0000)
Squashed commit of the following:

commit 4ef0ca4751a18219dcca764e81dcd3038d8b573a
Author: Steven Baigal (sbaigal) <sbaigal@cisco.com>
Date:   Sat Oct 16 10:08:05 2021 -0400

    policy: update policy clone code to avoid corrupting active configuration

src/main/policy.cc

index 1c0a30864ab4c2a965c6ba48d37fff739f8f7d03..9006261958fc2ef029d945a8cf36099213312b3e 100644 (file)
@@ -216,7 +216,8 @@ void PolicyMap::clone(PolicyMap *other_map)
     for ( auto p : other_map->shell_map )
     {
         if ( p.second->inspection == other_map->inspection_policy[0] )
-            shell_map[p.first]->inspection = inspection_policy[0];
+            shell_map[p.first] = std::make_shared<PolicyTuple>(inspection_policy[0], p.second->ips,
+                p.second->network);
     }
 
     user_inspection = other_map->user_inspection;