summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2009-03-28 08:16:40 +0000
committerPeter Volkov <pva@gentoo.org>2009-03-28 08:16:40 +0000
commit31422c828aa019bd2d6517539ae9be2d006b601b (patch)
tree7f2918f87e6fef509f3cfd0c1ae73e9c1f63b955 /net-im/ejabberd
parentVersion bump (diff)
downloadhistorical-31422c828aa019bd2d6517539ae9be2d006b601b.tar.gz
historical-31422c828aa019bd2d6517539ae9be2d006b601b.tar.bz2
historical-31422c828aa019bd2d6517539ae9be2d006b601b.zip
Fixed EJAB-890 (subscription request produces many authorization requests with some clients and transports), bug #263950, thank Vadim Efimov for report and fix.
Package-Manager: portage-2.2_rc26/cvs/Linux i686
Diffstat (limited to 'net-im/ejabberd')
-rw-r--r--net-im/ejabberd/ChangeLog10
-rw-r--r--net-im/ejabberd/Manifest14
-rw-r--r--net-im/ejabberd/ejabberd-2.0.4-r1.ebuild159
-rw-r--r--net-im/ejabberd/files/ejabberd-2.0.4-fix-EJAB-890.patch167
4 files changed, 338 insertions, 12 deletions
diff --git a/net-im/ejabberd/ChangeLog b/net-im/ejabberd/ChangeLog
index 7e8bdc9006f8..6dc7b7ca7e85 100644
--- a/net-im/ejabberd/ChangeLog
+++ b/net-im/ejabberd/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-im/ejabberd
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.53 2009/03/27 19:40:57 hanno Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.54 2009/03/28 08:16:39 pva Exp $
+
+*ejabberd-2.0.4-r1 (28 Mar 2009)
+
+ 28 Mar 2009; Peter Volkov <pva@gentoo.org>
+ +files/ejabberd-2.0.4-fix-EJAB-890.patch, +ejabberd-2.0.4-r1.ebuild:
+ Fixed EJAB-890 (subscription request produces many authorization requests
+ with some clients and transports), bug #263950, thank Vadim Efimov for
+ report and fix.
27 Mar 2009; Hanno Boeck <hanno@gentoo.org> files/ejabberd-2.0.1.initd,
files/ejabberd-2.0.2.initd, files/ejabberd-2.0.4.initd:
diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 32b30de7588b..7532b8998ac8 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX 1.1.4-missing-declaration.patch 411 RMD160 f314900dd00fd23c9043cb5a60982448c39d2fa9 SHA1 687066247c9ad74c4e9ec869a9f4f0d9e80bae6d SHA256 1c32a57f4f187d55b28b240820875fcd3e731f6d91cd9429d14c318222f07e7b
AUX 2.0.0-ejab-542-mod_proxy65.patch 598 RMD160 bfe11518b5dbfcfb64c7bb04be965d2e383c2d90 SHA1 9161450bf883209f4c2ff2c061f94ef401e4fa51 SHA256 80ce546763de423430efcb60376ff2fda1fcd15ab7b80003ef5d7380a1a4caa3
AUX 2.0.0-erlang12-s2s-in.patch 1164 RMD160 5bcb04354c02749cdec302dc30354a49872ef2f5 SHA1 c27402b062b58ecf74c9e8c0cf2e879dbe600656 SHA256 ebc66c2a507e39f7f794b32f91148ea5e8c34e46ad41b4b876983da4aa9c1342
@@ -14,6 +11,7 @@ AUX ejabberd-2.0.1.confd 840 RMD160 c013ebfe1e471916561ba23a0ac83618501ce8cc SHA
AUX ejabberd-2.0.1.initd 1132 RMD160 54f96d792816f214d689e01f0ea571681ad6a9b0 SHA1 154d6494c18eb8f97b9d2bf4420562ebe64bbd32 SHA256 c493257640d0195552c87f38d803fc8c15d3d36caced476e021d57960fa92acb
AUX ejabberd-2.0.2.confd 840 RMD160 5227a3fbb0d0c8bffd8a5537003f965f1fb73582 SHA1 d3a51fa0923a571d30f3f0840834c651726ad206 SHA256 d6b0c44a450c4191e450b8e3ab281dc2e3bc668a97ddd1652d2e6c555675a2c6
AUX ejabberd-2.0.2.initd 1132 RMD160 dd527410a24368940ad23075f4ff57f4ee9828a2 SHA1 9fa7859b48248e27b39e13775699921d8e6b024a SHA256 1b14f49ae4ebca31bf3aab6a7d9887752174c032a176e1da9a43120c1e350b22
+AUX ejabberd-2.0.4-fix-EJAB-890.patch 5259 RMD160 72fe6630ab6ca84b90a4947b95ac24b689a86bd7 SHA1 ab61f5335177a4344a61830e39ada84f6688f2b4 SHA256 be38a6a278f3ad4da3fd9dfd56623a271677d8897cf4fd04b31994ed5d6f7959
AUX ejabberd-2.0.4.confd 840 RMD160 0d6761c629964febf390249304d9b2a4e10f85b4 SHA1 0afedf459a4a8bf6c24798800c1f83149003f44f SHA256 5f86c82752f5cbdc77556a134d3d0d07e682f7255a25d91873677f9e2f43cda0
AUX ejabberd-2.0.4.initd 1132 RMD160 c055617a8f5cc1a095742dbfeabd96edf2cdcbb6 SHA1 1b4a5b5ff8b4af5fea1341befe808f3b39d67edb SHA256 5b3b7a59b17979bf4bc7baba39f3ae5801f5176b061fc52e6ca77effab59fdec
AUX ejabberd-wrapper-2.0.1.template 1243 RMD160 989700850578dd86fe6cefeb465a1c84ba49df48 SHA1 115d10f04dd92ca090e853013dde3e5ffa3d6904 SHA256 1d3abfbb1b4dd79ba9fed74a5c86c97af70dc11927d8fa109a1486999d5f7a96
@@ -36,13 +34,7 @@ EBUILD ejabberd-1.1.4-r2.ebuild 3479 RMD160 d6bfed9a9127bc8246d315b16c184bf7a94b
EBUILD ejabberd-2.0.1_p2-r1.ebuild 4888 RMD160 d3155ae40d18d431f047e4dc7d29dbc7a57b9bbc SHA1 bef8cc2ed73edd70ba01490b062ac5247afcfcef SHA256 5cfd96195106459e4d5f1675d7b8837b060e91b2d69163c778f7f18954bcad55
EBUILD ejabberd-2.0.2-r1.ebuild 4817 RMD160 f5a48c390ad0ea3760b2667c623374c1bc2a5ca4 SHA1 cc56db2924b713b7edff88ad304bd11c0c2377d2 SHA256 19b2b7dcfa1930068bbe1d2a79ab1d845823fce0ce962d1f8f42ee32a6d9fe30
EBUILD ejabberd-2.0.2.ebuild 4814 RMD160 78fdc1c569c0961efda5aa9c53be5c363d5a4b13 SHA1 e6590f5fa39628aad821c0aaa75a93bfc1610998 SHA256 785f47b09ba14a32673a5a231d57b549aa61cb341f86e624f2630b941b4a302b
+EBUILD ejabberd-2.0.4-r1.ebuild 4894 RMD160 f3e1b6609b2c0d66ce005518ac320e540f769d84 SHA1 a513a4c13dffe86bb48cd31f590b274a40344908 SHA256 6cf06ff443c9f49f99290faf466aa199d31229c4fe96a8fe069ccf97b2b6fb74
EBUILD ejabberd-2.0.4.ebuild 4831 RMD160 a107945058ff565b5a6ba60d27359f2f75761f09 SHA1 4857680dff8d02417c917f7bdf7b3cf6aa0a7f64 SHA256 3bd1fe637198b29ded4aeaac3771869e08541c51ace2531bde925d9dc745ee14
-MISC ChangeLog 10980 RMD160 96023f7a81985a1cd3eb5a95ef06d12cdfa2a8ca SHA1 a24169cc0d16863ff0090d199879c9b51b9421d6 SHA256 aec66c4a5b04a558de96e27bfa9ab4c91c37107dee7bd1bc8e182fc9dbe1039d
+MISC ChangeLog 11296 RMD160 b874bc478839b56632214abb4ec5d1849b35a8e8 SHA1 33bf3f3f1a72554f98bed0ba3aa471a043749e06 SHA256 06b64f344fa5e18152004803702107debe1a759cc1720b253d8e9b9cb1ffca60
MISC metadata.xml 619 RMD160 ca6e7f018d370ce36a3b93eb960254537260949c SHA1 404f3d0d31036ed1cfeb8aeee2264559c1d1c8d9 SHA256 843e1bbd5fdc082763e71322094170cde5b90d0f5d9320011c4b9872cd6589f4
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.11 (GNU/Linux)
-
-iEYEARECAAYFAknNK80ACgkQr2QksT29OyCXVQCeO5beJEwJHGv+7oCM1Lg1wKA2
-q6MAn0+9Lb455h0iBO2OdHg3rEEIRCOj
-=ESEc
------END PGP SIGNATURE-----
diff --git a/net-im/ejabberd/ejabberd-2.0.4-r1.ebuild b/net-im/ejabberd/ejabberd-2.0.4-r1.ebuild
new file mode 100644
index 000000000000..3a918707fbf1
--- /dev/null
+++ b/net-im/ejabberd/ejabberd-2.0.4-r1.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-2.0.4-r1.ebuild,v 1.1 2009/03/28 08:16:39 pva Exp $
+
+inherit eutils multilib
+
+JABBER_ETC="/etc/jabber"
+JABBER_RUN="/var/run/jabber"
+JABBER_SPOOL="/var/spool/jabber"
+JABBER_LOG="/var/log/jabber"
+
+MY_PV=${PV}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="The Erlang Jabber Daemon"
+HOMEPAGE="http://www.ejabberd.im/"
+SRC_URI="http://www.process-one.net/downloads/ejabberd/${PV}/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="debug mod_irc mod_muc mod_pubsub ldap odbc pam ssl web zlib"
+
+DEPEND=">=net-im/jabber-base-0.01
+ >=dev-libs/expat-1.95
+ >=dev-lang/erlang-11.2.5
+ odbc? ( dev-db/unixODBC )
+ ldap? ( =net-nds/openldap-2* )
+ ssl? ( >=dev-libs/openssl-0.9.8e )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+PROVIDE="virtual/jabber-server"
+
+S=${WORKDIR}/${MY_P}/src
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Bug #171427
+ epatch "${FILESDIR}/2.0.0-missing-declaration.patch"
+ epatch "${FILESDIR}/${PN}-2.0.4-fix-EJAB-890.patch" #263950
+
+ # get rid of the prefix
+ sed -i -e "s/\\@prefix\\@//" "${S}/Makefile.in" \
+ || die "cannot sed Makefile.in"
+ # we want ejabberdctl in /usr/sbin not /sbin !!!
+ sed -i -e "s/\\/sbin/\\/usr\\/sbin/" "${S}/Makefile.in" \
+ || die "cannot sed Makefile.in"
+}
+
+src_compile() {
+ econf --prefix=/ \
+ $(use_enable mod_irc) \
+ $(use_enable ldap eldap) \
+ $(use_enable mod_muc) \
+ $(use_enable mod_pubsub) \
+ $(use_enable ssl tls) \
+ $(use_enable web) \
+ $(use_enable odbc) \
+ $(use_enable zlib ejabberd_zlib) \
+ $(use_enable pam) \
+ || die "econf failed"
+
+ if useq debug; then
+ emake ejabberd_debug=true || die "compiling ejabberd core failed"
+ else
+ emake || die "compiling ejabberd core failed"
+ fi
+}
+
+src_install() {
+ make \
+ DESTDIR="${D}" \
+ EJABBERDDIR="${D}/usr/$(get_libdir)/erlang/lib/${P}" \
+ ETCDIR="${D}${JABBER_ETC}" \
+ LOGDIR="${D}${JABBER_LOG}" \
+ install || die "install failed"
+
+ # remove the default ejabberdctl as we use our own
+ rm "${D}/sbin/ejabberdctl"
+
+ insinto ${JABBER_ETC}
+
+ chown -R jabber:jabber "${D}${JABBER_ETC}"
+ chown -R jabber:jabber "${D}${JABBER_LOG}"
+ chown -R jabber:jabber "${D}/usr/$(get_libdir)/erlang/lib/${P}"
+
+ if useq ssl ; then
+ doins "${FILESDIR}/ssl.cnf"
+ newins "${FILESDIR}/self-cert-v2.sh" self-cert.sh
+ fi
+
+ # Pam helper module permissions
+ # http://www.process-one.net/docs/ejabberd/guide_en.html
+ if useq pam; then
+ chown root:jabber "${D}"/usr/lib/erlang/lib/${P}/priv/bin/epam
+ chmod 4750 "${D}"/usr/lib/erlang/lib/${P}/priv/bin/epam
+ fi
+
+ cd "${WORKDIR}/${MY_P}/doc"
+ dodoc "release_notes_${MY_PV}.txt"
+ dohtml *.{html,png}
+
+ # set up /usr/sbin/ejabberd wrapper
+ cat "${FILESDIR}/ejabberd-wrapper-${MY_PV}.template" \
+ | sed -e "s/\@libdir\@/$(get_libdir)/g" -e "s/\@version\@/${PV}/g" \
+ > "${T}/ejabberd"
+ exeinto /usr/sbin
+ doexe "${T}/ejabberd"
+
+ # set up /usr/sbin/ejabberdctl wrapper
+ cat "${FILESDIR}/ejabberdctl-wrapper-${MY_PV}.template" \
+ | sed -e "s/\@libdir\@/$(get_libdir)/g" -e "s/\@version\@/${PV}/g" \
+ > "${T}/ejabberdctl"
+ doexe "${T}/ejabberdctl"
+
+ dodir /var/lib/ejabberd
+ newinitd "${FILESDIR}/${MY_P}.initd" ${PN}
+ newconfd "${FILESDIR}/${MY_P}.confd" ${PN}
+
+ # fix up the ssl cert paths in /etc/jabber/ejabberd.cfg to use the cert
+ # that would be generated by /etc/jabber/self-cert.sh
+ sed -i -e "s/\/path\/to\/ssl.pem/\/etc\/jabber\/ssl.pem/g" \
+ "${D}${JABBER_ETC}/ejabberd.cfg" || die "Cannot sed ejabberd.cfg"
+
+ # if mod_irc is not enabled, comment out the mod_irc in the default
+ # ejabberd.cfg
+ if ! use mod_irc; then
+ sed -i -e "s/{mod_irc,/%{mod_irc,/" \
+ "${D}${JABBER_ETC}/ejabberd.cfg" || die "Cannot sed ejabberd.cfg"
+ fi
+}
+
+pkg_postinst() {
+ elog "For configuration instructions, please see"
+ elog "/usr/share/doc/${PF}/html/guide.html, or the online version at"
+ elog "http://www.process-one.net/en/projects/ejabberd/docs/guide_en.html"
+ if useq ssl ; then
+ if [ ! -e /etc/jabber/ssl.pem ]; then
+ elog "Please edit ${JABBER_ETC}/ssl.cnf and run ${JABBER_ETC}/self-cert.sh"
+ elog "Ejabberd may refuse to start without an SSL certificate"
+ fi
+ fi
+ if ! useq web ; then
+ elog "The web USE flag is off, this has disabled the web admin interface."
+ fi
+ elog "===================================================================="
+ elog 'Quick Start Guide:'
+ elog '1) Add output of `hostname -f` to /etc/jabber/ejabberd.cfg line 89'
+ elog ' {hosts, ["localhost", "thehost"]}.'
+ elog '2) Add an admin user to /etc/jabber/ejabberd.cfg line 324'
+ elog ' {acl, admin, {user, "theadmin", "thehost"}}.'
+ elog '3) Start the server'
+ elog ' # /etc/init.d/ejabberd start'
+ elog '4) Register the admin user'
+ elog ' # /usr/sbin/ejabberdctl register theadmin thehost thepassword'
+ elog '5) Log in with your favourite jabber client or using the web admin'
+}
diff --git a/net-im/ejabberd/files/ejabberd-2.0.4-fix-EJAB-890.patch b/net-im/ejabberd/files/ejabberd-2.0.4-fix-EJAB-890.patch
new file mode 100644
index 000000000000..3da58ce6b83d
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-2.0.4-fix-EJAB-890.patch
@@ -0,0 +1,167 @@
+diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
+index 9bd5ba5..40cba2a 100644
+--- ejabberd_c2s.erl
++++ ejabberd_c2s.erl
+@@ -1091,21 +1091,16 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
+ Attrs1 = lists:keydelete("type", 1, Attrs),
+ {true, [{"type", "unavailable"} | Attrs1], StateData};
+ "subscribe" ->
+- Reason = xml:get_path_s(Packet,[{elem,"status"},cdata]),
+- SRes = check_privacy_subs(in, subscribe, From, To,
+- Packet, Reason, StateData),
++ SRes = is_privacy_allow(From, To, Packet, StateData#state.privacy_list),
+ {SRes, Attrs, StateData};
+ "subscribed" ->
+- SRes = check_privacy_subs(in, subscribed, From, To,
+- Packet, "", StateData),
++ SRes = is_privacy_allow(From, To, Packet, StateData#state.privacy_list),
+ {SRes, Attrs, StateData};
+ "unsubscribe" ->
+- SRes = check_privacy_subs(in, unsubscribe, From, To,
+- Packet, "", StateData),
++ SRes = is_privacy_allow(From, To, Packet, StateData#state.privacy_list),
+ {SRes, Attrs, StateData};
+ "unsubscribed" ->
+- SRes = check_privacy_subs(in, unsubscribed, From, To,
+- Packet, "", StateData),
++ SRes = is_privacy_allow(From, To, Packet, StateData#state.privacy_list),
+ {SRes, Attrs, StateData};
+ _ ->
+ case ejabberd_hooks:run_fold(
+@@ -1628,35 +1623,18 @@ presence_track(From, To, Packet, StateData) ->
+ pres_a = A}
+ end.
+
+-%% Check privacy rules for subscription requests and call the roster storage
+-check_privacy_subs(Dir, Type, From, To, Packet, Reason, StateData) ->
+- case is_privacy_allow(From, To, Dir, Packet, StateData) of
+- true ->
+- ejabberd_hooks:run_fold(
+- roster_in_subscription,
+- To#jid.lserver,
+- false,
+- [To#jid.user, To#jid.server, From, Type, Reason]),
+- true;
+- false ->
+- false
+- end.
+-
+-%% Check if privacy rules allow this delivery, then push to roster
+-is_privacy_allow(From, To, Dir, Packet, StateData) ->
+- case ejabberd_hooks:run_fold(
+- privacy_check_packet, StateData#state.server,
+- allow,
+- [StateData#state.user,
+- StateData#state.server,
+- StateData#state.privacy_list,
+- {From, To, Packet},
+- Dir]) of
+- deny ->
+- false;
+- allow ->
+- true
+- end.
++%% Check if privacy rules allow this delivery
++is_privacy_allow(From, To, Packet, PrivacyList) ->
++ User = To#jid.user,
++ Server = To#jid.server,
++ allow == ejabberd_hooks:run_fold(
++ privacy_check_packet, Server,
++ allow,
++ [User,
++ Server,
++ PrivacyList,
++ {From, To, Packet},
++ in]).
+
+ presence_broadcast(StateData, From, JIDSet, Packet) ->
+ lists:foreach(fun(JID) ->
+diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl
+index 9a56e5f..148ef5a 100644
+--- ejabberd_sm.erl
++++ ejabberd_sm.erl
+@@ -59,6 +59,7 @@
+ -include("ejabberd.hrl").
+ -include("jlib.hrl").
+ -include("ejabberd_ctl.hrl").
++-include("mod_privacy.hrl").
+
+ -record(session, {sid, usr, us, priority, info}).
+ -record(state, {}).
+@@ -381,13 +382,40 @@ do_route(From, To, Packet) ->
+ {Pass, _Subsc} =
+ case xml:get_attr_s("type", Attrs) of
+ "subscribe" ->
+- {true, true};
++ Reason = xml:get_path_s(
++ Packet,
++ [{elem, "status"}, cdata]),
++ {is_privacy_allow(From, To, Packet) andalso
++ ejabberd_hooks:run_fold(
++ roster_in_subscription,
++ LServer,
++ false,
++ [User, Server, From, subscribe, Reason]),
++ true};
+ "subscribed" ->
+- {true, true};
++ {is_privacy_allow(From, To, Packet) andalso
++ ejabberd_hooks:run_fold(
++ roster_in_subscription,
++ LServer,
++ false,
++ [User, Server, From, subscribed, ""]),
++ true};
+ "unsubscribe" ->
+- {true, true};
++ {is_privacy_allow(From, To, Packet) andalso
++ ejabberd_hooks:run_fold(
++ roster_in_subscription,
++ LServer,
++ false,
++ [User, Server, From, unsubscribe, ""]),
++ true};
+ "unsubscribed" ->
+- {true, true};
++ {is_privacy_allow(From, To, Packet) andalso
++ ejabberd_hooks:run_fold(
++ roster_in_subscription,
++ LServer,
++ false,
++ [User, Server, From, unsubscribed, ""]),
++ true};
+ _ ->
+ {true, false}
+ end,
+@@ -446,6 +474,31 @@ do_route(From, To, Packet) ->
+ end
+ end.
+
++%% The default list applies to the user as a whole,
++%% and is processed if there is no active list set
++%% for the target session/resource to which a stanza is addressed,
++%% or if there are no current sessions for the user.
++is_privacy_allow(From, To, Packet) ->
++ User = To#jid.user,
++ Server = To#jid.server,
++ PrivacyList = ejabberd_hooks:run_fold(privacy_get_user_list, Server,
++ #userlist{}, [User, Server]),
++ is_privacy_allow(From, To, Packet, PrivacyList).
++
++%% Check if privacy rules allow this delivery
++%% Function copied from ejabberd_c2s.erl
++is_privacy_allow(From, To, Packet, PrivacyList) ->
++ User = To#jid.user,
++ Server = To#jid.server,
++ allow == ejabberd_hooks:run_fold(
++ privacy_check_packet, Server,
++ allow,
++ [User,
++ Server,
++ PrivacyList,
++ {From, To, Packet},
++ in]).
++
+ route_message(From, To, Packet) ->
+ LUser = To#jid.luser,
+ LServer = To#jid.lserver,