25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Fix handling of unauthenticated stanzas which are not request IQ.

PR:		EJABP-1
Submitted by:	Pablo Polvorin <pablo.polvorin@process-one.net>

SVN Revision: 1615
This commit is contained in:
Jean-Sébastien Pédron 2008-10-09 11:54:42 +00:00
parent 67a87af459
commit 6ab7e339bd
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2008-10-09 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/ejabberd_c2s.erl: Fix handling of unauthenticated stanzas which
are not request IQ. Thanks to Pablo Polvorin!
2008-10-08 Jean-Sébastien Pédron <js.pedron@meetic-corp.com> 2008-10-08 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
Merge from trunk (r1563 to r1613). Merge from trunk (r1563 to r1613).

View File

@ -1285,7 +1285,7 @@ new_id() ->
randoms:get_string(). randoms:get_string().
is_auth_packet(El) -> is_auth_packet(El) when ?IS_IQ(El) ->
case exmpp_iq:is_request(El) of case exmpp_iq:is_request(El) of
true -> true ->
{auth, exmpp_stanza:get_id(El), exmpp_iq:get_type(El), {auth, exmpp_stanza:get_id(El), exmpp_iq:get_type(El),
@ -1293,7 +1293,9 @@ is_auth_packet(El) ->
undefined, undefined, undefined, undefined)}; undefined, undefined, undefined, undefined)};
false -> false ->
false false
end. end;
is_auth_packet(_El) ->
false.
get_auth_tags([#xmlel{ns = ?NS_LEGACY_AUTH, name = Name, children = Els} | L], get_auth_tags([#xmlel{ns = ?NS_LEGACY_AUTH, name = Name, children = Els} | L],
@ -1828,7 +1830,7 @@ resend_subscription_requests(#state{user = User,
end, end,
PendingSubscriptions). PendingSubscriptions).
process_unauthenticated_stanza(StateData, El) -> process_unauthenticated_stanza(StateData, El) when ?IS_IQ(El) ->
case exmpp_iq:get_kind(El) of case exmpp_iq:get_kind(El) of
request -> request ->
IQ_Rec = exmpp_iq:xmlel_to_iq(El), IQ_Rec = exmpp_iq:xmlel_to_iq(El),
@ -1851,9 +1853,12 @@ process_unauthenticated_stanza(StateData, El) ->
send_element(StateData, Res) send_element(StateData, Res)
end; end;
_ -> _ ->
% Drop any stanza, which isn't IQ stanza % Drop any stanza, which isn't an IQ request stanza
ok ok
end. end;
process_unauthenticated_stanza(_StateData,_El) ->
ok.
peerip(SockMod, Socket) -> peerip(SockMod, Socket) ->
IP = case SockMod of IP = case SockMod of