mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 08:29:04 +00:00
Fixed bug in srvloc library and broadcast-novell-locate script that would make
the script fail to complete in cases where no url was returned as part of the srvloc reply. [Patrik]
This commit is contained in:
@@ -75,11 +75,14 @@ Reply = {
|
||||
pos, self.lang_tag = bin.unpack("A" .. lang_tag_len, data, pos)
|
||||
|
||||
local no_urls, reserved, url_len
|
||||
pos, self.error_code, no_urls, reserved, self.url_lifetime,
|
||||
url_len = bin.unpack(">SSCSS", data, pos)
|
||||
pos, self.error_code, no_urls = bin.unpack(">SS", data, pos)
|
||||
|
||||
local num_auths
|
||||
pos, self.url, num_auths = bin.unpack("A" .. url_len .. "C", data, pos)
|
||||
if ( no_urls > 0 ) then
|
||||
pos, reserved, self.url_lifetime, url_len = bin.unpack(">CSS", data, pos)
|
||||
|
||||
local num_auths
|
||||
pos, self.url, num_auths = bin.unpack("A" .. url_len .. "C", data, pos)
|
||||
end
|
||||
end,
|
||||
|
||||
--- Attempts to create an instance by reading data off the socket
|
||||
|
||||
@@ -31,7 +31,7 @@ function action()
|
||||
local helper = srvloc.Helper:new()
|
||||
|
||||
local status, bindery = helper:ServiceRequest("bindery.novell", "DEFAULT")
|
||||
if ( not(status) ) then return end
|
||||
if ( not(status) or not(bindery) ) then return end
|
||||
local srvname = bindery:match("%/%/%/(.*)$")
|
||||
|
||||
local status, attrib = helper:AttributeRequest(bindery, "DEFAULT", "svcaddr-ws")
|
||||
|
||||
Reference in New Issue
Block a user