diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2014-01-12 00:25:54 -0500 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2014-01-12 00:25:54 -0500 |
commit | c3b3ace436cfc9f0cc0ea7e5909c58582b7ed658 (patch) | |
tree | 123a04e6d47eb099d570682c142e6f93922a3e2e /config/snort/snort_rules.php | |
parent | ba3edc934faf8887fd5ea9e785392d84f2cd288c (diff) | |
download | pfsense-packages-c3b3ace436cfc9f0cc0ea7e5909c58582b7ed658.tar.gz pfsense-packages-c3b3ace436cfc9f0cc0ea7e5909c58582b7ed658.tar.bz2 pfsense-packages-c3b3ace436cfc9f0cc0ea7e5909c58582b7ed658.zip |
Ensure conf_mount_rw() and conf_mount_ro() are used where needed.
Diffstat (limited to 'config/snort/snort_rules.php')
-rwxr-xr-x | config/snort/snort_rules.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php index 0434f88f..37b06914 100755 --- a/config/snort/snort_rules.php +++ b/config/snort/snort_rules.php @@ -319,21 +319,25 @@ if ($_GET['act'] == "resetall" && !empty($rules_map)) { } if ($_POST['clear']) { + conf_mount_rw(); unset($a_rule[$id]['customrules']); write_config(); $rebuild_rules = true; snort_generate_conf($a_rule[$id]); $rebuild_rules = false; + conf_mount_ro(); header("Location: /snort/snort_rules.php?id={$id}&openruleset={$currentruleset}"); exit; } if ($_POST['customrules']) { + conf_mount_rw(); $a_rule[$id]['customrules'] = base64_encode($_POST['customrules']); write_config(); $rebuild_rules = true; snort_generate_conf($a_rule[$id]); $rebuild_rules = false; + conf_mount_ro(); $output = ""; $retcode = ""; exec("/usr/local/bin/snort -T -c {$snortdir}/snort_{$snort_uuid}_{$if_real}/snort.conf 2>&1", $output, $retcode); @@ -352,7 +356,7 @@ if ($_POST['customrules']) { } else if ($_POST['apply']) { - + conf_mount_rw(); /* Save new configuration */ write_config(); @@ -363,6 +367,10 @@ else if ($_POST['apply']) { $rebuild_rules = true; snort_generate_conf($a_rule[$id]); $rebuild_rules = false; + conf_mount_ro(); + + /* Soft-restart Snort to live-load new rules */ + snort_reload_config($a_rule[$id]); /* Return to this same page */ header("Location: /snort/snort_rules.php?id={$id}&openruleset={$currentruleset}"); |