diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-05-20 11:08:51 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-05-20 11:08:51 +0100 |
commit | 06fe337d67c941d8a9e9bb176a42f1e68340518e (patch) | |
tree | 4ffb0f2c8e913c5b671eab952b5c925805b4d0fd | |
parent | e0c6bb2b56733117b2290052f266a5e5df7b12d9 (diff) | |
download | prosody-06fe337d67c941d8a9e9bb176a42f1e68340518e.tar.gz prosody-06fe337d67c941d8a9e9bb176a42f1e68340518e.zip |
mod_saslauth: Add return value and error message to the Cyrus SASL handle_status callback
-rw-r--r-- | plugins/mod_saslauth.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 6e158463..2c92e974 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -94,7 +94,7 @@ local function build_reply(status, ret, err_msg) return reply; end -local function handle_status(session, status) +local function handle_status(session, status, ret, err_msg) if status == "failure" then session.sasl_handler = session.sasl_handler:clean_clone(); elseif status == "success" then @@ -103,12 +103,13 @@ local function handle_status(session, status) module:log("warn", "SASL succeeded but we didn't get a username!"); session.sasl_handler = nil; session:reset_stream(); - return; + return status, ret, err_msg; end sm_make_authenticated(session, session.sasl_handler.username); session.sasl_handler = nil; session:reset_stream(); end + return status, ret, err_msg; end local function sasl_handler(session, stanza) @@ -142,7 +143,7 @@ local function sasl_handler(session, stanza) end end local status, ret, err_msg = session.sasl_handler:process(text); - handle_status(session, status); + status, ret, err_msg = handle_status(session, status, ret, err_msg); local s = build_reply(status, ret, err_msg); log("debug", "sasl reply: %s", tostring(s)); session.send(s); |