From 9a9024843b4751f2386c41ba2b7e41f1ef0ae2c6 Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Fri, 16 Mar 2018 18:58:09 +0100 Subject: [PATCH] gluon-core: check mesh ID and IBSS SSID length to be in range of 1-32 characters --- package/gluon-core/check_site.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua index 6c074c34..ab4c5358 100644 --- a/package/gluon-core/check_site.lua +++ b/package/gluon-core/check_site.lua @@ -48,7 +48,7 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do need_array_of({config, 'basic_rate'}, supported_rates or rates, supported_rates ~= nil) if need_table({config, 'ibss'}, nil, false) then - need_string(in_domain({config, 'ibss', 'ssid'})) + need_string_match(in_domain({config, 'ibss', 'ssid'}), '^.' .. ('.?'):rep(31) .. '$') need_string_match(in_domain({config, 'ibss', 'bssid'}), '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$') need_one_of({config, 'ibss', 'mcast_rate'}, supported_rates or rates, false) need_number({config, 'ibss', 'vlan'}, false) @@ -56,7 +56,7 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do end if need_table({config, 'mesh'}, nil, false) then - need_string(in_domain({config, 'mesh', 'id'})) + need_string_match(in_domain({config, 'mesh', 'id'}), '^.' .. ('.?'):rep(31) .. '$') need_one_of({config, 'mesh', 'mcast_rate'}, supported_rates or rates, false) need_boolean({config, 'mesh', 'disabled'}, false) end