mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Avoid empty script output
This commit is contained in:
@@ -46,7 +46,6 @@ action = function( host, port )
|
||||
stdnse.debug1("Status %s",response['status-line'] or "No Response")
|
||||
if response['status-line'] and response['status-line']:match("200%s+OK") and response['body'] then
|
||||
local body = response['body']:gsub("%%","%%%%")
|
||||
stdnse.debug2("Body %s\n",body)
|
||||
if body:match("([^][\"]+)\">Log") then
|
||||
port.version.name = "hadoop-datanode"
|
||||
port.version.product = "Apache Hadoop"
|
||||
@@ -55,6 +54,8 @@ action = function( host, port )
|
||||
stdnse.debug1("Logs %s",logs)
|
||||
result["Logs"] = logs
|
||||
end
|
||||
end
|
||||
if #result > 0 then
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
@@ -90,8 +90,10 @@ local get_userhistory = function( host, port )
|
||||
end
|
||||
end
|
||||
end
|
||||
if #results > 0 then
|
||||
return results
|
||||
end
|
||||
end
|
||||
local get_tasktrackers = function( host, port )
|
||||
local results = {}
|
||||
local uri = "/machines.jsp?type=active"
|
||||
@@ -174,6 +176,6 @@ action = function( host, port )
|
||||
port.version.name = "hadoop-jobtracker"
|
||||
port.version.product = "Apache Hadoop"
|
||||
nmap.set_port_version(host, port)
|
||||
end
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
@@ -174,7 +174,7 @@ action = function( host, port )
|
||||
port.version.name = "hadoop-namenode"
|
||||
port.version.product = "Apache Hadoop"
|
||||
nmap.set_port_version(host, port)
|
||||
end
|
||||
return stdnse.format_output(true, result)
|
||||
return result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -74,7 +74,7 @@ action = function( host, port )
|
||||
port.version.name = "hadoop-tasktracker"
|
||||
port.version.product = "Apache Hadoop"
|
||||
nmap.set_port_version(host, port)
|
||||
end
|
||||
return result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -140,6 +140,6 @@ action = function( host, port )
|
||||
port.version.name = "hbase-master"
|
||||
port.version.product = "Apache Hadoop Hbase"
|
||||
nmap.set_port_version(host, port)
|
||||
end
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user