mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
Fix handling of xmlrpc request without authentication structure
This is problem from issue #1602
This commit is contained in:
parent
113ed66f49
commit
301b1b7a7a
@ -274,7 +274,7 @@ extract_auth(AuthList) ->
|
|||||||
{error, not_found}
|
{error, not_found}
|
||||||
end
|
end
|
||||||
catch
|
catch
|
||||||
exit:{attribute_not_found, _Attr, _} ->
|
exit:{attribute_not_found, _, _} ->
|
||||||
try get_attrs([user, server, password], AuthList) of
|
try get_attrs([user, server, password], AuthList) of
|
||||||
[U0, S0, P] ->
|
[U0, S0, P] ->
|
||||||
U = jid:nodeprep(U0),
|
U = jid:nodeprep(U0),
|
||||||
@ -286,8 +286,8 @@ extract_auth(AuthList) ->
|
|||||||
{error, invalid_auth}
|
{error, invalid_auth}
|
||||||
end
|
end
|
||||||
catch
|
catch
|
||||||
exit:{attribute_not_found, _Attr, _} ->
|
exit:{attribute_not_found, Attr, _} ->
|
||||||
#{}
|
throw({error, missing_auth_arguments, Attr})
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
@ -340,7 +340,8 @@ handler(#state{get_auth = true, auth = noauth, ip = IP} = State,
|
|||||||
{call, Method, Arguments})
|
{call, Method, Arguments})
|
||||||
catch
|
catch
|
||||||
{error, missing_auth_arguments, _Attr} ->
|
{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})
|
{call, Method, AllArgs})
|
||||||
end;
|
end;
|
||||||
%% .............................
|
%% .............................
|
||||||
|
Loading…
Reference in New Issue
Block a user