From 3727e2426d8a78a48f5fcba4adb25fa437e451d4 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 11 May 2010 00:30:32 +0200 Subject: [PATCH] Catch error when auth crashes --- src/web/ejabberd_web_admin.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index e79b4a2e6..10488d0fc 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -243,7 +243,7 @@ get_auth_admin(Auth, HostHTTP, RPath, Method) -> end. get_auth_account(HostOfRule, AccessRule, User, Server, Pass) -> - case ejabberd_auth:check_password(User, Server, Pass) of + case catch ejabberd_auth:check_password(User, Server, Pass) of true -> case is_acl_match(HostOfRule, AccessRule, exmpp_jid:make(User, Server)) of @@ -258,7 +258,9 @@ get_auth_account(HostOfRule, AccessRule, User, Server, Pass) -> {unauthorized, "bad-password"}; false -> {unauthorized, "inexistent-account"} - end + end; + _ -> + {unauthorized, "badformed-jid"} end. %%%==================================