summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/diag_resetstate.php2
-rw-r--r--src/usr/local/www/firewall_aliases_edit.php9
-rwxr-xr-xsrc/usr/local/www/interfaces.php9
-rw-r--r--src/usr/local/www/interfaces_groups_edit.php16
4 files changed, 26 insertions, 10 deletions
diff --git a/src/usr/local/www/diag_resetstate.php b/src/usr/local/www/diag_resetstate.php
index 3f3b70d..ae310f9 100644
--- a/src/usr/local/www/diag_resetstate.php
+++ b/src/usr/local/www/diag_resetstate.php
@@ -73,7 +73,7 @@ $statetablehelp = sprintf(gettext('Resetting the state tables will remove all en
'Simply refresh the page to continue.'), "<br /><br />", "<br /><br />", "<strong>", "</strong>");
$sourcetablehelp = sprintf(gettext('Resetting the source tracking table will remove all source/destination associations. ' .
- 'This means that the \"sticky\" source/destination association ' .
+ 'This means that the "sticky" source/destination association ' .
'will be cleared for all clients.%s' .
'This does not clear active connection states, only source tracking.'), "<br /><br />");
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php
index 161960b..9a82a58 100644
--- a/src/usr/local/www/firewall_aliases_edit.php
+++ b/src/usr/local/www/firewall_aliases_edit.php
@@ -173,6 +173,15 @@ if ($_POST) {
}
}
+ /*
+ * Packages (e.g. tinc) create interface groups, reserve this
+ * namespace pkg_ for them.
+ * One namespace is shared by Interfaces, Interface Groups and Aliases.
+ */
+ if (substr($_POST['name'], 0, 4) == 'pkg_') {
+ $input_errors[] = gettext("The alias name cannot start with pkg_");
+ }
+
/* check for name interface description conflicts */
foreach ($config['interfaces'] as $interface) {
if (strcasecmp($interface['descr'], $_POST['name']) == 0) {
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php
index f19ee43..108de24 100755
--- a/src/usr/local/www/interfaces.php
+++ b/src/usr/local/www/interfaces.php
@@ -524,6 +524,15 @@ if ($_POST['apply']) {
if (is_numeric($_POST['descr'])) {
$input_errors[] = gettext("The interface description cannot contain only numbers.");
}
+
+ /*
+ * Packages (e.g. tinc) create interface groups, reserve this
+ * namespace pkg_ for them.
+ * One namespace is shared by Interfaces, Interface Groups and Aliases.
+ */
+ if (substr($_POST['descr'], 0, 4) == 'pkg_') {
+ $input_errors[] = gettext("The interface description cannot start with pkg_");
+ }
}
if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable'])) {
diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php
index fcf9b3d..daa0348 100644
--- a/src/usr/local/www/interfaces_groups_edit.php
+++ b/src/usr/local/www/interfaces_groups_edit.php
@@ -69,11 +69,9 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (!$input_errors) {
- if (!isset($id)) {
- foreach ($a_ifgroups as $groupentry) {
- if ($groupentry['ifname'] == $_POST['ifname']) {
- $input_errors[] = gettext("Group name already exists!");
- }
+ foreach ($a_ifgroups as $groupid => $groupentry) {
+ if ((!isset($id) || ($groupid != $id)) && ($groupentry['ifname'] == $_POST['ifname'])) {
+ $input_errors[] = gettext("Group name already exists!");
}
}
@@ -90,11 +88,11 @@ if ($_POST) {
}
/*
- * Packages (e.g. tinc) creates interface groups, reserve this
- * namespace pkg- for them
+ * Packages (e.g. tinc) create interface groups, reserve this
+ * namespace pkg_ for them
*/
- if (substr($_POST['ifname'], 0, 4) == 'pkg-') {
- $input_errors[] = gettext("Group name cannot start with pkg-");
+ if (substr($_POST['ifname'], 0, 4) == 'pkg_') {
+ $input_errors[] = gettext("Group name cannot start with pkg_");
}
foreach ($interface_list_disabled as $gif => $gdescr) {
OpenPOWER on IntegriCloud