From 165e79a95dfc9e0aa90cbbb438cc86e0a03d0611 Mon Sep 17 00:00:00 2001 From: fyodor Date: Sat, 5 Jan 2008 07:21:55 +0000 Subject: [PATCH] Fix a problem which prevented proper port number matching in port_or_service() because the port variable passed to portnumber is shadowed by the variable passed during portrule check. Report and patch are from Sven Klemm --- nselib/shortport.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nselib/shortport.lua b/nselib/shortport.lua index b6ec50825..da55f90a4 100644 --- a/nselib/shortport.lua +++ b/nselib/shortport.lua @@ -65,7 +65,7 @@ service = function(service, _proto, _state) end end -port_or_service = function(port, _service, proto, _state) +port_or_service = function(_port, _service, proto, _state) local state = _state or {"open", "open|filtered"} local state_table @@ -77,7 +77,7 @@ port_or_service = function(port, _service, proto, _state) return function(host, port) for _, state in pairs(state_table) do - local port_checker = portnumber(port, proto, state) + local port_checker = portnumber(_port, proto, state) local service_checker = service(_service, proto, state) if (port_checker(host, port) or service_checker(host, port)) then return true