From c48fdaa40effe9edc8bb4fb933e124a93cb24a0d Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 16 Oct 2013 09:16:00 -0300 Subject: Fix #3268 - avoid pf table names conflict: . Create a list of reserved table names for the hardcoded ones . Use this list to validate aliases and load balance pool names . Check if alias names don't conflict with LB pool names and vice-versa --- usr/local/www/load_balancer_pool_edit.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'usr/local/www/load_balancer_pool_edit.php') diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php index 9ce0e2b..13a114a 100755 --- a/usr/local/www/load_balancer_pool_edit.php +++ b/usr/local/www/load_balancer_pool_edit.php @@ -40,6 +40,8 @@ ##|-PRIV require("guiconfig.inc"); +require_once("filter.inc"); +require_once("util.inc"); if (!is_array($config['load_balancer']['lbpool'])) { $config['load_balancer']['lbpool'] = array(); @@ -85,6 +87,12 @@ if ($_POST) { if (strpos($_POST['name'], " ") !== false) $input_errors[] = gettext("You cannot use spaces in the 'name' field."); + if (in_array($_POST['name'], $reserved_table_names)) + $input_errors[] = sprintf(gettext("The name '%s' is a reserved word and cannot be used."), $_POST['name']); + + if (is_alias($_POST['name'])) + $input_errors[] = sprintf(gettext("Sorry, an alias is already named %s."), $_POST['name']); + if (!is_portoralias($_POST['port'])) $input_errors[] = gettext("The port must be an integer between 1 and 65535, or a port alias."); -- cgit v1.1