From 4c847ef4f14a09a0b77b541c8ac408a1e7b960a8 Mon Sep 17 00:00:00 2001 From: paulino Date: Fri, 4 Aug 2017 22:07:44 +0000 Subject: [PATCH] Sets the boot date string to N/A when boot time isn't available --- nselib/smb2.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nselib/smb2.lua b/nselib/smb2.lua index 569802ee5..4808eafd0 100644 --- a/nselib/smb2.lua +++ b/nselib/smb2.lua @@ -392,8 +392,14 @@ function negotiate_v2(smb, overrides) -- Convert the time and timezone to human readable values (taken from smb.lua) smb['time'] = (smb['time'] // 10000000) - 11644473600 smb['date'] = os.date("%Y-%m-%d %H:%M:%S", smb['time']) - smb['start_time'] = (smb['start_time'] // 10000000) - 11644473600 - smb['start_date'] = os.date("%Y-%m-%d %H:%M:%S", smb['start_time']) + + -- Samba does not report the boot time + if smb['start_time'] ~= 0 then + smb['start_time'] = (smb['start_time'] // 10000000) - 11644473600 + smb['start_date'] = os.date("%Y-%m-%d %H:%M:%S", smb['start_time']) + else + smb['start_date'] = "N/A" + end local security_buffer_offset, security_buffer_length, neg_context_offset security_buffer_offset, security_buffer_length, neg_context_offset = string.unpack("