aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-07-16 13:39:19 +0000
committerErmal <eri@pfsense.org>2012-07-16 13:39:19 +0000
commit380d7cbe464a271c47fa57d4a890e1d61019fd08 (patch)
treec336066e984d7ee43f0cf59c2a8f7e0b8811a179 /config/snort
parent635f69b58c61f3b61f54db6954b004f70e6407d4 (diff)
downloadpfsense-packages-380d7cbe464a271c47fa57d4a890e1d61019fd08.tar.gz
pfsense-packages-380d7cbe464a271c47fa57d4a890e1d61019fd08.tar.bz2
pfsense-packages-380d7cbe464a271c47fa57d4a890e1d61019fd08.zip
Remove directories used from snort on deinstall. Also do not create a custom_rules since its not used
Diffstat (limited to 'config/snort')
-rw-r--r--config/snort/snort.inc16
1 files changed, 13 insertions, 3 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc
index 660f5f3e..a2787408 100644
--- a/config/snort/snort.inc
+++ b/config/snort/snort.inc
@@ -937,6 +937,7 @@ function snort_deinstall() {
global $config, $g;
$snortdir = SNORTDIR;
+ $snortlogdir = SNORTLOGDIR;
/* decrease bpf buffers back to 4096, from 20480 */
mwexec('/usr/bin/killall snort', true);
@@ -948,8 +949,17 @@ function snort_deinstall() {
mwexec('/usr/bin/killall -9 barnyard2', true);
sleep(2);
mwexec('/usr/sbin/pw userdel snort; /usr/sbin/pw groupdel snort', true);
- mwexec("/bin/rm -rf {$snortdir}*; /bin/rm -rf /usr/local/pkg/snort*", true);
- mwexec('/bin/rm -rf /usr/local/www/snort; /bin/rm -rf /var/log/snort', true);
+
+ /* create a few directories and ensure the sample files are in place */
+ $snort_dirs = array( $snortdir, $snortlogdir,
+ "dynamicrules" => "/usr/local/lib/snort/dynamicrules",
+ "dynamicengine" => "/usr/local/lib/snort/dynamicengine",
+ "dynamicpreprocessor" => "/usr/local/lib/snort/dynamicpreprocessor"
+ );
+ foreach ($snort_dirs as $dir) {
+ if (is_dir($dir))
+ mwexec("/bin/rm -rf {$dir}", true);
+ }
/* Remove snort cron entries Ugly code needs smoothness*/
if (!function_exists('snort_deinstall_cron')) {
@@ -1010,7 +1020,7 @@ function snort_generate_conf($snortcfg) {
$snort_config_pass_thru = str_replace("\r", "", base64_decode($snortcfg['configpassthru']));
/* create a few directories and ensure the sample files are in place */
- $snort_dirs = array( $snortdir, "{$snortdir}/custom_rules", $snortcfgdir, "{$snortcfgdir}/rules",
+ $snort_dirs = array( $snortdir, $snortcfgdir, "{$snortcfgdir}/rules",
"{$snortlogdir}/snort_{$if_real}{$snort_uuid}",
"{$snortlogdir}/snort_{$if_real}{$snort_uuid}/barnyard2",
"dynamicrules" => "/usr/local/lib/snort/dynamicrules",