From d378152135a49642975cb5a2ce5a106fe7a8fe07 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 11 Nov 2011 15:00:08 +0000 Subject: Correct the copying of rules during config sync it was copying the wrong rules. --- config/snort/snort.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/snort') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 72be9191..0e624c7f 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -1149,7 +1149,9 @@ function create_rules_iface($id, $if_real, $snort_uuid) $folder_chk = (count(glob("{$if_rule_dir}/rules/*")) === 0) ? 'empty' : 'full'; if ($folder_chk == "empty") { - exec("/bin/cp -R /usr/local/etc/snort/rules {$if_rule_dir}/rules"); + if (!is_dir("/usr/local/etc/snort/snort_{$snort_uuid}_{$if_real}/rules")) + exec("/bin/mkdir -p /usr/local/etc/snort/snort_{$snort_uuid}_{$if_real}/rules"); + exec("/bin/cp /usr/local/etc/snort/rules/* {$if_rule_dir}/rules"); if (file_exists("/usr/local/etc/snort/custom_rules/local_{$snort_uuid}_{$if_real}.rules")) exec("/bin/cp /usr/local/etc/snort/custom_rules/local_{$snort_uuid}_{$if_real}.rules {$if_rule_dir}/local_{$snort_uuid}_{$if_real}.rules"); } -- cgit v1.2.3