diff options
author | robiscool <robrob2626@yahoo.com> | 2012-07-03 12:00:57 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2012-07-03 12:00:57 -0700 |
commit | 4c63d6f50a3db3f83529b098397b8f26b32c9801 (patch) | |
tree | 442d1c464e52e4a81f7c444c7bef8674066d53c2 | |
parent | 403bdcca75abd4994b8eb0738bd099ee4cef868c (diff) | |
download | pfsense-packages-4c63d6f50a3db3f83529b098397b8f26b32c9801.tar.gz pfsense-packages-4c63d6f50a3db3f83529b098397b8f26b32c9801.tar.bz2 pfsense-packages-4c63d6f50a3db3f83529b098397b8f26b32c9801.zip |
snort-dev, fix vpn netlist issue with spaces, fix detail preg match on input errors on snort-dev/snort_interfaces_whitelist_edit.php
-rw-r--r-- | config/snort-dev/snort.inc | 12 | ||||
-rw-r--r-- | config/snort-dev/snort_interfaces_whitelist_edit.php | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/config/snort-dev/snort.inc b/config/snort-dev/snort.inc index 3fa63caf..04f0d72e 100644 --- a/config/snort-dev/snort.inc +++ b/config/snort-dev/snort.inc @@ -276,8 +276,14 @@ function build_base_whitelist($build_netlist, $wanip, $wangw, $wandns, $vips, $v $snort_vpns_list = function() use(&$home_net, &$config) { $vpns_list = filter_get_vpns_list(); - if (!empty($vpns_list)) - $home_net .= "{$vpns_list},"; + if (!empty($vpns_list)) { + // convert spaces to , returns + $vpns_list = str_replace(' ', ",", $vpns_list); + $vpns_list = str_replace(' ', ",", $vpns_list); + + $home_net .= "{$vpns_list},"; + } + }; if ($vpns == 'yes') { @@ -1072,7 +1078,7 @@ function create_snort_whitelist($id, $if_real) { $whitelist = $config['installedpackages']['snortglobal']['whitelist']['item'][$whitelist_key_w]; $w_data = build_base_whitelist($whitelist['snortlisttype'], $whitelist['wanips'], $whitelist['wangateips'], $whitelist['wandnsips'], $whitelist['vips'], $whitelist['vpnips'], $whitelist_key_w); - // this foe whitelistfile, convert spaces to carriage returns + // convert spaces to carriage returns $w_data = str_replace(',', "\n", $w_data); $w_data = str_replace(',,', "\n", $w_data); diff --git a/config/snort-dev/snort_interfaces_whitelist_edit.php b/config/snort-dev/snort_interfaces_whitelist_edit.php index 14c016db..ef930eb9 100644 --- a/config/snort-dev/snort_interfaces_whitelist_edit.php +++ b/config/snort-dev/snort_interfaces_whitelist_edit.php @@ -77,7 +77,7 @@ function is_validwhitelistname($name, $type) { if ($type === 'ip' && !preg_match("/[^a-zA-Z0-9\:\,\.\/]/", $name)) return true; - if ($type === 'detail' && !preg_match("/[^a-zA-Z0-9\:\,\.\+\s]/", $name)) + if ($type === 'detail' && !preg_match("/[^a-zA-Z0-9\:\,\.\+\s\-\']/", $name)) return true; return false; @@ -151,7 +151,7 @@ if ($_POST['submit']) { } if (is_validwhitelistname($address[detail], 'detail') == false) { - $input_errors[] = "List of IP descriptions may only consist of the characters [a-z, A-Z 0-9 + , :]."; + $input_errors[] = "List of IP descriptions may only consist of the characters [a-z, A-Z 0-9 + , : ' -]."; } if (!empty($address[address]) && !empty($address[uuid])) { |