aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl_cyrus.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-03-18 01:31:37 +0000
committerMatthew Wild <mwild1@gmail.com>2010-03-18 01:31:37 +0000
commit67e1ec2f26912f934b7c6900d4d9669b33de1a36 (patch)
tree5995fd34e5532c2ef8566083cdc72ce7e4d84305 /util/sasl_cyrus.lua
parent0d6100844b07daef86571021aa8d3492e4da45ee (diff)
parent11b625e4ebc9bc396bb7fbf84fb058dc1e271897 (diff)
downloadprosody-67e1ec2f26912f934b7c6900d4d9669b33de1a36.tar.gz
prosody-67e1ec2f26912f934b7c6900d4d9669b33de1a36.zip
Merge darkrain->trunk
Diffstat (limited to 'util/sasl_cyrus.lua')
-rw-r--r--util/sasl_cyrus.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua
index 132da533..d011e08b 100644
--- a/util/sasl_cyrus.lua
+++ b/util/sasl_cyrus.lua
@@ -53,6 +53,16 @@ function new(realm, service_name)
sasl_i.realm = realm;
sasl_i.service_name = service_name;
sasl_i.cyrus = cyrussasl.server_new(service_name, nil, realm, nil, nil)
+
+ if cyrussasl.set_canon_cb then
+ local c14n_cb = function (user)
+ local node = s_match(user, "^([^@]+)");
+ log("debug", "Canonicalizing username %s to %s", user, node)
+ return node
+ end
+ cyrussasl.set_canon_cb(sasl_i.cyrus, c14n_cb);
+ end
+
if sasl_i.cyrus == 0 then
log("error", "got NULL return value from server_new")
return nil;