From 4ce4187d99d034ee275a15d99daf415314854874 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Dec 24 2009 12:05:21 +0000 Subject: Ver. 2.1.1 --- diff --git a/.cvsignore b/.cvsignore index 1a0dda1..cb7b892 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -ejabberd-2.1.0.tar.gz +ejabberd-2.1.1.tar.gz diff --git a/ejabberd-captcha-bashism.patch b/ejabberd-captcha-bashism.patch deleted file mode 100644 index 85a28cc..0000000 --- a/ejabberd-captcha-bashism.patch +++ /dev/null @@ -1,20 +0,0 @@ -Makes the captcha script explicitly request bash as it uses -its special variable "RANDOM" which is not defined by POSIX. - -The issue is tracked upstream at -https://support.process-one.net/browse/EJAB-1105 - -While it will be sensible to incorporate the upstream fix -(which will make the script work in POSIX-compliant shells also), -until bash is required in Debian, this patch is OK. - -diff --git a/tools/captcha.sh b/tools/captcha.sh -index 4d40567..d68edfa 100755 ---- a/tools/captcha.sh -+++ b/tools/captcha.sh -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/bin/bash - - INPUT=$1 - diff --git a/ejabberd-http-poll-web-page.patch b/ejabberd-http-poll-web-page.patch deleted file mode 100644 index 4998146..0000000 --- a/ejabberd-http-poll-web-page.patch +++ /dev/null @@ -1,89 +0,0 @@ -Generates a human-readable XHTML page which is returned -when a user tries to browse the HTTP-poll URL configured -for the server (a common mistake). - -This issue is tracked in EJAB-1106. - -This changeset was introduced in revision 2751, -branch http://svn.process-one.net/ejabberd/branches/ejabberd-2.1.x - -The first stable version containing the fix is 2.1.1. - ---- a/src/web/ejabberd_http_poll.erl (revision 2750) -+++ b/src/web/ejabberd_http_poll.erl (revision 2751) -@@ -154,12 +154,32 @@ - end - end; - _ -> -- {200, [?CT, {"Set-Cookie", "ID=-2:0; expires=-1"}], ""} -+ HumanHTMLxmlel = get_human_html_xmlel(), -+ {200, [?CT, {"Set-Cookie", "ID=-2:0; expires=-1"}], HumanHTMLxmlel} - end; - process(_, _Request) -> - {400, [], {xmlelement, "h1", [], - [{xmlcdata, "400 Bad Request"}]}}. - -+%% Code copied from mod_http_bind.erl and customized -+get_human_html_xmlel() -> -+ Heading = "ejabberd " ++ atom_to_list(?MODULE), -+ {xmlelement, "html", [{"xmlns", "http://www.w3.org/1999/xhtml"}], -+ [{xmlelement, "head", [], -+ [{xmlelement, "title", [], [{xmlcdata, Heading}]}]}, -+ {xmlelement, "body", [], -+ [{xmlelement, "h1", [], [{xmlcdata, Heading}]}, -+ {xmlelement, "p", [], -+ [{xmlcdata, "An implementation of "}, -+ {xmlelement, "a", -+ [{"href", "http://xmpp.org/extensions/xep-0025.html"}], -+ [{xmlcdata, "Jabber HTTP Polling (XEP-0025)"}]}]}, -+ {xmlelement, "p", [], -+ [{xmlcdata, "This web page is only informative. " -+ "To use HTTP-Poll you need a Jabber/XMPP client that supports it."} -+ ]} -+ ]}]}. -+ - %%%---------------------------------------------------------------------- - %%% Callback functions from gen_fsm - %%%---------------------------------------------------------------------- ---- a/src/web/mod_http_bind.erl (revision 2750) -+++ b/src/web/mod_http_bind.erl (revision 2751) -@@ -69,7 +69,14 @@ - ejabberd_http_bind:process_request(Data, IP); - process([], #request{method = 'GET', - data = []}) -> -- Heading = "Ejabberd " ++ atom_to_list(?MODULE) ++ " v" ++ ?MOD_HTTP_BIND_VERSION, -+ get_human_html_xmlel(); -+process(_Path, _Request) -> -+ ?DEBUG("Bad Request: ~p", [_Request]), -+ {400, [], {xmlelement, "h1", [], -+ [{xmlcdata, "400 Bad Request"}]}}. -+ -+get_human_html_xmlel() -> -+ Heading = "ejabberd " ++ atom_to_list(?MODULE) ++ " v" ++ ?MOD_HTTP_BIND_VERSION, - {xmlelement, "html", [{"xmlns", "http://www.w3.org/1999/xhtml"}], - [{xmlelement, "head", [], - [{xmlelement, "title", [], [{xmlcdata, Heading}]}]}, -@@ -77,15 +84,15 @@ - [{xmlelement, "h1", [], [{xmlcdata, Heading}]}, - {xmlelement, "p", [], - [{xmlcdata, "An implementation of "}, -- {xmlelement, "a", [{"href", "http://www.xmpp.org/extensions/xep-0206.html"}], -- [{xmlcdata, "XMPP over BOSH (XEP-0206)"}]}]} -- ]}]}; --process(_Path, _Request) -> -- ?DEBUG("Bad Request: ~p", [_Request]), -- {400, [], {xmlelement, "h1", [], -- [{xmlcdata, "400 Bad Request"}]}}. -+ {xmlelement, "a", -+ [{"href", "http://xmpp.org/extensions/xep-0206.html"}], -+ [{xmlcdata, "XMPP over BOSH (XEP-0206)"}]}]}, -+ {xmlelement, "p", [], -+ [{xmlcdata, "This web page is only informative. " -+ "To use HTTP-Bind you need a Jabber/XMPP client that supports it."} -+ ]} -+ ]}]}. - -- - %%%---------------------------------------------------------------------- - %%% BEHAVIOUR CALLBACKS - %%%---------------------------------------------------------------------- diff --git a/ejabberd-piefxis-vhost-export.patch b/ejabberd-piefxis-vhost-export.patch deleted file mode 100644 index 0a01449..0000000 --- a/ejabberd-piefxis-vhost-export.patch +++ /dev/null @@ -1,68 +0,0 @@ -This patch enables generation of the main XML file -when exporting data of a virtual host into PIEFXIS format. - -This issue is tracked upstream as EJAB-1098. - -This changeset was introduced in revisions 2753, -branch http://svn.process-one.net/ejabberd/branches/ejabberd-2.1.x - -The first stable version containing the fix is 2.1.1. - ---- a/src/ejabberd_piefxis.erl (revision 2752) -+++ b/src/ejabberd_piefxis.erl (revision 2753) -@@ -212,7 +212,7 @@ - El), - ok; - {atomic, exists} -> -- ?INFO_MSG("User ~p@~p already exists, using stored profile...~n", -+ io:format("Account ~s@~s already exists, updating it...~n", - [User, Domain]), - io:format(""), - ok = exmpp_xml:foreach( -@@ -417,10 +417,10 @@ - - %%%================================== - --%%%% Export server -+%%%% Export hosts - --%% @spec (Dir::string()) -> ok --export_server(Dir) -> -+%% @spec (Dir::string(), Hosts::[string()]) -> ok -+export_hosts(Dir, Hosts) -> - try_start_exmpp(), - - FnT = make_filename_template(), -@@ -430,7 +430,6 @@ - print(Fd, make_piefxis_xml_head()), - print(Fd, make_piefxis_server_head()), - -- Hosts = ?MYHOSTS, - FilesAndHosts = [{make_host_filename(FnT, Host), Host} || Host <- Hosts], - [print(Fd, make_xinclude(FnH)) || {FnH, _Host} <- FilesAndHosts], - -@@ -443,14 +442,20 @@ - ok. - - %%%================================== -+%%%% Export server -+ -+%% @spec (Dir::string()) -> ok -+export_server(Dir) -> -+ Hosts = ?MYHOSTS, -+ export_hosts(Dir, Hosts). -+ -+%%%================================== - %%%% Export host - - %% @spec (Dir::string(), Host::string()) -> ok - export_host(Dir, Host) -> -- try_start_exmpp(), -- FnT = make_filename_template(), -- FnH = make_host_filename(FnT, Host), -- export_host(Dir, FnH, Host). -+ Hosts = [Host], -+ export_hosts(Dir, Hosts). - - %% @spec (Dir::string(), Fn::string(), Host::string()) -> ok - export_host(Dir, FnH, Host) -> diff --git a/ejabberd-vcard-reqs-forwarding.patch b/ejabberd-vcard-reqs-forwarding.patch deleted file mode 100644 index 6280351..0000000 --- a/ejabberd-vcard-reqs-forwarding.patch +++ /dev/null @@ -1,127 +0,0 @@ -This bug fixes a long-standing bug with ejabberd violating -RFC 3920 by intercepting vCard request coming to a user's -full JID, which should be forwarded to the user's client instead. -This behaviour is especially noticeable in MUC rooms. - -This issue is tracked upstream as EJAB-1045. - -This changeset was introduced in revisions 2766-2768 -branch http://svn.process-one.net/ejabberd/branches/ejabberd-2.1.x - -The first stable version containing the fix is 2.1.1. - ---- a/src/ejabberd_sm.erl (revision 2762) -+++ b/src/ejabberd_sm.erl (revision 2768) -@@ -481,7 +481,7 @@ - _ -> - Err = - jlib:make_error_reply( -- Packet, ?ERR_RECIPIENT_UNAVAILABLE), -+ Packet, ?ERR_SERVICE_UNAVAILABLE), - ejabberd_router:route(To, From, Err) - end; - _ -> ---- a/src/mod_muc/mod_muc_room.erl (revision 2762) -+++ b/src/mod_muc/mod_muc_room.erl (revision 2768) -@@ -470,9 +470,10 @@ - {xmlelement, "iq", Attrs, _Els} = Packet}, - StateData) -> - Lang = xml:get_attr_s("xml:lang", Attrs), -+ StanzaId = xml:get_attr_s("id", Attrs), - case {(StateData#state.config)#config.allow_query_users, -- is_user_online(From, StateData)} of -- {true, true} -> -+ is_user_online_iq(StanzaId, From, StateData)} of -+ {true, {true, NewId, FromFull}} -> - case find_jid_by_nick(ToNick, StateData) of - false -> - case jlib:iq_query_info(Packet) of -@@ -489,13 +490,15 @@ - end; - ToJID -> - {ok, #user{nick = FromNick}} = -- ?DICT:find(jlib:jid_tolower(From), -+ ?DICT:find(jlib:jid_tolower(FromFull), - StateData#state.users), -+ {ToJID2, Packet2} = handle_iq_vcard(FromFull, ToJID, -+ StanzaId, NewId,Packet), - ejabberd_router:route( - jlib:jid_replace_resource(StateData#state.jid, FromNick), -- ToJID, Packet) -+ ToJID2, Packet2) - end; -- {_, false} -> -+ {_, {false, _, _}} -> - case jlib:iq_query_info(Packet) of - reply -> - ok; -@@ -829,7 +832,6 @@ - {next_state, normal_state, StateData} - end. - -- - %% @doc Check if this non participant can send message to room. - %% - %% XEP-0045 v1.23: -@@ -969,6 +971,50 @@ - LJID = jlib:jid_tolower(JID), - ?DICT:is_key(LJID, StateData#state.users). - -+ -+%%% -+%%% Handle IQ queries of vCard -+%%% -+is_user_online_iq(StanzaId, JID, StateData) when JID#jid.lresource /= "" -> -+ {is_user_online(JID, StateData), StanzaId, JID}; -+is_user_online_iq(StanzaId, JID, StateData) when JID#jid.lresource == "" -> -+ try stanzaid_unpack(StanzaId) of -+ {OriginalId, Resource} -> -+ JIDWithResource = jlib:jid_replace_resource(JID, Resource), -+ {is_user_online(JIDWithResource, StateData), -+ OriginalId, JIDWithResource} -+ catch -+ _:_ -> -+ {is_user_online(JID, StateData), StanzaId, JID} -+ end. -+ -+handle_iq_vcard(FromFull, ToJID, StanzaId, NewId, Packet) -> -+ ToBareJID = jlib:jid_remove_resource(ToJID), -+ IQ = jlib:iq_query_info(Packet), -+ handle_iq_vcard2(FromFull, ToJID, ToBareJID, StanzaId, NewId, IQ, Packet). -+handle_iq_vcard2(_FromFull, ToJID, ToBareJID, StanzaId, _NewId, -+ #iq{type = get, xmlns = ?NS_VCARD}, Packet) -+ when ToBareJID /= ToJID -> -+ {ToBareJID, change_stanzaid(StanzaId, ToJID, Packet)}; -+handle_iq_vcard2(_FromFull, ToJID, _ToBareJID, _StanzaId, NewId, _IQ, Packet) -> -+ {ToJID, change_stanzaid(NewId, Packet)}. -+ -+stanzaid_pack(OriginalId, Resource) -> -+ "berd"++base64:encode_to_string("ejab\0" ++ OriginalId ++ "\0" ++ Resource). -+stanzaid_unpack("berd"++StanzaIdBase64) -> -+ StanzaId = base64:decode_to_string(StanzaIdBase64), -+ ["ejab", OriginalId, Resource] = string:tokens(StanzaId, "\0"), -+ {OriginalId, Resource}. -+ -+change_stanzaid(NewId, Packet) -> -+ {xmlelement, Name, Attrs, Els} = jlib:remove_attr("id", Packet), -+ {xmlelement, Name, [{"id", NewId} | Attrs], Els}. -+change_stanzaid(PreviousId, ToJID, Packet) -> -+ NewId = stanzaid_pack(PreviousId, ToJID#jid.lresource), -+ change_stanzaid(NewId, Packet). -+%%% -+%%% -+ - role_to_list(Role) -> - case Role of - moderator -> "moderator"; ---- a/src/ejabberd_c2s.erl (revision 2762) -+++ b/src/ejabberd_c2s.erl (revision 2768) -@@ -1220,7 +1220,7 @@ - "iq" -> - IQ = jlib:iq_query_info(Packet), - case IQ of -- #iq{xmlns = ?NS_VCARD} -> -+ #iq{xmlns = ?NS_VCARD} when (To#jid.luser == "") or (To#jid.lresource == "") -> - Host = StateData#state.server, - case ets:lookup(sm_iqtable, {?NS_VCARD, Host}) of - [{_, Module, Function, Opts}] -> diff --git a/ejabberd.spec b/ejabberd.spec index 87f88fd..6ffdd41 100644 --- a/ejabberd.spec +++ b/ejabberd.spec @@ -11,8 +11,8 @@ %endif Name: ejabberd -Version: 2.1.0 -Release: 2%{?dist} +Version: 2.1.1 +Release: 1%{?dist} Summary: A distributed, fault-tolerant Jabber/XMPP server Group: Applications/Internet @@ -47,23 +47,8 @@ Patch3: ejabberd-ejabberd_cfg_pam_name.diff Patch5: ejabberd-mod_ctlextra_mentioning_in_ejabberd_app.diff # fixed delays in s2s connections Patch8: ejabberd-fixed_delays_in_s2s.patch -# captcha.sh uses some BASH-specific variables -# see https://support.process-one.net/browse/EJAB-1105 -Patch9: ejabberd-captcha-bashism.patch # Introducing mod_admin_extra Patch10: ejabberd-mod_admin_extra.patch -# Fixed long-standing bug with RFC 3920 violation -# see https://support.process-one.net/browse/EJAB-1045 -Patch11: ejabberd-vcard-reqs-forwarding.patch -# Generates a human-readable XHTML page which is returned -# when a user tries to browse the HTTP-poll URL configured -# for the server (a common mistake). -# see https://support.process-one.net/browse/EJAB-1106 -Patch12: ejabberd-http-poll-web-page.patch -# This patch enables generation of the main XML file -# when exporting data of a virtual host into PIEFXIS format. -# see https://support.process-one.net/browse/EJAB-1098 -Patch13: ejabberd-piefxis-vhost-export.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -177,11 +162,7 @@ fi %patch3 -p0 -b .pam_name %patch5 -p0 -b .mod_ctlextra %patch8 -p0 -b .s2s -%patch9 -p1 -b .bashism %patch10 -p1 -b .mod_admin_extra -%patch11 -p1 -b .vcard_rfc_violation -%patch12 -p1 -b .xhtml -%patch13 -p1 -b .piefxis dos2unix src/odbc/mssql2000.sql @@ -346,11 +327,16 @@ rm -rf %{buildroot} %doc doc/release_notes_2.0.4.txt %doc doc/release_notes_2.0.5.txt %doc doc/release_notes_2.1.0.txt +%doc doc/release_notes_2.1.1.txt %doc doc/webadmmain.png %doc doc/webadmmainru.png %doc doc/yozhikheader.png %changelog +* Thu Dec 24 2009 Peter Lemenkov 2.1.1-1 +- Ver. 2.1.1 +- Dropped patches 9,11,12,13 (accepted upstream) + * Thu Dec 10 2009 Peter Lemenkov 2.1.0-2 - DB backups are made on every upgrade/uninstall - Fixed installation of captcha.sh example helper diff --git a/import.log b/import.log index 6d5bba4..ce5ffd3 100644 --- a/import.log +++ b/import.log @@ -14,3 +14,4 @@ ejabberd-2_0_5-8_fc11:HEAD:ejabberd-2.0.5-8.fc11.src.rpm:1252493017 ejabberd-2_0_5-10_fc11:HEAD:ejabberd-2.0.5-10.fc11.src.rpm:1257428310 ejabberd-2_1_0-1_fc12:HEAD:ejabberd-2.1.0-1.fc12.src.rpm:1258790332 ejabberd-2_1_0-2_fc12:HEAD:ejabberd-2.1.0-2.fc12.src.rpm:1260471420 +ejabberd-2_1_1-1_fc12:HEAD:ejabberd-2.1.1-1.fc12.src.rpm:1261656263 diff --git a/sources b/sources index cc4348c..b5e96a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -373be6e99acf7c930ab85531489c63c4 ejabberd-2.1.0.tar.gz +8a2b9925fc2790d0594a8d3b37183537 ejabberd-2.1.1.tar.gz