aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-11-11 15:00:08 +0000
committerErmal <eri@pfsense.org>2011-11-11 15:00:08 +0000
commitd378152135a49642975cb5a2ce5a106fe7a8fe07 (patch)
tree5af0fe417d78d92ce90a8afb9050c3bb7ee453cb /config
parent2e9362c5ab08a858759cd65f01409248ea602639 (diff)
downloadpfsense-packages-d378152135a49642975cb5a2ce5a106fe7a8fe07.tar.gz
pfsense-packages-d378152135a49642975cb5a2ce5a106fe7a8fe07.tar.bz2
pfsense-packages-d378152135a49642975cb5a2ce5a106fe7a8fe07.zip
Correct the copying of rules during config sync it was copying the wrong rules.
Diffstat (limited to 'config')
-rw-r--r--config/snort/snort.inc4
1 files changed, 3 insertions, 1 deletions
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");
}