From 2b38970f0f61b1ebd77aad6eab5e68053886d3fa Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 12 Jul 2012 00:26:32 +0000 Subject: If there is no suppress defined just do not create anyfile --- config/snort/snort.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/config/snort/snort.inc b/config/snort/snort.inc index ddc10e6c..42a1bf6c 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -1022,11 +1022,14 @@ function snort_generate_conf($snortcfg) { $spoink_type = "output alert_pf: {$snortcfgdir}/{$snortcfg['whitelistname']},snort2c,{$snortcfg['blockoffendersip']},{$pfkill}"; } - /* define suppress file */ + /* define selected suppress file */ + $suppress_file_name = ""; $suppress = snort_find_list($snortcfg['suppresslistname'], 'suppress'); - $suppress_data = str_replace("\r", "", base64_decode($suppress['suppresspassthru'])); - @file_put_contents("{$snortcfgdir}/{$snortcfg['suppresslistname']}", $suppress_data); - $suppress_file_name = "include {$snortcfgdir}/{$snortcfg['suppresslistname']}"; + if (!empty($suppress)) { + $suppress_data = str_replace("\r", "", base64_decode($suppress['suppresspassthru'])); + @file_put_contents("{$snortcfgdir}/{$snortcfg['suppresslistname']}", $suppress_data); + $suppress_file_name = "include {$snortcfgdir}/{$snortcfg['suppresslistname']}"; + } /* set the snort performance model */ $snort_performance = "ac-bnfa"; -- cgit v1.2.3