diff options
author | doktornotor <notordoktor@gmail.com> | 2015-11-20 10:32:25 +0100 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-11-20 10:32:25 +0100 |
commit | f287c8845a766aae5a9d73ad93c44b44d7f8963d (patch) | |
tree | 216ca2e874fa74bca09ab5751c72ab3f9d170cc1 | |
parent | df0792ee4a609e855d2990047b2c8ec782c6548f (diff) | |
download | pfsense-packages-f287c8845a766aae5a9d73ad93c44b44d7f8963d.tar.gz pfsense-packages-f287c8845a766aae5a9d73ad93c44b44d7f8963d.tar.bz2 pfsense-packages-f287c8845a766aae5a9d73ad93c44b44d7f8963d.zip |
Tighten the input validation to make sure 'Bind IP Address' is configured on the local system
-rw-r--r-- | config/nrpe2/nrpe2.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config/nrpe2/nrpe2.inc b/config/nrpe2/nrpe2.inc index 5a23a585..182664b8 100644 --- a/config/nrpe2/nrpe2.inc +++ b/config/nrpe2/nrpe2.inc @@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. */ require_once("filter.inc"); +require_once("pfsense-utils.inc"); require_once("pkg-utils.inc"); require_once("util.inc"); @@ -245,8 +246,8 @@ function nrpe2_custom_php_validation_command($post, &$input_errors) { $input_errors[] = gettext("'Port Number' must be a valid port."); } if ($post['server_address'] != "") { - if (!is_ipaddr($post['server_address'])) { - $input_errors[] = gettext("'Bind IP Address' must be a valid IP address."); + if (!is_ipaddr_configured($post['server_address']) && !preg_match("/(127.0.0.1|0.0.0.0)/", $post['server_address'])) { + $input_errors[] = gettext("'Bind IP Address' is not a valid, locally configured IP address."); } } foreach (explode(",", $post['allowed_hosts']) as $host) { |