1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 07:11:37 +00:00

o Fixed multiple NSE scripts that weren't always properly closing their

sockets.  The error message was:
    "bad argument #1 to 'close' (nsock expected, got no value)"
This commit is contained in:
kris
2007-12-28 07:35:51 +00:00
parent a7ebc33b1b
commit 23040d67ac
6 changed files with 11 additions and 6 deletions

View File

@@ -12,6 +12,11 @@ o Updated rpcinfo.nse to use nmap.fetchfile() to read from nmap-rpc
instead of having a huge table of RPC numbers. This reduced the instead of having a huge table of RPC numbers. This reduced the
script's size by nearly 3/4. [Kris] script's size by nearly 3/4. [Kris]
o Fixed multiple NSE scripts that weren't always properly closing their
sockets. The error message was:
"bad argument #1 to 'close' (nsock expected, got no value)"
[Kris]
4.51BETA 4.51BETA
o We now have a detailed Zenmap Guide at o We now have a detailed Zenmap Guide at

View File

@@ -48,7 +48,7 @@ action = function(host, port)
result1 = try(socket:receive_lines(1)) result1 = try(socket:receive_lines(1))
if not string.match(result1, "^250") then if not string.match(result1, "^250") then
socket.close() socket:close()
-- TODO: use print_debug instead -- TODO: use print_debug instead
return "EHLO with errors or timeout. Enable --script-trace to see what is happening." return "EHLO with errors or timeout. Enable --script-trace to see what is happening."
end end
@@ -70,7 +70,7 @@ action = function(host, port)
result2 = try(socket:receive_lines(1)) result2 = try(socket:receive_lines(1))
if not string.match(result2, "^214") then if not string.match(result2, "^214") then
socket.close() socket:close()
-- TODO: use print_debug instead -- TODO: use print_debug instead
return "HELP with errors or timeout. Enable --script-trace to see what is happening." return "HELP with errors or timeout. Enable --script-trace to see what is happening."
end end

View File

@@ -41,7 +41,7 @@ local maxdepth = 10
local get_page_from_host local get_page_from_host
local soc local soc
local catch = function() soc.close() end local catch = function() soc:close() end
local try = nmap.new_try(catch) local try = nmap.new_try(catch)
portrule = shortport.service("http") portrule = shortport.service("http")

View File

@@ -9,7 +9,7 @@ require('stdnse')
require('strbuf') require('strbuf')
local soc local soc
local catch = function() soc.close() end local catch = function() soc:close() end
local try = nmap.new_try(catch) local try = nmap.new_try(catch)
portrule = shortport.port_or_service(23, 'telnet') portrule = shortport.port_or_service(23, 'telnet')

View File

@@ -34,7 +34,7 @@ end
action = function(host, port) action = function(host, port)
local soc, lines, status local soc, lines, status
local catch = function() soc.close() end local catch = function() soc:close() end
local try = nmap.new_try(catch) local try = nmap.new_try(catch)
-- connect to webserver -- connect to webserver

View File

@@ -263,7 +263,7 @@ end
action = function(host, port) action = function(host, port)
local soc, status, data local soc, status, data
local catch = function() soc.close() end local catch = function() soc:close() end
local try = nmap.new_try(catch) local try = nmap.new_try(catch)
-- can't do anything without a hostname -- can't do anything without a hostname