mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 02:19:04 +00:00
Remove many ERROR outputs from non-debug NSE output
This commit is contained in:
@@ -26,21 +26,23 @@ categories = {"discovery", "safe"}
|
||||
|
||||
portrule = shortport.port_or_service(873, "rsync", "tcp")
|
||||
|
||||
local function fail (err) return stdnse.format_output(false, err) end
|
||||
|
||||
action = function(host, port)
|
||||
local helper = rsync.Helper:new(host, port, { module = "" })
|
||||
if ( not(helper) ) then
|
||||
return "\n ERROR: Failed to create rsync.Helper"
|
||||
return fail("Failed to create rsync.Helper")
|
||||
end
|
||||
|
||||
local status, err = helper:connect()
|
||||
if ( not(status) ) then
|
||||
return "\n ERROR: Failed to connect to rsync server"
|
||||
return fail("Failed to connect to rsync server")
|
||||
end
|
||||
|
||||
local modules = {}
|
||||
status, modules = helper:listModules()
|
||||
if ( not(status) ) then
|
||||
return "\n ERROR: Failed to retrieve a list of modules"
|
||||
return fail("Failed to retrieve a list of modules")
|
||||
end
|
||||
return stdnse.format_output(true, modules)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user