]> granicus.if.org Git - ejabberd/commitdiff
Fix issue with ejabberd_xmlrpc user auth and SCRAM
authorSteven Lehrburger <lehrburger@gmail.com>
Tue, 18 Sep 2012 08:02:47 +0000 (08:02 +0000)
committerBadlop <badlop@process-one.net>
Mon, 4 Feb 2013 11:57:56 +0000 (12:57 +0100)
After enabling SCRAM password hashing and SSL in ejabberd, XMLRPC ejabberdctl commands were resulting in errors like this:

W(<0.2623.0>:ejabberd_xmlrpc:328) : Error -118
A problem '{error,invalid_account_data}' occurred executing the command user_sessions_info with arguments

It seems that this because ejabberd_commands was using a different authentication check than everything else, which wasn't properly taking account for potential password hashing. (Note I'm not really sure what AccountPassMD5 is doing, but it seems to be different than the ejabberd_auth_internal's SCRAM hasing.)

src/ejabberd_commands.erl

index 1cb73d811c8030615d03abbf2e593301c1cd3315..b61ef46ded2a41a6d5b3f07f3fc2ead7725cd23f 100644 (file)
@@ -382,10 +382,8 @@ check_auth(noauth) ->
 check_auth({User, Server, Password}) ->
     %% Check the account exists and password is valid
     case ejabberd_auth:check_password(User, Server, Password) of
-       true ->
-           {ok, User, Server};
-       false ->
-           throw({error, invalid_account_data})
+       true -> {ok, User, Server};
+       _ -> throw({error, invalid_account_data})
     end.
 
 check_access(all, _) ->