firewall: ipsets.js: validate set names
Ensure that user supplied set name values conform to the nftables identifier
syntax constraints.
Fixes: #6633
Fixes: 0484343903
("luci-app-firewall: implement IPsets GUI")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
4798cb4aa3
commit
755edf6fbf
1 changed files with 6 additions and 0 deletions
|
@ -41,6 +41,12 @@ return view.extend({
|
|||
o = s.option(form.Value, 'name', _('Name'));
|
||||
o.optional = false;
|
||||
o.rmempty = false;
|
||||
o.validate = function (section_id, value) {
|
||||
if (!/^[a-zA-Z_.][a-zA-Z0-9\/_.-]*$/.test(value))
|
||||
return _('Invalid set name');
|
||||
|
||||
return true;
|
||||
};
|
||||
} else {
|
||||
o = s.option(form.Value, 'name', _('Name'));
|
||||
o.depends({ external: '' });
|
||||
|
|
Loading…
Reference in a new issue