Do not allow a group name to start with 'pkg-', reserve it for packages use (e.g. tinc)

This commit is contained in:
Renato Botelho 2016-12-12 16:42:53 -02:00
parent 2326f3252a
commit ebdcad3bd3

View File

@ -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.";