summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/interfaces_groups_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-12-12 16:42:53 -0200
committerRenato Botelho <renato@netgate.com>2016-12-12 16:43:38 -0200
commitebdcad3bd30ecd15cef89aa279657fc31ac9f72a (patch)
tree74764d60806be24c5a89f67d8d3aeebe27631dc3 /src/usr/local/www/interfaces_groups_edit.php
parent2326f3252a84c31f8d7ed2cefe289dfe0f496ac9 (diff)
downloadpfsense-ebdcad3bd30ecd15cef89aa279657fc31ac9f72a.zip
pfsense-ebdcad3bd30ecd15cef89aa279657fc31ac9f72a.tar.gz
Do not allow a group name to start with 'pkg-', reserve it for packages use (e.g. tinc)
Diffstat (limited to 'src/usr/local/www/interfaces_groups_edit.php')
-rw-r--r--src/usr/local/www/interfaces_groups_edit.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php
index 2847efc..67d1474 100644
--- a/src/usr/local/www/interfaces_groups_edit.php
+++ b/src/usr/local/www/interfaces_groups_edit.php
@@ -79,6 +79,14 @@ if ($_POST) {
$input_errors[] = gettext("Group name cannot end with digit.");
}
+ /*
+ * Packages (e.g. tinc) creates interface groups, reserve this
+ * namespace pkg- for them
+ */
+ if (substr($_POST['ifname'], 0, 4) == 'pkg-') {
+ $input_errors[] = gettext("Group name cannot start with pkg-");
+ }
+
foreach ($interface_list_disabled as $gif => $gdescr) {
if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname']) {
$input_errors[] = "The specified group name is already used by an interface. Please choose another name.";
OpenPOWER on IntegriCloud