From fb3eb4c6c5d4640f9ab37e9af2be3614c03dd62d Mon Sep 17 00:00:00 2001 From: patrik Date: Sat, 28 Jan 2012 18:13:15 +0000 Subject: [PATCH] Fixed a bug in http-auth that failed to report errors properly. --- scripts/http-auth.nse | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/http-auth.nse b/scripts/http-auth.nse index e44e46f66..566bca2c4 100644 --- a/scripts/http-auth.nse +++ b/scripts/http-auth.nse @@ -58,13 +58,13 @@ action = function(host, port) www_authenticate = answer.header["www-authenticate"] if not www_authenticate then - table.insert( ("Server returned status %d but no WWW-Authenticate header."):format(answer.status) ) + table.insert( result, ("Server returned status %d but no WWW-Authenticate header."):format(answer.status) ) return stdnse.format_output(true, result) end challenges = http.parse_www_authenticate(www_authenticate) if not challenges then - table.insert( ("Server returned status %d but the WWW-Authenticate header could not be parsed."):format(answer.status) ) - table.insert( ("WWW-Authenticate: %s"):format(www_authenticate) ) + table.insert( result, ("Server returned status %d but the WWW-Authenticate header could not be parsed."):format(answer.status) ) + table.insert( result, ("WWW-Authenticate: %s"):format(www_authenticate) ) return stdnse.format_output(true, result) end @@ -78,6 +78,5 @@ action = function(host, port) table.insert(result, line) end - --return table.concat(result, "\n") return stdnse.format_output(true, result) end