From e79d2bf4c27184baa8d4673adc7fcb3f3a9c4906 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 19 Aug 2008 13:50:50 +0000 Subject: Modified opennhrp to fix validation bug. git-svn-id: svn://svn.alpinelinux.org/acf/opennhrp/trunk@1385 ab2d0c66-481e-0410-8bed-d214d4d58bed --- opennhrp-model.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'opennhrp-model.lua') diff --git a/opennhrp-model.lua b/opennhrp-model.lua index 408c4a9..7c31bbc 100644 --- a/opennhrp-model.lua +++ b/opennhrp-model.lua @@ -147,7 +147,7 @@ local function validateconfig(config) end end for i,value in ipairs(config.value.peers.value) do - if not validator.is_ipv4(value:match("[^%s/]+")) or not validator.is_ipv4(value:match("%s(%S+)")) then + if not validator.is_ipv4(value:match("[^%s/]+")) then success = false config.value.peers.errtxt = "Syntax error - invalid ip address" break @@ -155,6 +155,10 @@ local function validateconfig(config) success = false config.value.peers.errtxt = "Syntax error - invalid prefix" break + elseif string.find(value:match("%s(%S+)"), "[^%w.-]") then + success = false + config.value.peers.errtxt = "Syntax error - invalid domain name" + break end end return success, config -- cgit v1.2.3