From dda1f1a54816edcb2048cc340eb70b6e83083484 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 May 2007 23:48:52 +0000 Subject: Tighten the home net checks trying to eliminte blank entries that can lead to ,/, --- packages/snort/snort.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages/snort/snort.inc') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index 14c9a33a..5f456922 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -266,13 +266,16 @@ function generate_snort_conf() { /* iterate all vips and add to whitelist */ if($config['virtualip']) foreach($config['virtualip']['vip'] as $vip) - $home_net .= $vip['subnet'] . " "; + if($vip['subnet']) + $home_net .= $vip['subnet'] . " "; if($config['installedpackages']['snortwhitelist']) foreach($config['installedpackages']['snortwhitelist']['config'] as $snort) - $home_net .= $snort['ip'] . " "; + if($snort['ip']) + $home_net .= $snort['ip'] . " "; /* write out whitelist, convert spaces to carriage returns */ + $whitelist_home_net = str_replace(" ", " ", $home_net); $whitelist_home_net = str_replace(" ", "\n", $home_net); /* make $home_net presentable to snort */ -- cgit v1.2.3