luci-mod-network: add stricter wireless interface name validation
authorGlenn Washburn <development@efficientek.com>
Thu, 2 Mar 2023 05:39:48 +0000 (23:39 -0600)
committerJo-Philipp Wich <jo@mein.io>
Mon, 3 Apr 2023 11:51:44 +0000 (13:51 +0200)
commit52965f40770c85b448712358ee810bcde99c0a25
treebaffd7443c243eaaf1ae83d69f9692b245d10be8
parent1c01c643ba262d38bcad3341f74b0f038b28a2a6
luci-mod-network: add stricter wireless interface name validation

Linux wireless interface names have the following restrictions:

 * It must not be an empty string
 * It must not be '.' or '..'
 * It must not contain any /, : or space character ( , \t, \n, ...)
 * It must be less than 16 chars
 * It likely must not contain any % either

Fixes: 8673aef8db ("luci-mod-network: remove uciname validation from wireless interface")
Signed-off-by: Glenn Washburn <development@efficientek.com>
[reword validation error messages, remove extended description text as it would be
 shown as part of the validation errors]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 6ad6a241c32ebd4d62f6021a2e3cbe4e1bc192c2)
modules/luci-base/htdocs/luci-static/resources/validation.js
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js