24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-16 22:05:29 +02:00

ignore unknown configuration fields (EJAB-762); fix node authorization bug (EJAB-798)

SVN Revision: 1713
This commit is contained in:
Christophe Romain 2008-12-08 19:38:59 +00:00
parent 6349ff898f
commit feb0bceb41
3 changed files with 12 additions and 16 deletions

View File

@ -4,6 +4,11 @@
* src/mod_pubsub/mod_pubsub.erl: Likewise
* src/mod_caps.erl: Likewise
* src/mod_pubsub.erl: ignore unknown configuration fields (EJAB-762);
fix node authorization bug (EJAB-798)
* src/pubsub.hrl: remove unused pubsub_presence record
2008-12-08 Mickael Remond <mremond@process-one.net>
* src/ejabberd_c2s.erl: Enforce client stanza from attribute

View File

@ -1049,7 +1049,7 @@ find_authorization_response(Packet) ->
[] -> none;
[XFields] when is_list(XFields) ->
case lists:keysearch("FORM_TYPE", 1, XFields) of
{value, {_, ?NS_PUBSUB_SUB_AUTH}} ->
{value, {_, [?NS_PUBSUB_SUB_AUTH]}} ->
XFields;
_ ->
invalid
@ -1060,8 +1060,8 @@ handle_authorization_response(Host, From, To, Packet, XFields) ->
case {lists:keysearch("pubsub#node", 1, XFields),
lists:keysearch("pubsub#subscriber_jid", 1, XFields),
lists:keysearch("pubsub#allow", 1, XFields)} of
{{value, {_, SNode}}, {value, {_, SSubscriber}},
{value, {_, SAllow}}} ->
{{value, {_, [SNode]}}, {value, {_, [SSubscriber]}},
{value, {_, [SAllow]}}} ->
Node = case Host of
{_, _, _} -> [SNode];
_ -> string:tokens(SNode, "/")
@ -1076,7 +1076,7 @@ handle_authorization_response(Host, From, To, Packet, XFields) ->
%%options = Options,
owners = Owners}) ->
IsApprover = lists:member(jlib:jid_tolower(jlib:jid_remove_resource(From)), Owners),
Subscription = node_call(Type, get_subscription, [Host, Node, Subscriber]),
{result, Subscription} = node_call(Type, get_subscription, [Host, Node, Subscriber]),
if
not IsApprover ->
{error, ?ERR_FORBIDDEN};
@ -2637,8 +2637,9 @@ set_xoption([{"pubsub#type", Value} | Opts], NewOpts) ->
?SET_STRING_XOPT(type, Value);
set_xoption([{"pubsub#body_xslt", Value} | Opts], NewOpts) ->
?SET_STRING_XOPT(body_xslt, Value);
set_xoption([_ | _Opts], _NewOpts) ->
{error, ?ERR_NOT_ACCEPTABLE}.
set_xoption([_ | Opts], NewOpts) ->
% skip unknown field
set_xoption(Opts, NewOpts).
%%%% plugin handling

View File

@ -119,13 +119,3 @@
payload = []
}).
%% @type pubsubPresence() = #pubsub_presence{
%% key = {Host::host(), User::string(), Server::string()},
%% presence = list().
%%% <p>This is the format of the <tt>published presence</tt> table. The type of the
%%% table is: <tt>set</tt>,<tt>ram</tt>.</p>
-record(pubsub_presence, {key,
resource
}).