util.sasl_cyrus: Return invalid-mechanism instead of undefined-condition where appropriate

This commit is contained in:
Matthew Wild 2010-03-18 10:10:37 +00:00
parent d8c2bb590c
commit 367052b111

View file

@ -123,16 +123,12 @@ function method:process(message)
return "challenge", data
elseif (err == -4) then -- SASL_NOMECH
log("debug", "SASL mechanism not available from remote end")
return "failure",
"undefined-condition",
"SASL mechanism not available"
return "failure", "invalid-mechanism", "SASL mechanism not available"
elseif (err == -13) then -- SASL_BADAUTH
return "failure", "not-authorized", cyrussasl.get_message( self.cyrus )
else
log("debug", "Got SASL error condition %d", err)
return "failure",
"undefined-condition",
cyrussasl.get_message( self.cyrus )
return "failure", "undefined-condition", cyrussasl.get_message( self.cyrus )
end
end