From f76a479d0f09a0ec7bfd884e02f7a53770c4ebad Mon Sep 17 00:00:00 2001 From: sullrich Date: Fri, 27 Nov 2009 22:41:39 -0500 Subject: Do not allow reserved keywords as alias names Ticket #141 --- usr/local/www/firewall_aliases_edit.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index c54eb2e..2e1d5b5 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -45,6 +45,9 @@ $pgtitle = array("Firewall","Aliases","Edit"); +// Keywords not allowed in names +$reserved_keywords = array("pass", "out", "queue", "max", "min"); + require("guiconfig.inc"); require_once("functions.inc"); require_once("filter.inc"); @@ -156,6 +159,11 @@ if ($_POST) { } } + /* Check for reserved keyword names */ + foreach($reserved_keywords as $rk) + if($rk == $_POST['name']) + $intput_errors[] = "Cannot use a reserved keyword as alias name $rk"; + /* check for name interface description conflicts */ foreach($config['interfaces'] as $interface) { if($interface['descr'] == $_POST['name']) { -- cgit v1.1