Patch to hddtemp-info by Toni Ruotto that keeps reading past the first

byte if there's a delay and supports different separator characters.
This commit is contained in:
david 2010-12-29 22:37:20 +00:00
parent 77c5cd9d9a
commit 1046dcab57

View file

@ -17,11 +17,13 @@ require("shortport")
portrule = shortport.port_or_service (7634, "hddtemp", {"tcp"})
action = function( host, port )
local status, data = comm.get_banner(host, port)
-- 5000B should be enough for 100 disks
local status, data = comm.get_banner(host, port, {bytes=5000})
if not status then
return
end
local fields = stdnse.strsplit("|", data)
local separator = string.sub(data, 1, 1)
local fields = stdnse.strsplit(separator, data)
local info = {}
local disks = math.floor((# fields) / 5)
for i = 0, (disks - 1) do