Commit Graph

276 Commits

Author SHA1 Message Date
Andreas Köhler 7d93cad452 Before forwarding last activity requests to a user, check that the user's presence is visible for From
According to XEP-0012, 4. Online User Query, "if the requesting entity
is not authorized to view the user's presence information (normally via
a presence subscription as defined in XMPP IM), the user's server MUST
NOT deliver the IQ-get to an available resource but instead MUST return
a <forbidden/> error in response to the last activity request."

So check for a subscription of from of the jid and bare jid and whether
outgoing presences to From are allowed.

Fixes problem 3 of EJAB-1158.
2010-11-10 15:41:08 +01:00
Andreas Köhler 860d8525ee Remove dead code for NS_VCARD iq packets from ejabberd_c2s
For EJAB-1045, the special NS_VCARD block for handling incoming vcard
iqs on behalf of clients has already been restricted to cases where the
user or resource part of the recipient is empty. But then the packets
should not have been routed to the c2s process anyway. This patch
completely removes it.
2010-11-10 15:41:07 +01:00
Andreas Köhler 351635d0aa Use ejabberd_c2s:privacy_check_packet/5 for all those hook folded runs in the c2s module 2010-11-10 15:41:06 +01:00
Andreas Köhler 614f13714c Use c2s state data as user and server in ejabberd_c2s:is_privacy_allow
is_privacy_allow is only used in ejabberd_c2s:handle_info/3 to determine
for a few presence types whether the packet is allowed to be forwarded
to the user's client. This only makes sense if To#jid.user and
To#jid.server match StateData#state.user and StateData#state.server.

Also, add the atom in as parameter to a new argument Dir of
is_privacy_allow and extract from that function
privacy_check_packet(StateData, From, To, Packet, Dir) which runs the
privavcy check without converting allow/deny to true/false.
2010-11-10 15:41:05 +01:00
Evgeniy Khramtsov e4a1eb4370 Take care of xml:lang attribute in unauthenticated stanzas as well 2010-11-06 21:53:16 +01:00
Evgeniy Khramtsov 29fbe6d8e1 Do not store long language tag to avoid possible DoS/flood attacks 2010-11-06 21:53:13 +01:00
Badlop 81546f3270 Fix crash in ejabberd_c2s when blacklist hook returned true (thanks to Jonas Ådahl)
Cause of the crash jlib:ip_to_list/1 only supports IP tuples using the
form {N1,N2,N3,N4} which is not the case when IPv6 is enabled.
2010-11-02 14:04:10 +01:00
Badlop 16f0873488 Fix bug when routing error stanza 2010-10-16 22:51:51 +02:00
Badlop 17b4aaa1f7 When privacy list denies local user's outgoing stanza, try to return error (EJAB-1320)
See:
http://xmpp.org/extensions/xep-0016.html#example-51
Example 51. Error: contact is blocked
2010-10-16 22:51:50 +02:00
Badlop eddbad2c76 Check privacy of outgoing Message stanzas (EJAB-1320) 2010-10-16 22:51:48 +02:00
Pablo Polvorin ce9ce8293b Merge branch 'master' of git+ssh://git@gitorious.process-one.net/ejabberd/mainline 2010-10-12 10:57:07 -03:00
Badlop 82a8dc7b3a Cosmetic code changes to support emacs indentation 2010-10-07 17:38:18 +02:00
Badlop 89a98be605 Display priority, login time, pid and pid info in webadmin (EJAB-1300) 2010-09-13 17:49:55 +02:00
Pablo Polvorin 0d5f20cae1 Include roster pack patch from Geoff
Patch was already applied to 2.x branch, but not yet ported to master.
2010-09-10 15:32:19 -03:00
Badlop 8a5b08e3f0 New access option in mod_roster to disable changes (EJAB-72) 2010-07-30 13:21:58 +02:00
Badlop 59a19ca87a Don't offer SASL auth before doing TLS if TLS is required (thanks to Etan Reisner)
Originally reported in
http://yo.jabber.ru/bugzilla/show_bug.cgi?id=251

Implements:
http://tools.ietf.org/html/rfc3920#section-6.2
If Use of TLS (Section 5) needs to be
established before a particular authentication mechanism may be used, the
receiving entity MUST NOT provide that mechanism in the list of available SASL
authentication mechanisms prior to TLS negotiation.
2010-07-29 23:14:03 +02:00
Badlop 07e459d577 Various fixes (EJAB-831) 2010-07-23 01:23:37 +02:00
Badlop aa791ad0c4 Support SASL GSSAPI authentication (thanks to Mikael Magnusson)(EJAB-831) 2010-07-23 01:23:35 +02:00
Badlop cdb379a22c Patch core for MH (thanks to Alexey Shchepin and Geoff Cant) 2010-07-23 00:29:28 +02:00
Christophe Romain f36da63a3a Allow roster change from external component (TECH-1001) 2010-07-22 11:06:51 +02:00
Christophe Romain de6675a433 Added catches to reset_stream calls to avoid errors during a race condition (thanks to Aleksey Shchepin) 2010-07-13 22:13:38 +02:00
Badlop 67da88f0bd Improve ejabberd's broadcast stanzas to satisfy #xmlel type 2010-06-18 21:24:51 +02:00
Badlop be111b6749 More remove support for XEP-0018 (EJAB-810) 2010-06-18 21:24:51 +02:00
Badlop b6711e407e Remove support for the rejected XEP-0018 Invisible Presence (EJAB-810) 2010-06-17 22:43:15 +02:00
Evgeniy Khramtsov 2187bccc38 consistent hashing support. WARNING: update exmpp before running this 2010-06-03 00:01:36 +10:00
Badlop 41484213fd Use multicast in C2S presence broadcast (EJAB-267) 2010-05-20 00:03:05 +02:00
Badlop 110819525f Partially revert "Fix more HTTP-Bind", add proper fix: c2s works again, BOSH not yet 2010-05-10 13:56:58 +02:00
Evgeniy Khramtsov 92ec42565e full support for XEP-0115 v1.5 (EJAB-1223) (EJAB-1189) 2010-05-10 16:00:30 +10:00
Badlop 674ee7f5f6 Fix more HTTP-Bind; now works with exmpp bosh_client, but not others yet. 2010-05-05 19:59:57 +02:00
Badlop 9820880cd5 Automatic vcard avatar addition in presence (thanks to Igor Goryachev)(EJAB-208) 2010-04-27 12:33:38 +02:00
Pablo Polvorin fd990cf4d8 Allow customizing the StateData in p1_fsm before error reporting.
A new callback is introduced on the p1_fsm behaviour:

print_error/1

If the module implements this function, it will be invoked
in case of process crash with the current state data *before*
printing the error in the log. The function must return the
desired State to print.

It is used in ejabberd_c2s to prune the presence sets that
can be large. Instead, the state is changed to include only
the # of elements on each set.

Change inspired in comming changes to gen_server on OTP, and
b01d15abc3 (diff-0)
2010-03-30 16:44:39 -03:00
Evgeniy Khramtsov d11a715eda - pass jid into feature_check_packet hook;
- bounce messages when closing c2s session;
- implemented treap:to_list/1 and treap:from_list/1
2010-03-17 23:47:13 +09:00
Christophe Romain 7d97830ad7 mod_caps optimizations (thanks evgeniy) 2010-03-05 15:38:44 +01:00
Badlop 87beae3298 Run user_receive_packet also when sending offline messages to client (thanks to Brian Acton)(EJAB-1193) 2010-02-22 22:56:57 +01:00
Badlop 8539a7d7ea Close also legacy sessions that were half connected (thanks to Evgeniy Khramtsov)(EJAB-1165) 2010-02-16 12:44:43 +01:00
Evgeniy Khramtsov 95a3cc88cd fixes badly formed define
SVN Revision: 2943
2010-01-28 15:34:00 +00:00
Evgeniy Khramtsov c24af4ca63 new ejabberd_c2s option support: max_fsm_queue
SVN Revision: 2940
2010-01-28 13:46:44 +00:00
Evgeniy Khramtsov e31b2582b6 now using p1_fsm behaviour in c2s FSM (EJAB-1173)
SVN Revision: 2937
2010-01-28 13:11:14 +00:00
Badlop 4caac4a322 exmpp fixes in c2s, piefxis and mod_vcard_ldap (thanks to Karim Gemayel)
SVN Revision: 2930
2010-01-27 18:53:33 +00:00
Badlop 0495112aab Close sessions that were half connected (thanks to Alexey Shchepin)(EJAB-1165)
SVN Revision: 2912
2010-01-17 19:29:35 +00:00
Badlop a9fba750fa Improve functions calls when closing client connection.
SVN Revision: 2905
2010-01-15 12:02:15 +00:00
Badlop 1bcd481fdc Update year of ProcessOne copyright from 2009 to 2010 (EJAB-1159)
SVN Revision: 2892
2010-01-12 16:15:16 +00:00
Badlop 8c0cc95a55 When ejabberd stops, send stream close to clients (thanks to Alexey Shchepin)(EJAB-1112)
SVN Revision: 2859
2010-01-04 20:32:44 +00:00
Badlop 3da20486c1 Disable code of recent commit because some clients can't handle it (EJAB-1058)
SVN Revision: 2840
2009-12-29 18:44:48 +00:00
Badlop a7bd529dac Send features after negotiating binding and session (EJAB-1058)
SVN Revision: 2835
2009-12-28 20:10:18 +00:00
Badlop f7b5afec51 Don't handle internally an IQ vCard if destination is full JID (EJAB-1045)
SVN Revision: 2769
2009-12-01 20:02:00 +00:00
Badlop b989297725 Fix problem of authentication when using plain from SVN r2575 (EJAB-936)
SVN Revision: 2759
2009-11-24 21:40:50 +00:00
Badlop 733e84a4a8 Fix exmpp_stanza:get_sender return value.
SVN Revision: 2757
2009-11-24 11:56:26 +00:00
Badlop 095cd6ce9b BOSH module optimization and clean-up (thanks to Aleksey Shchepin and Mickaël Rémond)(EJAB-936)
Unfortunately, http-bind doesn't work in this branch,
neither in this commit or before it.

SVN Revision: 2575
2009-08-31 18:40:25 +00:00
Badlop f5eb9e3c9f Support zlib compression after STARTTLS (thanks to Aleksey Shchepin)(EJAB-499)
Unfortunately, zlib compression doesn't work in this branch,
neither in this commit or before it.

SVN Revision: 2572
2009-08-31 16:30:19 +00:00