mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
Allow dots in absolute paths
This commit is contained in:
parent
28365f57f0
commit
0bbcc64bb1
1 changed files with 7 additions and 11 deletions
|
|
@ -124,21 +124,17 @@ local function validatePort(p)
|
|||
end
|
||||
end
|
||||
|
||||
local function validatePath(p)
|
||||
-- path should not contain dots
|
||||
if string.find(p, "%.") == nil then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local function validateUnchecked(p)
|
||||
-- base validation is already performed by C side.
|
||||
-- you should use this function as last resort
|
||||
return true
|
||||
end
|
||||
|
||||
local function validateAbsolutePath(p)
|
||||
-- An absolute path. Let it pass for now
|
||||
return validateUnchecked(p)
|
||||
end
|
||||
|
||||
-- #################################################################
|
||||
|
||||
local function validateMode(mode)
|
||||
|
|
@ -699,8 +695,8 @@ local known_parameters = {
|
|||
["slack_webhook"] = validateUnchecked,
|
||||
["nagios_nsca_host"] = validateUnchecked,
|
||||
["nagios_nsca_port"] = validatePort,
|
||||
["nagios_send_nsca_executable"] = validatePath,
|
||||
["nagios_send_nsca_config"] = validatePath,
|
||||
["nagios_send_nsca_executable"] = validateAbsolutePath,
|
||||
["nagios_send_nsca_config"] = validateAbsolutePath,
|
||||
["nagios_host_name"] = validateUnchecked,
|
||||
["nagios_service_name"] = validateUnchecked,
|
||||
["nbox_user"] = validateSingleWord,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue