1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Added missing second parameter for receive_buf which caused errors with new

Lua version.
This commit is contained in:
patrik
2012-05-27 19:20:34 +00:00
parent cc1ba1ff3d
commit 656f03676e
11 changed files with 24 additions and 24 deletions

View File

@@ -49,7 +49,7 @@ Response = {
end,
receive = function(self)
local status, data = self.socket:receive_buf("\r\n")
local status, data = self.socket:receive_buf("\r\n", false)
if ( not(status) ) then
return false, "Failed to receive data from server"
end
@@ -78,7 +78,7 @@ Response = {
local len = tonumber(data:match("^%$(%d*)"))
-- we should only have a single line, so we can just peel of the length
status, data = self.socket:receive_buf(match.numbytes(len))
status, data = self.socket:receive_buf(match.numbytes(len), false)
if( not(status) ) then
return false, "Failed to receive data from server"
end
@@ -93,12 +93,12 @@ Response = {
for i=1, count do
-- peel of the length
local status = self.socket:receive_buf("\r\n")
local status = self.socket:receive_buf("\r\n", false)
if( not(status) ) then
return false, "Failed to receive data from server"
end
status, data = self.socket:receive_buf("\r\n")
status, data = self.socket:receive_buf("\r\n", false)
if( not(status) ) then
return false, "Failed to receive data from server"
end

View File

@@ -39,7 +39,7 @@ Helper = {
if ( not(status) ) then
return false, err
end
local status, data = self.socket:receive_buf("\n")
local status, data = self.socket:receive_buf("\n", false)
if( not(status) ) then
return false, err
end
@@ -119,7 +119,7 @@ Helper = {
local modules = {}
while(true) do
status, data = self.socket:receive_buf("\n")
status, data = self.socket:receive_buf("\n", false)
if (not(status)) then
return false, data
end
@@ -152,13 +152,13 @@ Helper = {
return false, data
end
status, data = self.socket:receive_buf(match.numbytes(4))
status, data = self.socket:receive_buf(match.numbytes(4), false)
if ( not(status) ) then
return false, data
end
local pos, len = bin.unpack("<S", data)
status, data = self.socket:receive_buf(match.numbytes(len))
status, data = self.socket:receive_buf(match.numbytes(len), false)
if ( not(status) ) then
return false, data
end

View File

@@ -236,7 +236,7 @@ Comm = {
-- @return response containing a response instance
-- err string containing an error message, if status is false
recv = function(self)
local status, hdr_data = self.socket:receive_buf(match.numbytes(Header.size))
local status, hdr_data = self.socket:receive_buf(match.numbytes(Header.size), false)
if ( not(status) ) then
return false, "Failed to receive response from server"
end
@@ -246,7 +246,7 @@ Comm = {
return false, "Failed to parse response header"
end
local status, data = self.socket:receive_buf(match.numbytes(header.length))
local status, data = self.socket:receive_buf(match.numbytes(header.length), false)
if ( header.type == MessageType.BINDING_RESPONSE ) then
local resp = Response.Bind.parse(hdr_data .. data)
return true, resp

View File

@@ -139,7 +139,7 @@ XMPP = {
-- previous message.
self.socket:set_timeout(1)
repeat
local status = self.socket:receive_buf("\0")
local status = self.socket:receive_buf("\0", false)
until(not(status))
self.socket:set_timeout(self.options.timeout * 1000)

View File

@@ -58,7 +58,7 @@ action = function(host, port)
local srvinfo
repeat
local status, data = socket:receive_buf("\r\n")
local status, data = socket:receive_buf("\r\n", false)
if ( not(status) ) then
return fail("Failed to read response from server")
elseif ( data:match("^5") ) then

View File

@@ -95,7 +95,7 @@ earlier. The vulnerability is the consequence of weak service configuration.
end
end
local status, data = socket:receive_buf("DOTO00000000")
local status, data = socket:receive_buf("DOTO00000000", false)
if ( status ) then
local output = data:match("SOUT%w%w%w%w%w%w%w%w(.*)")

View File

@@ -159,11 +159,11 @@ action = function(host, port)
end
-- If there's an error we get a response back, and only then
local status, data = socket:receive_buf("\n")
local status, data = socket:receive_buf("\n", false)
if( status and data ~= "<error>" ) then
return fail("An unknown error occured, aborting ...")
elseif ( status ) then
status, data = socket:receive_buf("\n")
status, data = socket:receive_buf("\n", false)
if ( status ) then
return fail(data)
else
@@ -176,7 +176,7 @@ action = function(host, port)
end
local tags = {}
local status, tag = socket:receive_buf("\n")
local status, tag = socket:receive_buf("\n", false)
while(true) do
if ( not(status) ) then
break
@@ -194,7 +194,7 @@ action = function(host, port)
while(true) do
local data
status, data = socket:receive_buf("\n")
status, data = socket:receive_buf("\n", false)
if ( not(status) ) then
break
end

View File

@@ -77,7 +77,7 @@ action = function(host, port)
repeat
local entry
status, line = socket:receive_buf("\r\n")
status, line = socket:receive_buf("\r\n", false)
if ( status ) then
status, entry = gps.NMEA.parse(line)
if ( status ) then

View File

@@ -97,7 +97,7 @@ action = function(host, port)
return fail("Failed to send request to server")
end
local status, resp = socket:receive_buf("\r\n\r\n")
local status, resp = socket:receive_buf("\r\n\r\n", false)
if ( not(status) ) then
return fail("Failed to receive response from server")
end

View File

@@ -73,7 +73,7 @@ end
local function recvResponse(socket)
local kvs = {}
repeat
local status, response = socket:receive_buf("\r\n")
local status, response = socket:receive_buf("\r\n", false)
if ( not(status) ) then
return false, "Failed to receive response from server"
end

View File

@@ -45,7 +45,7 @@ Driver = {
end,
login = function(self, username, password)
local status, line = self.socket:receive_buf("\r\n")
local status, line = self.socket:receive_buf("\r\n", false)
if ( line:match("^220 VMware Authentication Daemon.*SSL Required") ) then
self.socket:reconnect_ssl()
end
@@ -57,7 +57,7 @@ Driver = {
return false, err
end
local status, response = self.socket:receive_buf("\r\n")
local status, response = self.socket:receive_buf("\r\n", false)
if ( not(status) or not(response:match("^331") ) ) then
local err = brute.Error:new( "Received unexpected response from server" )
err:setRetry( true )
@@ -70,7 +70,7 @@ Driver = {
err:setRetry( true )
return false, err
end
status, response = self.socket:receive_buf("\r\n")
status, response = self.socket:receive_buf("\r\n", false)
if ( response:match("^230") ) then
return true, brute.Account:new(username, password, creds.State.VALID)
@@ -93,7 +93,7 @@ local function checkAuthd(host, port)
return false, "Failed to connect to server"
end
local status, line = socket:receive_buf("\r\n")
local status, line = socket:receive_buf("\r\n", false)
socket:close()
if ( not(status) ) then
return false, "Failed to receive response from server"