1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 21:09:00 +00:00

Added new error messages for error codes

Added the 8A tagdecoder
Modified the output of error messages slightly
[Patrik]
This commit is contained in:
patrik
2011-05-22 14:43:08 +00:00
parent f0a37013e0
commit 8ff4e89019

View File

@@ -20,7 +20,9 @@ local ldapMessageId = 1
ERROR_MSG = {}
ERROR_MSG[1] = "Intialization of LDAP library failed."
ERROR_MSG[4] = "Size limit exceeded."
ERROR_MSG[13] = "Confidentiality required"
ERROR_MSG[32] = "No such object"
ERROR_MSG[34] = "Invalid DN"
ERROR_MSG[49] = "The supplied credential is invalid."
ERRORS = {
@@ -129,6 +131,10 @@ tagDecoder["0A"] = function( self, encStr, elen, pos )
return self.decodeInt(encStr, elen, pos)
end
tagDecoder["8A"] = function( self, encStr, elen, pos )
return bin.unpack("A" .. elen, encStr, pos)
end
-- null decoder
tagDecoder["31"] = function( self, encStr, elen, pos )
return pos, nil
@@ -360,7 +366,9 @@ function bindRequest( socket, params )
pos, response.matchedDN = decode( packet, pos )
pos, response.errorMessage = decode( packet, pos )
error_msg = ERROR_MSG[response.resultCode]
return false, string.format("Error: %s\nDetails: %s", error_msg or "", response.errorMessage or "" )
return false, string.format("\n Error: %s\n Details: %s",
error_msg or "Unknown error occured (code: " .. response.resultCode ..
")", response.errorMessage or "" )
else
return true, "Success"
end