Software /
code /
prosody
Comparison
util/sasl_cyrus.lua @ 2903:d6da8f8e3502
util.sasl_cyrus: Return invalid-mechanism instead of undefined-condition where appropriate
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 18 Mar 2010 10:10:37 +0000 |
parent | 2902:c405486f289c |
child | 3063:ca149818083d |
comparison
equal
deleted
inserted
replaced
2902:c405486f289c | 2903:d6da8f8e3502 |
---|---|
121 return "success", data | 121 return "success", data |
122 elseif (err == 1) then -- SASL_CONTINUE | 122 elseif (err == 1) then -- SASL_CONTINUE |
123 return "challenge", data | 123 return "challenge", data |
124 elseif (err == -4) then -- SASL_NOMECH | 124 elseif (err == -4) then -- SASL_NOMECH |
125 log("debug", "SASL mechanism not available from remote end") | 125 log("debug", "SASL mechanism not available from remote end") |
126 return "failure", | 126 return "failure", "invalid-mechanism", "SASL mechanism not available" |
127 "undefined-condition", | |
128 "SASL mechanism not available" | |
129 elseif (err == -13) then -- SASL_BADAUTH | 127 elseif (err == -13) then -- SASL_BADAUTH |
130 return "failure", "not-authorized", cyrussasl.get_message( self.cyrus ) | 128 return "failure", "not-authorized", cyrussasl.get_message( self.cyrus ) |
131 else | 129 else |
132 log("debug", "Got SASL error condition %d", err) | 130 log("debug", "Got SASL error condition %d", err) |
133 return "failure", | 131 return "failure", "undefined-condition", cyrussasl.get_message( self.cyrus ) |
134 "undefined-condition", | |
135 cyrussasl.get_message( self.cyrus ) | |
136 end | 132 end |
137 end | 133 end |
138 | 134 |
139 return _M; | 135 return _M; |