Changeset

1637:c1292624f991

mod_saslauth: Fix traceback on attempted login for non-existent users
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 Aug 2009 16:31:56 +0100
parents 1636:16e9ba7c4a03
children 1638:6fd0c2f46b21
files plugins/mod_saslauth.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Wed Aug 05 13:52:14 2009 +0100
+++ b/plugins/mod_saslauth.lua	Wed Aug 05 16:31:56 2009 +0100
@@ -77,8 +77,12 @@
     function func(x) return x; end
     local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4];
     local password = usermanager_get_password(node, domain)
-    if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
-    return func, md5(node..":"..realm..":"..password);
+    if password then
+      if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
+      return func, md5(node..":"..realm..":"..password);
+    else
+      return func, nil;
+    end
   end
 end