From 720f76c5613451b6bec9b18ea2fba18c87c2dc70 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sat, 26 Sep 2015 20:33:46 +0300 Subject: [PATCH] for-15.05 luci-app-firewall: use maxlength datatype for zone name validation Backport from trunk the zonename validation using a compound datatype "and(uciname,maxlength(14))" fw3 sets the maximum length of the zone name to 14 and ignores zone definitions with too long names. Add a simple validation to ensure that the new zone name is short enough. Backport of 34e875b3 and edc58332 Signed-off-by: Hannu Nyman --- .../luasrc/model/cbi/firewall/zone-details.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua index 3eb95ebb57..6c90476f81 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua @@ -60,7 +60,7 @@ s:tab("advanced", translate("Advanced Settings")) name = s:taboption("general", Value, "name", translate("Name")) name.optional = false name.forcewrite = true -name.datatype = "uciname" +name.datatype = "and(uciname,maxlength(14))" function name.write(self, section, value) if zone:name() ~= value then -- 2.30.2