From cfd0aaeabc5d19c7c2342e6e2956cb85c264182d Mon Sep 17 00:00:00 2001 From: ron Date: Fri, 24 Sep 2010 01:33:01 +0000 Subject: [PATCH] Fixed a bug where a ternary operator meant to prevent a nil pointer exception was outside of a math.floor() call, making it totally worthless. I moved the math.floor() outside the operation, fixing it. --- scripts/smb-enum-domains.nse | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/smb-enum-domains.nse b/scripts/smb-enum-domains.nse index 7e37bf8b5..2b0af53aa 100644 --- a/scripts/smb-enum-domains.nse +++ b/scripts/smb-enum-domains.nse @@ -90,11 +90,16 @@ action = function(host) table.insert(piece, string.format("Users: n/a")) end + -- Floor data.max_password_age, if possible + if(data.max_password_age) then + data.max_password_age = math.floor(data.max_password_age) + end + table.insert(piece, string.format("Creation time: %s", data.created)) table.insert(piece, string.format("Passwords: min length: %s; min age: %s days; max age: %s days; history: %s passwords", data.min_password_length or "n/a", data.min_password_age or "n/a", - math.floor(data.max_password_age) or "n/a", + data.max_password_age or "n/a", data.password_history or "n/a")) if(data.password_properties and #data.password_properties) then table.insert(piece, string.format("Properties: %s", stdnse.strjoin(", ", data.password_properties)))