1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-12 16:36:34 +00:00

Fix Lua patterns that contain -

"-" in a Lua pattern means "ungreedy zero-or-more" and must be escaped
to match a literal "-". http://www.lua.org/manual/5.2/manual.html#6.4.1
This commit is contained in:
dmiller
2013-12-19 20:05:09 +00:00
parent c52c5476de
commit 45cd8091a4
3 changed files with 5 additions and 5 deletions

View File

@@ -114,7 +114,7 @@ hostrule = function(host)
end
if nfsport == nil then return false end
if host.registry.nfs.nfsver == nil then
local low, high = string.match(nfsport.version.version, "(%d)-(%d)")
local low, high = string.match(nfsport.version.version, "(%d)%-(%d)")
if high == nil then
high = tonumber(nfsport.version.version)
if high == 4 then
@@ -132,7 +132,7 @@ hostrule = function(host)
end
if mountport == nil then return false end
if host.registry.nfs.mountver == nil then
local low, high = string.match(mountport.version.version, "(%d)-(%d)")
local low, high = string.match(mountport.version.version, "(%d)%-(%d)")
if high == nil then
host.registry.nfs.mountver = tonumber(mountport.version.version)
else

View File

@@ -45,7 +45,7 @@ local function get_exports(host, port)
host.registry.nfs = {}
end
if mountver == nil then
local low, high = string.match(port.version.version, "(%d)-(%d)")
local low, high = string.match(port.version.version, "(%d)%-(%d)")
if high == nil then
mountver = tonumber(port.version.version)
else

View File

@@ -67,7 +67,7 @@ hostrule = function(host)
end
if nfsport == nil then return false end
if host.registry.nfs.nfsver == nil then
local low, high = string.match(nfsport.version.version, "(%d)-(%d)")
local low, high = string.match(nfsport.version.version, "(%d)%-(%d)")
if high == nil then
high = tonumber(nfsport.version.version)
if high == 4 then
@@ -85,7 +85,7 @@ hostrule = function(host)
end
if mountport == nil then return false end
if host.registry.nfs.mountver == nil then
local low, high = string.match(mountport.version.version, "(%d)-(%d)")
local low, high = string.match(mountport.version.version, "(%d)%-(%d)")
if high == nil then
host.registry.nfs.mountver = tonumber(mountport.version.version)
else