]> granicus.if.org Git - ejabberd/commitdiff
Fix handling of xmlrpc request without authentication structure
authorPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 13 Mar 2017 15:41:52 +0000 (16:41 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 13 Mar 2017 15:41:52 +0000 (16:41 +0100)
This is problem from issue #1602

src/ejabberd_xmlrpc.erl

index ac2954b3099717b81d77f651da55cc3c972fc830..17fe75621b24b49112ab00f1c74b6fad0cc0f6d2 100644 (file)
@@ -274,7 +274,7 @@ extract_auth(AuthList) ->
                    {error, not_found}
            end
     catch
-        exit:{attribute_not_found, _Attr, _} ->
+       exit:{attribute_not_found, _, _} ->
             try get_attrs([user, server, password], AuthList) of
                 [U0, S0, P] ->
                    U = jid:nodeprep(U0),
@@ -286,8 +286,8 @@ extract_auth(AuthList) ->
                            {error, invalid_auth}
                    end
             catch
-                exit:{attribute_not_found, _Attr, _} ->
-                    #{}
+               exit:{attribute_not_found, Attr, _} ->
+                   throw({error, missing_auth_arguments, Attr})
             end
     end.
 
@@ -340,7 +340,8 @@ handler(#state{get_auth = true, auth = noauth, ip = IP} = State,
                     {call, Method, Arguments})
     catch
       {error, missing_auth_arguments, _Attr} ->
-         handler(State#state{get_auth = false, auth = noauth},
+         handler(State#state{get_auth = false,
+                             auth = #{ip => IP, caller_module => ?MODULE}},
                  {call, Method, AllArgs})
     end;
 %% .............................