Compare commits

...

155 Commits

Author SHA1 Message Date
Badlop 2feb929c55 Fix release date of ejabberd 2.0.2 to 28 August 2008
SVN Revision: 1557
2008-08-30 11:17:03 +00:00
Badlop b193ada44d * src/ejabberd.app: Fix version number to 2.0.2
SVN Revision: 1556
2008-08-30 11:13:06 +00:00
Christophe Romain 2cdb70556b fix 2.0.2 version
SVN Revision: 1555
2008-08-27 16:35:26 +00:00
Christophe Romain adaa3ffd2b tag for ejabberd-2.0.2 release
SVN Revision: 1554
2008-08-27 16:33:06 +00:00
Christophe Romain 55b586e51c send last published events now supports PEP events from unavailable users nodes (EJAB-698)
SVN Revision: 1549
2008-08-27 09:25:24 +00:00
Badlop 0b217097dd * doc/release_notes_2.0.2.txt: Update for final release
* doc/guide.tex: Windows binary installer requires MSVC++ 5
* doc/guide.html: Likewise

SVN Revision: 1548
2008-08-26 14:26:56 +00:00
Christophe Romain d5df314295 get_items bugfix (EJAB-716)
SVN Revision: 1541
2008-08-25 22:51:17 +00:00
Christophe Romain 28c34a844a Prevent case_clause error when ejabber_odbc:sql_query returns {error, Reason}
SVN Revision: 1539
2008-08-25 13:34:53 +00:00
Christophe Romain 3c88ab49f0 Prevent case_clause error when ejabber_odbc:sql_query returns {error, Reason}
SVN Revision: 1537
2008-08-25 13:11:25 +00:00
Badlop b338dd671f * src/ejabberd_check.erl: Detect correctly MSSQL and ODBC
configuration (EJAB-710)

SVN Revision: 1536
2008-08-25 12:08:22 +00:00
Geoff Cant 2cda62dceb EJAB-624: fixes mod_muc_room:is_visitor/2 to use get_role not get_affiliation
SVN Revision: 1535
2008-08-23 23:23:51 +00:00
Badlop 5d6fe1a055 * src/ejabberd_router.erl: Fix call to mnesia match_object
SVN Revision: 1533
2008-08-22 11:35:32 +00:00
Badlop 7ecbc0cd89 * doc/guide.tex: Fix names of chatroom to room, user to occupant
* doc/guide.html: Likewise

SVN Revision: 1532
2008-08-21 15:13:25 +00:00
Badlop 2f4db862f4 * src/mod_register.erl: Change password using mod_register always
returns success regardless of real result (EJAB-723)
* src/ejabberd_auth.erl: Likewise
* src/ejabberd_auth_external.erl: Likewise
* src/ejabberd_auth_internal.erl: Likewise
* src/ejabberd_auth_odbc.erl: Likewise

SVN Revision: 1530
2008-08-18 18:21:10 +00:00
Badlop 11f68cf7fd * src/msgs/sv.msg: Fixed formatting typos
SVN Revision: 1526
2008-08-16 12:06:13 +00:00
Badlop 5a05eb8d62 * src/gen_mod.erl: Export stop_module_keep_config/2 (EJAB-706)
SVN Revision: 1525
2008-08-16 12:03:21 +00:00
Badlop 79a0a44505 * doc/guide.tex: Explain that LDAP is read-only storage (thanks to
Evgeniy Khramtsov)
* doc/guide.html: Likewise

SVN Revision: 1521
2008-08-13 11:00:21 +00:00
Badlop 54842e7585 * src/msgs/sk.msg: Updated (thanks to Marek Becka)
SVN Revision: 1519
2008-08-11 00:48:57 +00:00
Badlop 76b19660e3 * src/msgs/eo.msg: Updated (thanks to Andreas van Cranenburgh)
* src/msgs/nl.msg: Updated (thanks to Andreas van Cranenburgh)
* src/msgs/sv.msg: Updated (thanks to Thore Alstromer and Heysan)

SVN Revision: 1518
2008-08-10 11:40:41 +00:00
Badlop 68ecc1f082 Retract from previous commit the code that checked the connection is attempted to a known served component (EJAB-717)
SVN Revision: 1517
2008-08-09 20:09:37 +00:00
Badlop 9147a1d2dd * src/ejabberd_service.erl: Fix XEP-0114 compliance: define xmlns
in header of error response; check the connection is attempted to
a served component; include in response the JID of served
component not server (thanks to Sergei Golovan)

SVN Revision: 1516
2008-08-09 18:08:00 +00:00
Badlop 469f1c43a6 * doc/release_notes_2.0.2.txt: Added for ejabberd 2.0.2-beta1
SVN Revision: 1503
2008-08-01 10:31:39 +00:00
Badlop 9dd66c241c * src/web/ejabberd_http.erl: Temporary solution for check of
packet size when HTTPS (EJAB-611)(EJAB-507)(EJAB-574)

SVN Revision: 1502
2008-08-01 08:50:19 +00:00
Badlop f5e489c764 * doc/guide.tex: Update Process-one name to ProcessOne (EJAB-708)
* doc/guide.html: Likewise
* doc/api/overview.edoc: Likewise
* src/*/*.erl: Likewise
* src/*/*.hrl: Likewise
* src/*/*.c: Likewise
* src/odbc/*.sql: Likewise

SVN Revision: 1499
2008-07-31 11:18:49 +00:00
Badlop 31b00c25c8 * src/mod_muc/mod_muc_room.erl: Support Reasons for all
affiliation and role changes (EJAB-306)

SVN Revision: 1498
2008-07-30 18:24:08 +00:00
Badlop 4f1fe31627 * src/gen_mod.erl: When ejabberd is kindly stopped, don't forget
modules configuration (EJAB-706)
* src/ejabberd_app.erl: Likewise

SVN Revision: 1497
2008-07-30 18:11:14 +00:00
Badlop d22154a2d4 * src/msgs/uk.msg: Fix: each string in a single line
* src/msgs/wa.msg: Likewise

* src/msgs/es.msg: Fix typo
* src/msgs/gl.msg: Likewise
* src/msgs/pt-br.msg: Likewise

* src/msgs/zh.msg: Fix some strings (thanks to Zhan Caibao)

SVN Revision: 1496
2008-07-30 14:09:36 +00:00
Badlop 751a8fbd37 * src/msgs/ca.msg: Updated (thanks to Badlop)
* src/msgs/cs.msg: Updated (thanks to Lukas Poliuvk)
* src/msgs/de.msg: Updated (thanks to Nikolaus Polak)
* src/msgs/es.msg: Updated (thanks to Badlop)
* src/msgs/fr.msg: Updated (thanks to Christophe Romain)
* src/msgs/it.msg: Updated (thanks to Luca Brivio)
* src/msgs/ja.msg: Updated (thanks to Tsukasa Hamano)
* src/msgs/no.msg: Updated (thanks to Stian B. Barmen)
* src/msgs/pl.msg: Updated (thanks to Zbyszek Zolkiewski)
* src/msgs/pt-br.msg: Updated (thanks to Otavio Fernandes)
* src/msgs/ru.msg: Updated (thanks to Evgeniy Khramtsov)
* src/msgs/tr.msg: Updated (thanks to Doruk Fisek)
* src/msgs/uk.msg: Updated (thanks to Ruslan Rakhmanin)
* src/msgs/wa.msg: Updated (thanks to Pablo Saratxaga)
* src/msgs/zh.msg: Updated (thanks to Shelley Shyan)

SVN Revision: 1495
2008-07-29 11:21:53 +00:00
Badlop 971165cb88 * doc/guide.tex: Document how to get error message when ejabberd
crash dumps at start (EJAB-660)
* doc/guide.html: Likewise

SVN Revision: 1494
2008-07-28 16:55:01 +00:00
Badlop 6ea15171f7 * src/mod_muc/mod_muc_room.erl: Add 'description' to the
mod_muc_room config record; it will be used in ejabberd 2.1.x
branch (EJAB-670)

SVN Revision: 1493
2008-07-28 16:15:51 +00:00
Christophe Romain 782ee63266 Speedup startup with many pubsub nodes (EJAB-669)
SVN Revision: 1490
2008-07-25 09:06:09 +00:00
Badlop d9f3c87899 * doc/guide.tex: Include example PAM configuration file
ejabberd.pam (thanks to Evgeniy Khramtsov)(EJAB-704)
* doc/guide.html: Likewise

SVN Revision: 1489
2008-07-24 18:21:40 +00:00
Badlop 2d5fdbab64 * src/mod_proxy65/mod_proxy65_lib.erl: Send protocol compliant
SOCKS5 reply; this breaks support of uncompliant Psi<0.10 (thanks
to Felix Geyer)(EJAB-632)
* src/mod_proxy65/mod_proxy65_stream.erl: Likewise

SVN Revision: 1488
2008-07-24 18:03:28 +00:00
Badlop f841acb21f * src/mod_register.erl: When a registration is blocked due to IP
limitation, return description in error stanza (EJAB-692)

SVN Revision: 1487
2008-07-24 17:49:37 +00:00
Christophe Romain 71e87aef6e allow owner to subscribe/get its one node (EJAB-705)
SVN Revision: 1485
2008-07-24 14:06:28 +00:00
Badlop df21b2d48c * src/Makefile.in: Support for parallel compilation with 'make -j'
in multi core CPUs: fix compilation dependencies; compile
behaviors before other source code (EJAB-697)(thanks to Jonathan
Schleifer)
* src/mod_pubsub/Makefile.in: Likewise
* src/eldap/Makefile.in: Likewise

SVN Revision: 1484
2008-07-24 11:53:00 +00:00
Badlop 35f520e3d9 * doc/guide.tex: Document room options allow_visitor_nickchange
and allow_visitor_status (EJAB-624)
* doc/guide.html: Likewise

SVN Revision: 1483
2008-07-24 11:22:43 +00:00
Geoff Cant 318823fe68 Altering XForms text for allow_visitor_status mod_muc_room option. (EJAB-624)
SVN Revision: 1481
2008-07-23 17:45:39 +00:00
Geoff Cant 102281194f Remove allow_visitor_presence, add allow_visitor_status [merge from trunk@1477-1478] (EJAB-624)
SVN Revision: 1479
2008-07-23 16:58:52 +00:00
Geoff Cant 6768a21d36 Implementing muc_room visitor presence restrictions. [merge from trunk@1475] (EJAB-624)
SVN Revision: 1476
2008-07-23 13:03:30 +00:00
Christophe Romain 895e104b6a subscribing to a node sends only last items (EJAB-700), send_last_items bugfix
SVN Revision: 1473
2008-07-23 01:13:36 +00:00
Christophe Romain c6090dd8ca pubsub improvement, fixes EJAB-684 EJAB-675 EJAB-663
SVN Revision: 1471
2008-07-22 23:41:40 +00:00
Badlop 293676d2a6 * src/ejabberd_config.erl: If syntax mistake in config file, show
specific error message (EJAB-616)

SVN Revision: 1470
2008-07-22 16:08:57 +00:00
Badlop 4ebaf3efa0 * src/mod_muc/mod_muc_room.erl: Fix to allow a server admin to add
himself as owner of a room (EJAB-687)

SVN Revision: 1460
2008-07-17 17:32:11 +00:00
Badlop 82e8b16a39 * src/Makefile.in: ejabberctl doesn't use the erl found by the
configure script (EJAB-676)
* src/ejabberdctl.template: Likewise

SVN Revision: 1459
2008-07-17 17:13:01 +00:00
Christophe Romain fc2ea76a45 use -DSSL39 if compiling with R12
SVN Revision: 1455
2008-07-16 22:23:58 +00:00
Badlop ae939c5f80 * src/ejabberd_c2s.erl: Put auth_module in Info always (EJAB-549)
SVN Revision: 1454
2008-07-16 18:05:46 +00:00
Christophe Romain 745106c83d Rolled back the previous IP getting patch, and Report connection's IP address
SVN Revision: 1452
2008-07-16 13:30:37 +00:00
Christophe Romain 546bb02153 Rolled back the previous IP getting patch, and Report connection's IP address
SVN Revision: 1451
2008-07-16 13:29:57 +00:00
Badlop 663f6f76a7 * doc/guide.tex: Improve explanation of option 'hosts' in
ejabberd_service
* doc/guide.html: Likewise

SVN Revision: 1448
2008-07-16 10:21:45 +00:00
Badlop b1ca88a5eb * src/configure.ac: Improve legibility
* src/aclocal.m4: Likewise
* src/configure: Likewise

* src/ejabberdctl.template: Remove garbage variable. Document node
option

* doc/guide.tex: Add references to sections.
* doc/guide.html: Likewise

SVN Revision: 1438
2008-07-12 21:32:45 +00:00
Badlop cdcc3a2520 * doc/guide.tex: Document how to insert a newline character in
welcome_message (EJAB-501)
* src/ejabberd.cfg.example: Likewise

SVN Revision: 1437
2008-07-11 13:47:15 +00:00
Christophe Romain 3c90d7c2b9 change needed to support previous blacklist support
SVN Revision: 1432
2008-07-11 07:13:41 +00:00
Christophe Romain bc18e89d61 Backport C2S blacklist support from trunk
SVN Revision: 1431
2008-07-11 06:59:45 +00:00
Badlop e956ca4fe3 * src/configure.ac: Don't check for erlang header file (EJAB-232)
* src/configure: Likewise

SVN Revision: 1430
2008-07-10 18:09:18 +00:00
Badlop 53c994825c * src/configure.ac: Check for erlang header files (EJAB-232)
* src/configure: Likewise

SVN Revision: 1429
2008-07-09 21:33:34 +00:00
Badlop 085d979037 * src/mod_pubsub/mod_pubsub.erl: Fix compilation warnings
* src/mod_pubsub/node_zoo.erl: Likewise
* src/mod_shared_roster.erl: Likewise

SVN Revision: 1428
2008-07-09 21:26:25 +00:00
Badlop 49b02c0a9f * src/mod_muc/mod_muc_log.erl: Fix XHTML compliance: ensure some
language is set, include ID attribute in each message, add
microseconds to ensure unique value (EJAB-497)

SVN Revision: 1426
2008-07-09 18:39:41 +00:00
Badlop d8405b694e * src/ejabberd_config.erl (load_file): error message on sasl.log
is not flattened (EJAB-616)

SVN Revision: 1424
2008-07-09 16:08:32 +00:00
Badlop 95bd9068f7 * doc/guide.tex: mod_muc_log XMPP URI supports the updated version
RFC 5122 (EJAB-631)
* doc/guide.html: Likewise

SVN Revision: 1423
2008-07-09 14:07:27 +00:00
Badlop 407d3b77b7 * tools/ejabberdctl: Work also when 'which' is unavailable
SVN Revision: 1419
2008-07-08 11:07:45 +00:00
Christophe Romain 3dfcc4c4d3 typo fix
SVN Revision: 1417
2008-07-08 10:31:29 +00:00
Christophe Romain 1de6329c41 typo on date fix
SVN Revision: 1415
2008-07-08 10:18:54 +00:00
Christophe Romain 8047ff0617 improve ip fetching patch
SVN Revision: 1414
2008-07-08 10:17:50 +00:00
Badlop 8032533f26 * src/Makefile.in: Spool, config and log dirs: writtable by owner,
readable by group, nothing by others (EJAB-686)
* doc/guide.tex: New section Securing sensible files
* doc/guide.html: Likewise

SVN Revision: 1413
2008-07-07 14:52:47 +00:00
Badlop 00c3bc2450 * doc/guide.tex: Solaris Makefile install: use ginstall (thanks to
Jonathan Auer)(EJAB-649)
* doc/guide.html: Likewise

SVN Revision: 1412
2008-07-07 08:47:47 +00:00
Jérôme Sautret c76a009238 Removed non ascii characters in changelog
SVN Revision: 1411
2008-07-04 08:35:11 +00:00
Jérôme Sautret 8012133539 * src/mod_privacy_odbc.erl: Support for privacy lists in MySQL (thanks to Igor Goryachev)(EJAB-538)(merge r1409 from trunk)
SVN Revision: 1410
2008-07-03 16:20:47 +00:00
Christophe Romain 1e56a614f9 PubSub improvements, and solves (EJAB-453) (EJAB-608)
SVN Revision: 1407
2008-07-03 09:56:21 +00:00
Badlop 971c9ce5a5 * src/ejabberd_ctl.erl: Web Admin and Ad-hoc admin: dump only
persistent tables (EJAB-678)

SVN Revision: 1387
2008-06-29 11:59:06 +00:00
Badlop 7abfd51534 * src/mod_pubsub/node_pep.erl: Complain if mod_caps disabled and
mod_pubsub has PEP plugin enabled (EJAB-677)

SVN Revision: 1386
2008-06-29 11:34:30 +00:00
Badlop 7e86698606 * src/web/ejabberd_http.erl: Support PUT and DELETE methods in
ejabberd_http (thanks to Eric Cestari)(EJAB-662)

SVN Revision: 1373
2008-06-21 00:19:57 +00:00
Badlop 45ccda9961 * doc/guide.tex: Explain that S2S outgoing first tries IPv4 and if
that fails then tries IPv6
* doc/guide.html: Likewise

SVN Revision: 1372
2008-06-21 00:12:06 +00:00
Christophe Romain 2c9d424330 allow get_default on PEP nodes (EJAB-656)
SVN Revision: 1363
2008-06-19 09:08:30 +00:00
Badlop 541f381145 * src/ejabberd.app: The ejabberd version number is defined in the
OTP application resource file, in the key 'vsn' (EJAB-657)
* src/ejabberd.hrl: The macro VERSION now consults the ejabberd
application key vsn
* src/configure.erl: Load the ejabberd application description
* doc/Makefile: Read ejabberd version from ejabberd.app vsn
* doc/api/Makefile: Likewise

SVN Revision: 1361
2008-06-18 21:33:48 +00:00
Christophe Romain a7cd412a76 temporary roster_groups_allowed fix (EJAB-655)
SVN Revision: 1360
2008-06-18 16:35:17 +00:00
Christophe Romain ab310255d7 pubsub get_default bugfix (EJAB-656)
SVN Revision: 1357
2008-06-18 16:19:15 +00:00
Badlop d9241c9e75 * src/ejabberd.cfg.example: Add registration_timeout (EJAB-653)
SVN Revision: 1355
2008-06-13 17:51:01 +00:00
Badlop bc8294990a * doc/guide.tex: Title in HTML is shorter. Update several external URIs.
SVN Revision: 1354
2008-06-13 15:25:57 +00:00
Badlop 25d8e53735 * doc/guide.tex: Document ldap_local_filter (EJAB-179)
SVN Revision: 1353
2008-06-13 10:13:44 +00:00
Badlop f59c0c9eb2 * doc/guide.tex: Table of listener modules converted to
description. Table of modules overview simplified, and module
names link to their sections.
* doc/guide.html: Regenerated with all the latest changes

SVN Revision: 1352
2008-06-12 23:52:13 +00:00
Badlop aaae1339e1 * doc/guide.tex: Fix indentation of verbatim text
SVN Revision: 1351
2008-06-12 23:01:09 +00:00
Badlop 38d218c129 * doc/guide.tex:
Changes in CSS: verbatim text is indented and has grey background;
descriptions are indented; table borders are softer.

SVN Revision: 1350
2008-06-12 22:00:51 +00:00
Badlop c67eaeb534 * doc/guide.tex: Permanent reference URL for sections (EJAB-651)
SVN Revision: 1349
2008-06-12 21:54:30 +00:00
Badlop 8a140dd509 * doc/guide.tex: Small fixes (thanks to Christoph Anton Mitterer)
* doc/introduction.tex: Likewise
* doc/guide.html: Likewise

SVN Revision: 1347
2008-06-08 16:52:25 +00:00
Badlop 6924b4c3e8 * doc/guide.tex: Document ejabberdctl status code (EJAB-633)
* doc/guide.html: Likewise

SVN Revision: 1346
2008-06-05 12:04:43 +00:00
Badlop 73f40db258 * src/msgs/pl.msg: Bugfix in arguments of translated string that
could crash the room (thanks to Anastasia Gornostaeva)

SVN Revision: 1345
2008-06-04 13:21:36 +00:00
Badlop 56740871f1 * src/web/ejabberd_web.erl (make_xhtml/2): Allow to include
elements in the HTTP header

SVN Revision: 1344
2008-05-31 18:21:43 +00:00
Badlop 6c9eb98792 * src/odbc/odbc_queries.erl (del_user_return_password): Return
password (thanks to Oleg Palij)

SVN Revision: 1343
2008-05-31 17:09:13 +00:00
Badlop 50b133f6a2 * README: R12 support: remove compilation warning (EJAB-630)
SVN Revision: 1340
2008-05-22 00:01:18 +00:00
Badlop fef60fe1d3 Retract the changes that SVN commit 1326 made in branches/ejabberd-2.0.x
SVN Revision: 1339
2008-05-20 16:23:43 +00:00
Christophe Romain 31940f16c7 add release_notes_2.0.1
SVN Revision: 1338
2008-05-19 22:35:01 +00:00
Badlop 45c1bad6d8 * doc/guide.html: Updated
* doc/dev.html: Likewise
* doc/features.html: Likewise
* doc/version.tex: Likewise

* src/ejabberd.hrl: Version is 2.0.x

SVN Revision: 1336
2008-05-19 09:46:42 +00:00
Badlop 6916d7b552 * src/configure.ac: R12 support: remove compilation
warning (EJAB-630)
* src/configure: Likewise
* doc/guide.tex: Likewise

SVN Revision: 1334
2008-05-19 09:20:35 +00:00
Badlop 39e93fcbbf * doc/guide.tex: Describe how to disable registration
limitation (EJAB-614)

SVN Revision: 1333
2008-05-19 09:13:19 +00:00
Christophe Romain 7461cb5f72 Change FSMTIMEOUT to 30s
SVN Revision: 1327
2008-05-16 15:28:23 +00:00
Christophe Romain 8e069daa61 fixing 1324 commit issue on tagged versions
SVN Revision: 1326
2008-05-16 14:23:37 +00:00
Christophe Romain 8041c033a9 Don't activate a socket untill its receiver process is controlling it
SVN Revision: 1325
2008-05-16 12:56:24 +00:00
Badlop ca8c659804 * src/mod_muc/mod_muc_room.erl: Return Forbidden error message
when user sends private message in a room that disallows
it (EJAB-595)

SVN Revision: 1323
2008-05-12 20:35:43 +00:00
Badlop a96cf33df3 * src/web/ejabberd_http.erl (parse_auth): Allow password that
include colon character (EJAB-522)

SVN Revision: 1322
2008-05-12 17:56:27 +00:00
Christophe Romain d75577fa34 change contribs to trunk
SVN Revision: 1314
2008-05-01 22:37:56 +00:00
Christophe Romain 2f62e78c06 XEP-0115 patch (EJAB-618)
SVN Revision: 1312
2008-04-30 08:49:19 +00:00
Badlop fdae05c27d * src/ejabberd_s2s_out.erl: Improve confusing log message in s2s
connection: wait_for_validation connect timeout (EJAB-617)

SVN Revision: 1311
2008-04-29 16:59:03 +00:00
Badlop 58da3e4e99 * src/ejabberd.cfg.example: Small improvements in explanations
* doc/guide.tex: Document MUC room options (EJAB-619)

SVN Revision: 1310
2008-04-29 16:44:12 +00:00
Badlop 2c795957ac Merge changeset 1305 from ejabberd trunk.
2008-04-27  Alexey Shchepin  <alexey@process-one.net>

* src/mod_muc/mod_muc_room.erl: Fixed room shaper processing

SVN Revision: 1309
2008-04-28 18:44:28 +00:00
Badlop 6e5aaadf57 Merge changesets 1299, 1300 and 1302 from ejabberd trunk.
2008-04-26  Badlop  <badlop@process-one.net>

* doc/guide.tex: Document option registration_timeout (EJAB-614)

2008-04-23  Alexey Shchepin  <alexey@process-one.net>

* src/treap.erl: Bugfix

* src/mod_register.erl: Fixed table creation, timeout isn't
activated when registration fails

* src/mod_register.erl: Restrict registration frequency per IP or
user (EJAB-614)
* src/ejabberd_c2s.erl: Pass IP to the c2s_unauthenticated_iq hook
* src/ejabberd_config.erl: Added registration_timeout option

* src/treap.erl: Treaps implementation

SVN Revision: 1308
2008-04-28 18:41:13 +00:00
Badlop 0f4244a72c * doc/guide.tex: Document the option max_s2s_connections
SVN Revision: 1307
2008-04-28 18:07:23 +00:00
Badlop e9e52374f8 * src/mod_shared_roster.erl: Fix for new registered accounts not
being immediately shown in an 'all' special shared roster
group (thanks to Alexey Shchepin) (EJAB-71)
* src/mod_register.erl: New vhost event user_registered

SVN Revision: 1304
2008-04-26 17:54:57 +00:00
Badlop 62ed66e195 * src/ejabberd_auth.erl: Improve anonymous authentication to not
remove rosters accidentally (EJAB-549). New functions in
ejabberd_auth to get/check password and know which module accepted
the authentication. New element 'auth_module' in ejabberd_c2s
record 'statedata'. Cyrsasl provides a new property in the
response: {auth_module, AuthModule}.
* src/ejabberd_auth_anonymous.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/cyrsasl_anonymous.erl: Likewise
* src/cyrsasl_digest.erl: Likewise
* src/cyrsasl_plain.erl: Likewise

SVN Revision: 1298
2008-04-22 18:56:29 +00:00
Badlop 2e12fd2b11 * src/ejabberd_s2s_out.erl: Fix long timeout when reconnecting s2s
after a remote server crash (EJAB-540)
* src/ejabberd_s2s_in.erl: Likewise
* src/ejabberd_s2s.erl: Likewise
* doc/guide.tex: Likewise

SVN Revision: 1296
2008-04-18 12:19:45 +00:00
Badlop 8d23ef3ed0 * doc/guide.tex: Clarification: PEP is enabled in default config
SVN Revision: 1295
2008-04-16 15:44:58 +00:00
Christophe Romain bd9d2cb97c Cache negative response (EJAB-474)
SVN Revision: 1293
2008-04-14 12:00:37 +00:00
Badlop bb5e7353a4 Merge SVN r1287 from trunk to 2.0.x branch:
* src/tls/tls_drv.c: Fixed gcc signedness warnings (EJAB-447)
* src/ejabberd_zlib/ejabberd_zlib_drv.c: Likewise

* src/expat_erl.c: Removed R9B workaround (EJAB-447)

SVN Revision: 1289
2008-04-11 09:25:54 +00:00
Christophe Romain cfeb6f9c2b pubsub identity and database update bugfix
SVN Revision: 1284
2008-04-10 14:08:35 +00:00
Mickaël Rémond 0623a04666 *src/ejabberd_c2s.erl: Uniform default value for empty privacy list. Fixes (EJAB-603).
SVN Revision: 1283
2008-04-10 09:53:07 +00:00
Badlop 397fbf5b73 * src/ejabberd_auth_ldap.erl: LDAP function to get the number of
registered users is too slow (EJAB-331): set timeout in LDAP
search queries (thanks to Evgeniy Khramtsov) and return the number
of registered users.

SVN Revision: 1280
2008-04-08 09:37:06 +00:00
Mickaël Rémond 6f205d2d2a * doc/guide.tex: Documented the IQ discipline {queue, N}.
SVN Revision: 1279
2008-04-07 13:27:03 +00:00
Badlop e8dd27d3fc * doc/guide.tex: Fix default_room_opts with default_room_options
* doc/guide.html: Likewise

SVN Revision: 1277
2008-04-05 10:53:32 +00:00
Badlop 73f061c02c * src/ejabberd_auth_ldap.erl (get_vh_registered_users_number): New
function that returns 0 registered users (EJAB-331).

SVN Revision: 1276
2008-04-04 18:57:01 +00:00
Badlop 6f19f7ebbb * src/ejabberd_c2s.erl (process_presence_probe): Don't route a
presence probe to oneself (EJAB-498)

SVN Revision: 1275
2008-04-03 22:35:26 +00:00
Christophe Romain 615dc9ff94 Do not ignore values passed from configure (EJAB-592)
SVN Revision: 1271
2008-04-02 14:24:00 +00:00
Christophe Romain cd26cb4ad6 clone iq_response table bugfix
SVN Revision: 1270
2008-04-02 12:18:22 +00:00
Christophe Romain 22b66e40e0 add condition inclusion of pep in disco identity (EJAB-564)
SVN Revision: 1269
2008-04-02 09:06:34 +00:00
Badlop 3f33ff0adf * doc/webadmmain.png: Updated to ejabberd 2.0.0
* doc/webadmmainru.png: Likewise

* doc/disco.png: Removed because not used

* doc/guide.tex: Fix Latex reference to webadmin section. Update
explanation of screenshots. Update xmpp addresses of Mickael
Remond and Sander Devrieze.
* doc/guide.html: Likewise

* doc/Makefile: Remove the Hevea deprecated option -noiso
* doc/guide.html: Likewise
* doc/dev.html: Likewise
* doc/features.html: Likewise

SVN Revision: 1262
2008-03-31 10:48:10 +00:00
Badlop fcb5788568 * doc/guide.tex: Fix epam location (thanks to Evgeniy Khramtsov)
* doc/guide.html: Likewise

SVN Revision: 1259
2008-03-27 00:28:44 +00:00
Badlop f404bac82a * src/Makefile.in: Only try to install epam if pam was enabled
in configure script (thanks to Etan Reisner)(EJAB-586)

SVN Revision: 1256
2008-03-25 18:59:45 +00:00
Badlop 7dcd189e27 * src/Makefile.in: Failure to install epam is not
critical (EJAB-573)

SVN Revision: 1255
2008-03-25 17:18:47 +00:00
Badlop 9c11783e05 * doc/guide.tex: mod_vcard_ldap replace NICK with NICKNAME (thanks
to Andreas Ntaflos)
* doc/guide.html: Likewise

SVN Revision: 1254
2008-03-24 18:57:41 +00:00
Badlop c74e7e8a17 * src/msgs/de.msg: Fix irc typo (thanks to Jonathan Schleifer)
* src/msgs/cs.msg: Likewise
* src/msgs/pl.msg: Likewise
* src/msgs/sk.msg: Likewise

SVN Revision: 1253
2008-03-24 01:28:55 +00:00
Mickaël Rémond 635565ecf3 * src/eldap/Makefile.in: Generate ELDAPv3.beam during first Makefile pass (EJAB-583).
SVN Revision: 1250
2008-03-22 16:44:23 +00:00
Badlop c25f960220 * doc/guide.tex: Document service_check_from (EJAB-576)
* doc/guide.html: Likewise

SVN Revision: 1248
2008-03-22 00:33:28 +00:00
Badlop 6aa2f740f4 * src/mod_caps.erl: Move two log calls ERROR_MSG to DEBUG
* src/shaper.erl: Move log call INFO_MSG to DEBUG

SVN Revision: 1247
2008-03-21 18:58:07 +00:00
Badlop 20ebe81384 * doc/guide.tex: Document s2s_default_policy and
s2s_host (EJAB-575)
* doc/guide.html: Likewise

SVN Revision: 1246
2008-03-21 16:17:37 +00:00
Christophe Romain 9e60b2b0a6 Pubsub subscription is now wrapped in pubsub tags (EJAB-580)
SVN Revision: 1245
2008-03-21 16:05:42 +00:00
Christophe Romain 01b4b77373 includes Makefile.in changes to EJAB-573
SVN Revision: 1242
2008-03-21 15:41:51 +00:00
Christophe Romain 6d7b71f13c Seek epam binary into priv/bin (EJAB-573)
SVN Revision: 1241
2008-03-21 15:35:40 +00:00
Christophe Romain dc37faf587 Rewrite io:format calls to loglevel macros (EJAB-555) so we do not loose debug anymore in detached nodes
SVN Revision: 1240
2008-03-21 15:00:59 +00:00
Badlop bc2f42132f * doc/guide.tex: Improve explanation of how to start ejabberd when
binary installer. Don't recommend R12 in Windows compilation.
Describe what happens if maxrate shaper is exceeded.
* doc/guide.html: Likewise

SVN Revision: 1238
2008-03-20 19:24:27 +00:00
Mickaël Rémond da5f069dd2 * src/eldap.erl: Improved logging. We now use ejabberd logging framework (EJAB-582).
* src/eldap.erl: Faster LDAP reconnection (Thanks to Christophe Romain) (EJAB-581)

SVN Revision: 1237
2008-03-20 16:38:29 +00:00
Mickaël Rémond 1a616a91ef * src/ejabberd_s2s.erl: API improvement: Added s2s_connect_hook (EJAB-566).
SVN Revision: 1233
2008-03-15 09:39:10 +00:00
Badlop c086292651 * src/odbc/ejabberd_odbc.erl: Start ODBC explicitely because
Erlang R12 doesn't start automatically like in R11 and
older (thanks to Sergei Golovan)(EJAB-541)

SVN Revision: 1231
2008-03-13 14:34:47 +00:00
Badlop c62a0562a1 * src/ejabberd.hrl: Removed unused ejabberd_debug and
PRIVACY_SUPPORT. Reordered the remaining options

SVN Revision: 1230
2008-03-13 14:13:29 +00:00
Badlop ffb1f97cf4 * doc/guide.tex: Describe option Matches in mod_vcard_ldap (thanks
to Evgeniy Khramtsov)(EJAB-530).  Fix typo in the description of
ldap_server option.
* doc/guide.html: Likewise

SVN Revision: 1229
2008-03-13 10:59:57 +00:00
Badlop 17e751521f * src/mod_echo.erl: Small change to avoid a compilation warning of
unused function

SVN Revision: 1228
2008-03-12 23:05:49 +00:00
Badlop 4be522ed0c * src/web/ejabberd_web_admin.erl (term_to_string): Show Erlang
terms in one line in Erlang R12 (EJAB-503)

SVN Revision: 1227
2008-03-12 22:29:53 +00:00
Badlop c4e89879bb * src/ejabberd_s2s_in.erl (get_cert_domains): When compiling with
Erlang R12, replace the calls to deprecated module PKIX1Explicit88
with OTP-PKIX (EJAB-556)

SVN Revision: 1226
2008-03-11 14:25:35 +00:00
Badlop 1643999c35 * src/ejabberd_update.erl: Fix crash when browsing the Update
page in Erlang R12 (EJAB-552)

SVN Revision: 1225
2008-03-10 11:59:53 +00:00
Badlop 5351f56ae1 * src/mod_proxy65/mod_proxy65_service.erl: Implement alternative
to the deprecated function inet:ip_to_bytes (thanks to Evgeniy
Khramtsov)(EJAB-542)

SVN Revision: 1222
2008-03-09 10:09:38 +00:00
Badlop c6f57c13da * doc/guide.tex: Improve documentation of host_config
add (EJAB-544)
* doc/guide.html: Likewise
* src/ejabberd.cfg.example: Likewise
* src/ejabberd_config.erl: Likewise

SVN Revision: 1219
2008-03-04 10:36:57 +00:00
Badlop a6e65dd5a9 * doc/guide.tex: mod_announce recommends, but doesn't require
mod_adhoc (thanks to Anastasia Gornostaeva)
* doc/guide.html: Likewise
* src/ejabberd.cfg.example: Likewise

SVN Revision: 1218
2008-03-04 09:07:43 +00:00
Mickaël Rémond 739a504bd5 * src/ejabberd_check.erl: Fixed missing clause (EJAB-533).
SVN Revision: 1216
2008-02-29 12:23:06 +00:00
Mickaël Rémond 45074f5349 * src/mod_roster.erl: Fixed "from" attribute in roster pushes
* src/mod_roster_odbc.erl: Likewise

SVN Revision: 1214
2008-02-29 07:54:24 +00:00
Badlop 4ee0f6a5ee * src/ejabberd_app.erl (prep_stop): Stop modules when stopping
ejabberd (EJAB-536)
* src/mod_caps.erl (stop): Probably not needed to stop supervisor
child (EJAB-536)
* src/mod_muc/mod_muc.erl (room_destroyed): Catch message
sending (EJAB-536)
* src/mod_muc/mod_muc_room.erl (init): Ensure rooms are called
when the process dies due to a linked die (EJAB-536)

SVN Revision: 1212
2008-02-28 00:30:23 +00:00
Mickaël Rémond 5171a8caec * src/ejabberd_check.erl: Separate config loading from configuration sanity checks (EJAB-533)
* src/src/ejabberd_app.erl: Likewise
* src/ejabberd_app.erl: Likewise

SVN Revision: 1211
2008-02-27 20:20:30 +00:00
Badlop 2e8e970395 * src/msgs/it.msg: Updated (thanks to Smart2128)
SVN Revision: 1209
2008-02-26 08:59:09 +00:00
193 changed files with 6253 additions and 3643 deletions
+779 -3
View File
@@ -1,3 +1,779 @@
2008-08-30 Badlop <badlop@process-one.net>
* src/ejabberd.app: Fix version number to 2.0.2
2008-08-27 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: send last published events now supports
PEP events from unavailable users nodes (EJAB-698)
* src/ejabberd_c2s.erl: Likewise
2008-08-26 Badlop <badlop@process-one.net>
* doc/release_notes_2.0.2.txt: Update for final release
* doc/guide.tex: Windows binary installer requires MSVC++ 5
* doc/guide.html: Likewise
2008-08-26 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: get_items bugfix (EJAB-716)
2008-08-25 Christophe Romain <christophe.romain@process-one.net>
* src/mod_privacy_odbc.erl: Prevent case_clause error when
ejabber_odbc:sql_query returns {error, Reason}
* src/mod_vcard_odbc.erl: Likewise
* src/mod_last_odbc.erl: Likewise
* src/mod_offline_odbc.erl: Likewise
2008-08-25 Badlop <badlop@process-one.net>
* src/ejabberd_check.erl: Detect correctly MSSQL and ODBC
configuration (EJAB-710)
2008-08-24 Geoff Cant <gcant@process-one.net>
* src/mod_mud/mod_muc_room.erl: is_visitor/2 fix - use get_role
not get_affiliation
2008-08-22 Badlop <badlop@process-one.net>
* src/ejabberd_router.erl: Fix call to mnesia match_object
2008-08-21 Badlop <badlop@process-one.net>
* doc/guide.tex: Fix names of chatroom to room, user to occupant
* doc/guide.html: Likewise
2008-08-18 Badlop <badlop@process-one.net>
* src/mod_register.erl: Change password using mod_register always
returns success regardless of real result (EJAB-723)
* src/ejabberd_auth.erl: Likewise
* src/ejabberd_auth_external.erl: Likewise
* src/ejabberd_auth_internal.erl: Likewise
* src/ejabberd_auth_odbc.erl: Likewise
2008-08-16 Badlop <badlop@process-one.net>
* src/msgs/sv.msg: Fixed formatting typos
* src/gen_mod.erl: Export stop_module_keep_config/2 (EJAB-706)
2008-08-13 Badlop <badlop@process-one.net>
* doc/guide.tex: Explain that LDAP is read-only storage (thanks to
Evgeniy Khramtsov)
* doc/guide.html: Likewise
2008-08-10 Badlop <badlop@process-one.net>
* src/msgs/eo.msg: Updated (thanks to Andreas van Cranenburgh)
* src/msgs/nl.msg: Updated (thanks to Andreas van Cranenburgh)
* src/msgs/sk.msg: Updated (thanks to Marek Becka)
* src/msgs/sv.msg: Updated (thanks to Thore Alstromer and Heysan)
2008-08-09 Badlop <badlop@process-one.net>
* src/ejabberd_service.erl: Fix XEP-0114 compliance: define xmlns
in header of error response; include in response the JID of served
component not server (thanks to Sergei Golovan)(EJAB-717)
2008-08-01 Badlop <badlop@process-one.net>
* doc/release_notes_2.0.2.txt: Added for ejabberd 2.0.2-beta1
* src/web/ejabberd_http.erl: Temporary solution for check of
packet size when HTTPS (EJAB-611)(EJAB-507)(EJAB-574)
2008-07-31 Badlop <badlop@process-one.net>
* doc/guide.tex: Update Process-one name to ProcessOne (EJAB-708)
* doc/guide.html: Likewise
* doc/api/overview.edoc: Likewise
* src/*/*.erl: Likewise
* src/*/*.hrl: Likewise
* src/*/*.c: Likewise
* src/odbc/*.sql: Likewise
2008-07-30 Badlop <badlop@process-one.net>
* src/mod_muc/mod_muc_room.erl: Support Reasons for all
affiliation and role changes (EJAB-306)
* src/gen_mod.erl: When ejabberd is kindly stopped, don't forget
modules configuration (EJAB-706)
* src/ejabberd_app.erl: Likewise
* src/msgs/uk.msg: Fix: each string in a single line
* src/msgs/wa.msg: Likewise
* src/msgs/es.msg: Fix typo
* src/msgs/gl.msg: Likewise
* src/msgs/pt-br.msg: Likewise
* src/msgs/zh.msg: Fix some translations (thanks to Zhan Caibao)
2008-07-29 Badlop <badlop@process-one.net>
* src/msgs/ca.msg: Updated (thanks to Badlop)
* src/msgs/cs.msg: Updated (thanks to Lukas Poliuvk)
* src/msgs/de.msg: Updated (thanks to Nikolaus Polak)
* src/msgs/es.msg: Updated (thanks to Badlop)
* src/msgs/fr.msg: Updated (thanks to Christophe Romain)
* src/msgs/it.msg: Updated (thanks to Luca Brivio)
* src/msgs/ja.msg: Updated (thanks to Tsukasa Hamano)
* src/msgs/no.msg: Updated (thanks to Stian B. Barmen)
* src/msgs/pl.msg: Updated (thanks to Zbyszek Zolkiewski)
* src/msgs/pt-br.msg: Updated (thanks to Otavio Fernandes)
* src/msgs/ru.msg: Updated (thanks to Evgeniy Khramtsov)
* src/msgs/tr.msg: Updated (thanks to Doruk Fisek)
* src/msgs/uk.msg: Updated (thanks to Ruslan Rakhmanin)
* src/msgs/wa.msg: Updated (thanks to Pablo Saratxaga)
* src/msgs/zh.msg: Updated (thanks to Shelley Shyan)
2008-07-28 Badlop <badlop@process-one.net>
* doc/guide.tex: Document how to get error message when ejabberd
crash dumps at start (EJAB-660)
* doc/guide.html: Likewise
* src/mod_muc/mod_muc_room.erl: Add 'description' to the
mod_muc_room config record; it will be used in ejabberd 2.1.x
branch (EJAB-670)
2008-07-25 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Speedup startup with many pubsub
nodes (EJAB-669)
* src/mod_pubsub/nodetree_default.erl: Likewise
2008-07-24 Badlop <badlop@process-one.net>
* doc/guide.tex: Include example PAM configuration file
ejabberd.pam (thanks to Evgeniy Khramtsov)(EJAB-704)
* doc/guide.html: Likewise
* src/mod_proxy65/mod_proxy65_lib.erl: Send protocol compliant
SOCKS5 reply; this breaks support of uncompliant Psi<0.10 (thanks
to Felix Geyer)(EJAB-632)
* src/mod_proxy65/mod_proxy65_stream.erl: Likewise
* src/mod_register.erl: When a registration is blocked due to IP
limitation, return description in error stanza (EJAB-692)
2008-07-24 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Allow owner to subscribe/get its own
node (EJAB-705)
2008-07-24 Badlop <badlop@process-one.net>
* src/Makefile.in: Support for parallel compilation with 'make -j'
in multi core CPUs: fix compilation dependencies; compile
behaviors before other source code (EJAB-697)(thanks to Jonathan
Schleifer)
* src/mod_pubsub/Makefile.in: Likewise
* src/eldap/Makefile.in: Likewise
* doc/guide.tex: Document room options allow_visitor_nickchange
and allow_visitor_status (EJAB-624)
* doc/guide.html: Likewise
2008-07-23 Geoff Cant <geoff.cant@process-one.net>
* src/mod_muc/mod_muc_room.erl: new room options,
allow_visitor_presence and allow_visitor_nickchange to
block/enable visitors to broadcast presence updates to the room
(EJAB-624).
* src/mod_muc/mod_muc_room.erl: renaming allow_visitor_presence to
allow_visitor_status and altering effect (when false) to remove
custom status tags in presence broadcasts to muc rooms by
visitors.
2008-07-23 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: remove_user hook removes
subscriptions (EJAB-684), send the last published and not the
first published item (EJAB-675), remove the pubsub/nodes tree,
subscribing to a node sends only last items (EJAB-700)
* src/mod_pubsub/node_pep.erl: added acl and jid match on node
creation permission (EJAB-663)
* src/mod_pubsub/node_default.erl: fix node creation permission
issue for service
2008-07-22 Badlop <badlop@process-one.net>
* src/ejabberd_config.erl: If syntax mistake in config file, show
specific error message (EJAB-616)
2008-07-17 Badlop <badlop@process-one.net>
* src/mod_muc/mod_muc_room.erl: Fix to allow a server admin to add
himself as owner of a room (EJAB-687)
* src/Makefile.in: ejabberctl doesn't use the erl found by the
configure script (EJAB-676)
* src/ejabberdctl.template: Likewise
2008-07-17 Christophe Romain <christophe.romain@process-one.net>
* src/web/Makefile.in: use -DSSL39 if compiling with R12
2008-07-16 Badlop <badlop@process-one.net>
* src/ejabberd_c2s.erl: Put auth_module in Info always (EJAB-549)
2008-07-16 Alexey Shchepin <alexey@process-one.net>
* src/web/ejabberd_http_poll.erl: Report connection's IP address
* src/ejabberd_c2s.erl: Rolled back the previous IP getting patch
* src/ejabberd_sm.erl: Likewise
* src/ejabberd_receiver.erl: Likewise
* src/web/ejabberd_http_poll.erl: Likewise
2008-07-16 Badlop <badlop@process-one.net>
* doc/guide.tex: Improve explanation of option 'hosts' in
ejabberd_service
* doc/guide.html: Likewise
2008-07-12 Badlop <badlop@process-one.net>
* src/configure.ac: Improve legibility
* src/aclocal.m4: Likewise
* src/configure: Likewise
* src/ejabberdctl.template: Remove garbage variable. Document node
option
* doc/guide.tex: Add references to sections.
* doc/guide.html: Likewise
2008-07-11 Badlop <badlop@process-one.net>
* doc/guide.tex: Document how to insert a newline character in
welcome_message (EJAB-501)
* src/ejabberd.cfg.example: Likewise
2008-07-11 Christophe Romain <christophe.romain@process-one.net>
* src/ejabberd_c2s.erl: Backport C2S blacklist support from trunk
was (EJAB-625).
* src/mod_ip_blacklist.erl: Likewise
* src/jlib.erl: Added IP format tuple to string function
* src/ejabberd_socket.erl: Properly handled c2s start failure (happen
for blacklisted IP).
2008-07-10 Badlop <badlop@process-one.net>
* src/configure.ac: Don't check for erlang header file (EJAB-232)
* src/configure: Likewise
2008-07-09 Badlop <badlop@process-one.net>
* src/configure.ac: Check for erlang header files (EJAB-232)
* src/configure: Likewise
* src/mod_pubsub/mod_pubsub.erl: Fix compilator warnings
* src/mod_muc/mod_muc_log.erl: Fix XHTML compliance: ensure some
language is set, include ID attribute in each message, add
microseconds to ensure unique value (EJAB-497)
* src/ejabberd_config.erl (load_file): error message on sasl.log
is not flattened (EJAB-616)
* doc/guide.tex: mod_muc_log XMPP URI supports the updated version
RFC 5122 (EJAB-631)
* doc/guide.html: Likewise
2008-07-08 Badlop <badlop@process-one.net>
* tools/ejabberdctl: Work also when 'which' is unavailable
2008-07-08 Christophe Romain <christophe.romain@process-one.net>
* src/web/ejabberd_http_poll.erl: improve ip fetching patch
2008-07-07 Badlop <badlop@process-one.net>
* src/Makefile.in: Spool, config and log dirs: writtable by owner,
readable by group, nothing by others (EJAB-686)
* doc/guide.tex: New section Securing sensible files
* doc/guide.html: Likewise
* doc/guide.tex: Solaris Makefile install: use ginstall (thanks to
Jonathan Auer)(EJAB-649)
* doc/guide.html: Likewise
2008-07-03 Jerome Sautret <jerome.sautret@process-one.net>
* src/mod_privacy_odbc.erl: Support for privacy lists in MySQL
(thanks to Igor Goryachev)(EJAB-538)
2008-07-03 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Fix permission control on item
retrieve (EJAB-453)
* src/mod_pubsub/node_dispatch.erl: Likewise
* src/mod_pubsub/node_buddy.erl: Likewise
* src/mod_pubsub/node_private.erl: Likewise
* src/mod_pubsub/node_public.erl: Likewise
* src/mod_pubsub/node_default.erl: Likewise
* src/mod_pubsub/node_pep.erl: Likewise
* src/mod_pubsub/node_club.erl: Likewise
* src/mod_pubsub/gen_pubsub_node.erl: Likewise
* src/mod_pubsub/node.template: Likewise
* src/mod_pubsub/mod_pubsub.erl: Allow subscriber to request specific
items by ItemID; Allow to retrieve pubsub#title configuration (thanks
to Kevin Crosbie); Fix forbidden result on setting
affiliation/subscription
* src/ejabberd_local.erl: prevent iq_response table overload
(EJAB-608)
* src/mod_caps.erl: Likewise
* src/web/ejabberd_http.erl: Retrieve correct IP from http connection
* src/web/ejabberd_http_poll.erl: Likewise
* src/ejabberd_receiver.erl: Likewise
* src/ejabberd_sm.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/web/ejabberd_http_poll.erl: Fixed HTTP headers when a
requested session doesn't exist (backport from trunk r1223)
2008-06-29 Badlop <badlop@process-one.net>
* src/ejabberd_ctl.erl: Web Admin and Ad-hoc admin: dump only
persistent tables (EJAB-678)
* src/mod_pubsub/node_pep.erl: Complain if mod_caps disabled and
mod_pubsub has PEP plugin enabled (EJAB-677)
2008-06-21 Badlop <badlop@process-one.net>
* doc/guide.tex: Explain that S2S outgoing first tries IPv4 and if
that fails then tries IPv6
* doc/guide.html: Likewise
2008-06-18 Badlop <badlop@process-one.net>
* src/ejabberd.app: The ejabberd version number is defined in the
OTP application resource file, in the key 'vsn' (EJAB-657)
* src/ejabberd.hrl: The macro VERSION now consults the ejabberd
application key vsn
* src/configure.erl: Load the ejabberd application description
* doc/Makefile: Read ejabberd version from ejabberd.app vsn
* doc/api/Makefile: Likewise
2008-06-18 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: get_default bugfix (EJAB-656)
2008-06-13 Badlop <badlop@process-one.net>
* src/ejabberd.cfg.example: Add registration_timeout (EJAB-653)
* doc/guide.tex: Table of listener modules converted to
description. Table of modules overview simplified, and module
names link to their sections. Document
ldap_local_filter (EJAB-179). Title in HTML is shorter.
Update several external URIs.
* doc/guide.html: Regenerated with all the latest changes
2008-06-12 Badlop <badlop@process-one.net>
* doc/guide.tex: Permanent reference URL for sections (EJAB-651).
Changes in CSS: verbatim text is indented and has grey background;
descriptions are indented; table borders are softer. Fix
indentation of verbatim text.
2008-06-08 Badlop <badlop@process-one.net>
* doc/guide.tex: Small fixes (thanks to Christoph Anton Mitterer)
* doc/introduction.tex: Likewise
* doc/guide.html: Likewise
2008-06-05 Badlop <badlop@process-one.net>
* doc/guide.tex: Document ejabberdctl status code (EJAB-633)
* doc/guide.html: Likewise
2008-06-04 Badlop <badlop@process-one.net>
* src/msgs/pl.msg: Bugfix in arguments of translated string that
could crash the room (thanks to Anastasia Gornostaeva)
2008-05-31 Badlop <badlop@process-one.net>
* src/web/ejabberd_web.erl (make_xhtml/2): Allow to include
elements in the HTTP header
* src/odbc/odbc_queries.erl (del_user_return_password): Return
password (thanks to Oleg Palij)
2008-05-22 Badlop <badlop@process-one.net>
* README: R12 support: remove compilation warning (EJAB-630)
2008-05-19 Badlop <badlop@process-one.net>
* doc/guide.html: Updated
* doc/dev.html: Likewise
* doc/features.html: Likewise
* doc/version.tex: Likewise
* src/ejabberd.hrl: Version is 2.0.x
* src/configure.ac: R12 support: remove compilation
warning (EJAB-630)
* src/configure: Likewise
* doc/guide.tex: Likewise
* doc/guide.tex: Describe how to disable registration
limitation (EJAB-614)
2008-05-16 Christophe Romain <christophe.romain@process-one.net>
* src/ejabberd_receiver.erl: Don't activate a socket untill its
receiver process is controlling it (Thanks to Aleksey)
* src/ejabberd_s2s_out.erl: Change FSMTIMEOUT to 30s
2008-05-12 Badlop <badlop@process-one.net>
* src/mod_muc/mod_muc_room.erl: Return Forbidden error message
when user sends private message in a room that disallows
it (EJAB-595)
* src/web/ejabberd_http.erl (parse_auth): Allow password that
include colon character (EJAB-622)
2008-04-30 Christophe Romain <christophe.romain@process-one.net>
* src/mod_caps.erl: XEP-0115 patch (EJAB-618)
2008-04-29 Badlop <badlop@process-one.net>
* src/ejabberd_s2s_out.erl: Improve confusing log message in s2s
connection: wait_for_validation connect timeout (EJAB-617)
* src/ejabberd.cfg.example: Small improvements in explanations
* doc/guide.tex: Document MUC room options (EJAB-619)
2008-04-28 Badlop <badlop@process-one.net>
* doc/guide.tex: Document the option max_s2s_connections
2008-04-27 Alexey Shchepin <alexey@process-one.net>
* src/mod_muc/mod_muc_room.erl: Fixed room shaper processing
2008-04-26 Badlop <badlop@process-one.net>
* src/mod_shared_roster.erl: Fix for new registered accounts not
being immediately shown in an 'all' special shared roster
group (thanks to Alexey Shchepin) (EJAB-71)
* src/mod_register.erl: New vhost event user_registered
* doc/guide.tex: Document option registration_timeout (EJAB-614)
2008-04-23 Alexey Shchepin <alexey@process-one.net>
* src/treap.erl: Bugfix
* src/mod_register.erl: Fixed table creation, timeout isn't
activated when registration fails
* src/mod_register.erl: Restrict registration frequency per IP or
user (EJAB-614)
* src/ejabberd_c2s.erl: Pass IP to the c2s_unauthenticated_iq hook
* src/ejabberd_config.erl: Added registration_timeout option
* src/treap.erl: Treaps implementation
2008-04-22 Badlop <badlop@process-one.net>
* src/ejabberd_auth.erl: Improve anonymous authentication to not
remove rosters accidentally (EJAB-549). New functions in
ejabberd_auth to get/check password and know which module accepted
the authentication. New element 'auth_module' in ejabberd_c2s
record 'statedata'. Cyrsasl provides a new property in the
response: {auth_module, AuthModule}.
* src/ejabberd_auth_anonymous.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/cyrsasl_anonymous.erl: Likewise
* src/cyrsasl_digest.erl: Likewise
* src/cyrsasl_plain.erl: Likewise
2008-04-18 Badlop <badlop@process-one.net>
* src/ejabberd_s2s_out.erl: Fix long timeout when reconnecting s2s
after a remote server crash (EJAB-540)
* src/ejabberd_s2s_in.erl: Likewise
* src/ejabberd_s2s.erl: Likewise
* doc/guide.tex: Likewise
2008-04-16 Badlop <badlop@process-one.net>
* doc/guide.tex: Clarification: PEP is enabled in default config
2008-04-14 Christophe Romain <christophe.romain@process-one.net>
* src/mod_caps.erl: Cache negative response (EJAB-474)
2008-04-11 Alexey Shchepin <alexey@process-one.net>
* src/tls/tls_drv.c: Fixed gcc signedness warnings (EJAB-447)
* src/ejabberd_zlib/ejabberd_zlib_drv.c: Likewise
* src/expat_erl.c: Removed R9B workaround (EJAB-447)
2008-04-10 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: fix identity and database update
bugfix
* src/mod_pubsub/nodetree_default.erl: Likewise
2008-04-10 Mickael Remond <mremond@process-one.net>
* src/ejabberd_c2s.erl: Uniform default value for empty privacy
list. Fixes (EJAB-603).
2008-04-08 Badlop <badlop@process-one.net>
* src/ejabberd_auth_ldap.erl: LDAP function to get the number of
registered users is too slow (EJAB-331): set timeout in LDAP
search queries (thanks to Evgeniy Khramtsov) and return the number
of registered users.
2008-04-07 Mickael Remond <mremond@process-one.net>
* doc/guide.tex: Documented the IQ discipline {queue, N}.
2008-04-05 Badlop <badlop@process-one.net>
* doc/guide.tex: Fix default_room_opts with default_room_options
* doc/guide.html: Likewise
2008-04-04 Badlop <badlop@process-one.net>
* src/ejabberd_auth_ldap.erl (get_vh_registered_users_number): New
function that returns 0 registered users (EJAB-331).
* src/ejabberd_c2s.erl (process_presence_probe): Don't route a
presence probe to oneself (EJAB-498)
2008-04-02 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: add condition inclusion of pep in
disco identity (EJAB-564)
* src/ejabberd_local.erl: The iq_response table wasn't cloned
automatically on all nodes which resulted in a single point of
failure (backport from trunk, thanks to Alexey)
* src/Makefile.in: Do not ignore values passed from configure
(thanks to Justin Boffemmyer)(EJAB-592)
2008-03-31 Badlop <badlop@process-one.net>
* doc/webadmmain.png: Updated to ejabberd 2.0.0
* doc/webadmmainru.png: Likewise
* doc/disco.png: Removed because not used
* doc/guide.tex: Fix Latex reference to webadmin section. Update
explanation of screenshots. Update xmpp addresses of Mickael
Remond and Sander Devrieze.
* doc/guide.html: Likewise
* doc/Makefile: Remove the Hevea deprecated option -noiso
* doc/guide.html: Likewise
* doc/dev.html: Likewise
* doc/features.html: Likewise
2008-03-27 Badlop <badlop@process-one.net>
* doc/guide.tex: Fix epam location (thanks to Evgeniy Khramtsov)
* doc/guide.html: Likewise
2008-03-25 Badlop <badlop@process-one.net>
* src/Makefile.in: Failure to install epam is not
critical (EJAB-573). Only try to install epam if pam was enabled
in configure script (thanks to Etan Reisner)(EJAB-586)
2008-03-24 Badlop <badlop@process-one.net>
* doc/guide.tex: mod_vcard_ldap replace NICK with NICKNAME (thanks
to Andreas Ntaflos)
* doc/guide.html: Likewise
* src/msgs/de.msg: Fix irc typo (thanks to Jonathan Schleifer)
* src/msgs/cs.msg: Likewise
* src/msgs/pl.msg: Likewise
* src/msgs/sk.msg: Likewise
2008-03-22 Mickael Remond <mremond@process-one.net>
* src/eldap/Makefile.in: Generate ELDAPv3.beam during first Makefile
pass (EJAB-583).
2008-03-22 Badlop <badlop@process-one.net>
* doc/guide.tex: Document service_check_from (EJAB-576)
* doc/guide.html: Likewise
2008-03-21 Badlop <badlop@process-one.net>
* src/mod_caps.erl: Move two log calls ERROR_MSG to DEBUG
* src/shaper.erl: Move log call INFO_MSG to DEBUG
* doc/guide.tex: Document s2s_default_policy and
s2s_host (EJAB-575)
* doc/guide.html: Likewise
2008-03-21 Christophe Romain <christophe.romain@process-one.net>
* src/pam/epam.erl: Seek epam binary into priv/bin (EJAB-573)
* src/ejabberd.erl: Likewise
* src/ejabberdctl.template: Likewise
* tools/ejabberdctl: Likewise
* src/mod_pubsub/mod_pubsub.erl: Pubsub subscription is now wrapped in
pubsub tags (EJAB-580)
2008-03-21 Badlop <badlop@process-one.net>
* src/cyrsasl_digest.erl: Rewrite io:format calls to loglevel
macros (EJAB-555)
* src/ejabberd_auth.erl: Likewise
* src/ejabberd_ctl.erl: Likewise
* src/ejabberd_loglevel.erl: Likewise
* src/ejabberd_s2s.erl: Likewise
* src/ejabberd_sm.erl: Likewise
* src/ejabberd_update.erl: Likewise
* src/extauth.erl: Likewise
* src/mod_irc/mod_irc.erl: Likewise
* src/shaper.erl: Likewise
* src/tls/tls.erl: Likewise
* src/web/ejabberd_http_poll.erl: Likewise
* src/ejabberd.hrl: New macro ?PRINT(Format, Args) to print in
standard output
2008-03-20 Badlop <badlop@process-one.net>
* doc/guide.tex: Improve explanation of how to start ejabberd when
binary installer. Don't recommend R12 in Windows compilation.
Describe what happens if maxrate shaper is exceeded.
* doc/guide.html: Likewise
2008-03-20 Mickael Remond <mremond@process-one.net>
* src/eldap.erl: Improved logging. We now use ejabberd logging
framework (EJAB-582).
* src/eldap.erl: Faster LDAP reconnection (Thanks to Christophe
Romain) (EJAB-581)
2008-03-17 Mickael Remond <mremond@process-one.net>
* src/ejabberd_s2s.erl: Only trigger s2s_connect_hook on
successful connection (EJAB-566)
* src/ejabberd_s2s_out.erl: Likewise
2008-03-15 Mickael Remond <mremond@process-one.net>
* src/ejabberd_s2s.erl: API improvement: Added s2s_connect_hook
(EJAB-566).
2008-03-13 Badlop <badlop@process-one.net>
* src/odbc/ejabberd_odbc.erl: Start ODBC explicitely because
Erlang R12 doesn't start automatically like in R11 and
older (thanks to Sergei Golovan)(EJAB-541)
* src/ejabberd.hrl: Removed unused ejabberd_debug and
PRIVACY_SUPPORT. Reordered the remaining options
* doc/guide.tex: Describe option Matches in mod_vcard_ldap (thanks
to Evgeniy Khramtsov)(EJAB-530). Fix typo in the description of
ldap_server option.
* doc/guide.html: Likewise
* src/mod_echo.erl: Small change to avoid a compilation warning of
unused function
2008-03-12 Badlop <badlop@process-one.net>
* src/web/ejabberd_web_admin.erl (term_to_string): Show Erlang
terms in one line in Erlang R12 (EJAB-503)
2008-03-11 Badlop <badlop@process-one.net>
* src/ejabberd_s2s_in.erl (get_cert_domains): When compiling with
Erlang R12, replace the calls to deprecated module PKIX1Explicit88
with OTP-PKIX (EJAB-556)
2008-03-10 Badlop <badlop@process-one.net>
* src/ejabberd_update.erl: Fix crash when browsing the Update
page in Erlang R12 (EJAB-552)
2008-03-09 Badlop <badlop@process-one.net>
* src/mod_proxy65/mod_proxy65_service.erl: Implement alternative
to the deprecated function inet:ip_to_bytes (thanks to Evgeniy
Khramtsov)(EJAB-542)
2008-03-04 Badlop <badlop@process-one.net>
* doc/guide.tex: Improve documentation of host_config
add (EJAB-544)
* doc/guide.html: Likewise
* src/ejabberd.cfg.example: Likewise
* src/ejabberd_config.erl: Likewise
* doc/guide.tex: mod_announce recommends, but doesn't require
mod_adhoc (thanks to Anastasia Gornostaeva)
* doc/guide.html: Likewise
* src/ejabberd.cfg.example: Likewise
2008-02-29 Alexey Shchepin <alexey@process-one.net>
* src/mod_roster.erl: Fixed "from" attribute in roster pushes
* src/mod_roster_odbc.erl: Likewise
2008-02-28 Badlop <badlop@process-one.net>
* src/ejabberd_app.erl (prep_stop): Stop modules when stopping
ejabberd (EJAB-536)
* src/mod_caps.erl (stop): Probably not needed to stop supervisor
child (EJAB-536)
* src/mod_muc/mod_muc.erl (room_destroyed): Catch message
sending (EJAB-536)
* src/mod_muc/mod_muc_room.erl (init): Ensure rooms are called
when the process dies due to a linked die (EJAB-536)
2008-02-27 Mickael Remond <mremond@process-one.net>
* src/ejabberd_check.erl: Separate config loading from
configuration sanity checks (EJAB-533)
* src/src/ejabberd_app.erl: Likewise
* src/ejabberd_app.erl: Likewise
2008-02-26 Badlop <badlop@process-one.net>
* src/msgs/it.msg: Updated (thanks to Smart2128)
2008-02-21 Badlop <badlop@process-one.net>
* doc/release_notes_2.0.0.txt: Small fixes and update date
@@ -34,7 +810,7 @@
* src/msgs/no.msg: Updated (thanks to Stian B. Barmen)
* src/msgs/pt-br.msg: Updated (thanks to Otavio Fernandes)
* src/msgs/uk.msg: Updated (thanks to Stoune and Ruslan Rakhmanin)
2008-02-19 Christophe Romain <christophe.romain@process-one.net>
* src/odbc/ejabberd_odbc.erl: add pgsql driver monitoring
@@ -181,13 +957,13 @@
* src/ejabberd.hrl: Likewise
* doc/introduction.tex: Updated to 22 languages
* doc/Makefile: Ensure that Bash is used
* doc/guide.tex: Updated copyright dates to 2008.
* src/*: Likewise
2008-01-15 Jérôme Sautret <jerome.sautret@process-one.net>
2008-01-15 Jerome Sautret <jerome.sautret@process-one.net>
* src/Makefile.in: Allow compilation with Erlang R12 (EJAB-446)
(thanks to Sergei Golovan and Maxim Treskin). Erlang R12 version is
+1 -3
View File
@@ -9,9 +9,7 @@ To compile ejabberd you need:
- GNU Make
- GCC
- libexpat 1.95 or higher
- Erlang/OTP R10B-9 up to R11B-5. Erlang R12 releases are not yet
officially supported, and are not recommended for production
servers
- Erlang/OTP R10B-9 or newer
- OpenSSL 0.9.6 or higher, for STARTTLS, SASL and SSL
encryption. Optional, highly recommended.
- Zlib 1.2.3 or higher, for Stream Compression support
+2 -2
View File
@@ -1,5 +1,5 @@
% List of ejabberd-modules to add for ejabberd packaging (source archive and installer)
%
% HTTP-binding:
https://svn.process-one.net/ejabberd-modules/http_bind/tags/ejabberd-2.0.0
https://svn.process-one.net/ejabberd-modules/mod_http_fileserver/tags/ejabberd-2.0.0
https://svn.process-one.net/ejabberd-modules/http_bind/trunk
https://svn.process-one.net/ejabberd-modules/mod_http_fileserver/trunk
+4 -4
View File
@@ -21,7 +21,7 @@ release:
@echo "Press any key to continue"
@read foo
@echo "% ejabberd version (automatically generated)." > version.tex
@echo "\newcommand{\version}{"`sed '/VERSION/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../src/ejabberd.hrl`"}" >> version.tex
@echo "\newcommand{\version}{"`sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../src/ejabberd.app`"}" >> version.tex
@echo -n "% Contributed modules (automatically generated)." > contributed_modules.tex
@echo -e "$(CONTRIBUTED_MODULES)" >> contributed_modules.tex
@@ -43,13 +43,13 @@ clean:
rm -f *.toc
guide.html: guide.tex
hevea -fix -noiso -pedantic guide.tex
hevea -fix -pedantic guide.tex
dev.html: dev.tex
hevea -fix -noiso -pedantic dev.tex
hevea -fix -pedantic dev.tex
features.html: features.tex
hevea -fix -noiso -pedantic features.tex
hevea -fix -pedantic features.tex
guide.pdf: guide.tex
pdflatex guide.tex
+1 -1
View File
@@ -1,5 +1,5 @@
APPNAME = ejabberd
VSN = SVN
VSN = $(shell sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../../src/ejabberd.app)
DOCDIR=.
SRCDIR=../../src
+1 -1
View File
@@ -1,6 +1,6 @@
@author Mickael Remond <mickael.remond@process-one.net>
[http://www.process-one.net/]
@copyright 2007 Process-one
@copyright 2007 ProcessOne
@version {@vsn}, {@date} {@time}
@title ejabberd Development API Documentation
+4 -4
View File
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Ejabberd 2.0.0 Developers Guide
<TITLE>Ejabberd 2.0.x Developers Guide
</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
@@ -46,10 +46,10 @@ TD P{margin:0px;}
</STYLE>
</HEAD>
<BODY >
<!--HEVEA command line is: /usr/bin/hevea -fix -noiso -pedantic dev.tex -->
<!--HEVEA command line is: /usr/bin/hevea -fix -pedantic dev.tex -->
<!--CUT DEF section 1 --><P><A NAME="titlepage"></A>
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.0 Developers Guide</H1><H3 CLASS="titlerest">Alexey Shchepin<BR>
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.x Developers Guide</H1><H3 CLASS="titlerest">Alexey Shchepin<BR>
<A HREF="mailto:alexey@sevcom.net"><TT>mailto:alexey@sevcom.net</TT></A><BR>
<A HREF="xmpp:aleksey@jabber.ru"><TT>xmpp:aleksey@jabber.ru</TT></A></H3></TD></TR>
</TABLE><DIV CLASS="center">
@@ -139,7 +139,7 @@ Support for virtual hosting.
</LI><LI CLASS="li-itemize">Statistics via Statistics Gathering (<A HREF="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</A>).
</LI><LI CLASS="li-itemize">IPv6 support both for c2s and s2s connections.
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</A> module with support for clustering and HTML logging. </LI><LI CLASS="li-itemize">Users Directory based on users vCards.
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-00163.html">Personal Eventing via Pubsub</A>.
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-0163.html">Personal Eventing via Pubsub</A>.
</LI><LI CLASS="li-itemize">Support for web clients: <A HREF="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</A> and <A HREF="http://www.xmpp.org/extensions/xep-0206.html">HTTP Binding (BOSH)</A> services.
</LI><LI CLASS="li-itemize">IRC transport.
</LI><LI CLASS="li-itemize">Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

+4 -4
View File
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Ejabberd 2.0.0 Feature Sheet
<TITLE>Ejabberd 2.0.x Feature Sheet
</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
@@ -47,10 +47,10 @@ SPAN{width:20%; float:right; text-align:left; margin-left:auto;}
</STYLE>
</HEAD>
<BODY >
<!--HEVEA command line is: /usr/bin/hevea -fix -noiso -pedantic features.tex -->
<!--HEVEA command line is: /usr/bin/hevea -fix -pedantic features.tex -->
<!--CUT DEF section 1 --><P><A NAME="titlepage"></A>
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.0 Feature Sheet</H1><H3 CLASS="titlerest">Sander Devrieze<BR>
</P><TABLE CLASS="title"><TR><TD><H1 CLASS="titlemain">Ejabberd 2.0.x Feature Sheet</H1><H3 CLASS="titlerest">Sander Devrieze<BR>
<A HREF="mailto:s.devrieze@pandora.be"><TT>mailto:s.devrieze@pandora.be</TT></A><BR>
<A HREF="xmpp:sander@devrieze.dyndns.org"><TT>xmpp:sander@devrieze.dyndns.org</TT></A></H3></TD></TR>
</TABLE><DIV CLASS="center">
@@ -118,7 +118,7 @@ Support for virtual hosting.
</LI><LI CLASS="li-itemize">Statistics via Statistics Gathering (<A HREF="http://www.xmpp.org/extensions/xep-0039.html">XEP-0039</A>).
</LI><LI CLASS="li-itemize">IPv6 support both for c2s and s2s connections.
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</A> module with support for clustering and HTML logging. </LI><LI CLASS="li-itemize">Users Directory based on users vCards.
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-00163.html">Personal Eventing via Pubsub</A>.
</LI><LI CLASS="li-itemize"><A HREF="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</A> component with support for <A HREF="http://www.xmpp.org/extensions/xep-0163.html">Personal Eventing via Pubsub</A>.
</LI><LI CLASS="li-itemize">Support for web clients: <A HREF="http://www.xmpp.org/extensions/xep-0025.html">HTTP Polling</A> and <A HREF="http://www.xmpp.org/extensions/xep-0206.html">HTTP Binding (BOSH)</A> services.
</LI><LI CLASS="li-itemize">IRC transport.
</LI><LI CLASS="li-itemize">Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
+1296 -1237
View File
File diff suppressed because it is too large Load Diff
+1228 -1074
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -125,7 +125,7 @@ Moreover, \ejabberd{} comes with a wide range of other state-of-the-art features
\item IPv6 support both for c2s and s2s connections.
\item \txepref{0045}{Multi-User Chat} module with support for clustering and HTML logging. %%\improved{}
\item Users Directory based on users vCards.
\item \txepref{0060}{Publish-Subscribe} component with support for \txepref{00163}{Personal Eventing via Pubsub}.
\item \txepref{0060}{Publish-Subscribe} component with support for \txepref{0163}{Personal Eventing via Pubsub}.
\item Support for web clients: \txepref{0025}{HTTP Polling} and \txepref{0206}{HTTP Binding (BOSH)} services.
\item IRC transport.
\item Component support: interface with networks such as AIM, ICQ and MSN installing special tranports.
+30
View File
@@ -0,0 +1,30 @@
Release Notes
ejabberd 2.0.1
20 May 2008
ejabberd 2.0.1 is a bugfix release for ejabberd 2.0.x branch.
ejabberd 2.0.1 includes 10 improvements and 32 bugfixes.
A complete list of changes can be retrieved from:
http://redir.process-one.net/ejabberd-2.0.1
The new code can be downloaded from ejabberd download page:
http://www.process-one.net/en/projects/ejabberd/
Recent changes include:
- Erlang R12 support.
- Better LDAP handling.
- PubSub bugfixes.
- Documentation improvements.
- inband registration limitation per IP.
- s2s improvements.
Bugs report
You can officially report bugs on Process-one support site:
http://support.process-one.net/
END
+34
View File
@@ -0,0 +1,34 @@
Release Notes
ejabberd 2.0.2
28 August 2008
ejabberd 2.0.2 is the second bug fix release for ejabberd 2.0.x branch.
ejabberd 2.0.2 includes many bugfixes and a few improvements.
A complete list of changes can be retrieved from:
http://redir.process-one.net/ejabberd-2.0.2
The new code can be downloaded from ejabberd download page:
http://www.process-one.net/en/ejabberd/
Recent changes include:
- Anti-abuse feature: client blacklist support by IP.
- Guide: new section Securing ejabberd; improved usability.
- LDAP filter optimisation: ability to filter user in ejabberd and not LDAP.
- MUC improvements: room options to restrict visitors; broadcast reasons.
- Privacy rules: fix MySQL storage.
- Pub/Sub and PEP: many improvements in implementation and protocol compliance.
- Proxy65: send valid SOCKS5 reply (removed support for Psi < 0.10).
- Web server embedded: better support for HTTPS.
- Binary installers: SMP on Windows; don't remove config when uninstalling.
Bug reports
You can officially report bugs on ProcessOne support site:
http://support.process-one.net/
END
+1 -1
View File
@@ -1,2 +1,2 @@
% ejabberd version (automatically generated).
\newcommand{\version}{2.0.0}
\newcommand{\version}{2.0.x}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+26 -10
View File
@@ -40,24 +40,34 @@ ifeq (@transient_supervisors@, false)
ERLC_FLAGS+=-DNO_TRANSIENT_SUPERVISORS
endif
INSTALL_EPAM=
ifeq (@pam@, pam)
INSTALL_EPAM=install -m 750 epam $(PBINDIR)
endif
prefix = @prefix@
exec_prefix = @exec_prefix@
SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @mod_proxy65@ @eldap@ @pam@ @web@ stringprep @tls@ @odbc@ @ejabberd_zlib@
ERLSHLIBS = expat_erl.so
ERLBEHAVS = cyrsasl.erl gen_mod.erl p1_fsm.erl
SOURCES = $(ERLBEHAVS) $(wildcard *.erl)
SOURCES_ALL = $(wildcard *.erl)
SOURCES = $(filter-out $(ERLBEHAVS),$(SOURCES_ALL))
ERLBEHAVBEAMS = $(ERLBEHAVS:.erl=.beam)
BEAMS = $(SOURCES:.erl=.beam)
DESTDIR =
EJABBERDDIR = $(DESTDIR)@prefix@/var/lib/ejabberd
EJABBERDDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
BEAMDIR = $(EJABBERDDIR)/ebin
SPOOLDIR = $(EJABBERDDIR)/db
PRIVDIR = $(EJABBERDDIR)/priv
SODIR = $(PRIVDIR)/lib
PBINDIR = $(PRIVDIR)/bin
MSGSDIR = $(PRIVDIR)/msgs
LOGDIR = $(DESTDIR)@prefix@/var/log/ejabberd
ETCDIR = $(DESTDIR)@prefix@/etc/ejabberd
SBINDIR = $(DESTDIR)@prefix@/sbin
LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
SBINDIR = $(DESTDIR)@sbindir@
ifeq ($(shell uname),Darwin)
DYNAMIC_LIB_CFLAGS = -fPIC -bundle -flat_namespace -undefined suppress
@@ -68,7 +78,11 @@ endif
all: $(ERLSHLIBS) compile-beam all-recursive
compile-beam: XmppAddr.hrl $(BEAMS)
compile-beam: XmppAddr.hrl $(ERLBEHAVBEAMS) $(BEAMS)
$(BEAMS): $(ERLBEHAVBEAMS)
all-recursive: $(ERLBEHAVBEAMS)
%.beam: %.erl
@ERLC@ -W $(ERLC_FLAGS) $<
@@ -100,19 +114,21 @@ install: all
install -m 644 *.beam $(BEAMDIR)
rm -f $(BEAMDIR)/configure.beam
install -m 644 *.app $(BEAMDIR)
install -d -m 750 $(SPOOLDIR)
install -d $(SODIR)
install -d $(PBINDIR)
install -m 644 *.so $(SODIR)
-install -m 750 epam $(SODIR)
$(INSTALL_EPAM)
install -d $(MSGSDIR)
install -m 644 msgs/*.msg $(MSGSDIR)
install -d $(ETCDIR)
install -d -m 750 $(ETCDIR)
[ -f $(ETCDIR)/ejabberd.cfg ] && install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new || install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
sed -e "s*@rootdir@*@prefix@*" ejabberdctl.template > ejabberdctl.example
sed -e "s*@rootdir@*@prefix@*" -e "s*@erl@*@ERL@*" ejabberdctl.template > ejabberdctl.example
[ -f $(ETCDIR)/ejabberdctl.cfg ] && install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new || install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
install -b -m 644 inetrc $(ETCDIR)/inetrc
install -d $(SBINDIR)
install -m 755 ejabberdctl.example $(SBINDIR)/ejabberdctl
install -d $(LOGDIR)
install -d -m 750 $(LOGDIR)
uninstall: uninstall-binary
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 18 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+7 -8
View File
@@ -1,6 +1,6 @@
AC_DEFUN(AM_WITH_EXPAT,
[ AC_ARG_WITH(expat,
[ --with-expat=PREFIX prefix where EXPAT is installed])
[AC_HELP_STRING([--with-expat=PREFIX], [prefix where EXPAT is installed])])
EXPAT_CFLAGS=
EXPAT_LIBS=
@@ -34,7 +34,7 @@ AC_DEFUN(AM_WITH_EXPAT,
AC_DEFUN(AM_WITH_ZLIB,
[ AC_ARG_WITH(zlib,
[ --with-zlib=PREFIX prefix where zlib is installed])
[AC_HELP_STRING([--with-zlib=PREFIX], [prefix where zlib is installed])])
ZLIB_CFLAGS=
ZLIB_LIBS=
@@ -68,7 +68,7 @@ AC_DEFUN(AM_WITH_ZLIB,
AC_DEFUN(AM_WITH_PAM,
[ AC_ARG_WITH(pam,
[ --with-pam=PREFIX prefix where PAM is installed])
[AC_HELP_STRING([--with-pam=PREFIX], [prefix where PAM is installed])])
PAM_CFLAGS=
PAM_LIBS=
@@ -102,7 +102,7 @@ AC_DEFUN(AM_WITH_PAM,
AC_DEFUN(AM_WITH_ERLANG,
[ AC_ARG_WITH(erlang,
[ --with-erlang=PREFIX path to erlc and erl ])
[AC_HELP_STRING([--with-erlang=PREFIX], [path to erlc and erl])])
AC_PATH_TOOL(ERLC, erlc, , $with_erlang:$with_erlang/bin:$PATH)
AC_PATH_TOOL(ERL, erl, , $with_erlang:$with_erlang/bin:$PATH)
@@ -195,14 +195,13 @@ _EOF
AC_SUBST(ERL)
])
AC_DEFUN(AC_MOD_ENABLE,
[
$1=
make_$1=
AC_MSG_CHECKING([whether build $1])
AC_ARG_ENABLE($1,
[ --enable-$1 enable $1 (default: $2)],
[AC_HELP_STRING([--enable-$1], [enable $1 (default: $2)])],
[mr_enable_$1="$enableval"],
[mr_enable_$1=$2])
if test "$mr_enable_$1" = "yes"; then
@@ -223,7 +222,7 @@ AC_DEFUN([AM_ICONV],
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
AC_ARG_WITH([libiconv-prefix],
[ --with-libiconv-prefix=PREFIX prefix where libiconv is installed], [
[AC_HELP_STRING([--with-libiconv-prefix=PREFIX], [prefix where libiconv is installed])], [
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
if test -d $dir/include; then CFLAGS="$CFLAGS -I$dir/include"; fi
@@ -308,7 +307,7 @@ size_t iconv();
dnl <openssl>
AC_DEFUN(AM_WITH_OPENSSL,
[ AC_ARG_WITH(openssl,
[ --with-openssl=PREFIX prefix where OPENSSL is installed ])
[AC_HELP_STRING([--with-openssl=PREFIX], [prefix where OPENSSL is installed])])
unset SSL_LIBS;
unset SSL_CFLAGS;
have_openssl=no
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 31 Oct 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+29 -27
View File
@@ -1281,31 +1281,39 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-mod_pubsub enable mod_pubsub (default: yes)
--enable-mod_pubsub enable mod_pubsub (default: yes)
--enable-mod_irc enable mod_irc (default: yes)
--enable-mod_muc enable mod_muc (default: yes)
--enable-mod_proxy65 enable mod_proxy65 (default: yes)
--enable-eldap enable eldap (default: yes)
--enable-pam enable pam (default: no)
--enable-web enable web (default: yes)
--enable-tls enable tls (default: yes)
--enable-odbc enable odbc (default: no)
--enable-ejabberd_zlib enable ejabberd_zlib (default: yes)
--enable-hipe Compile natively with HiPE, not recommended (default: no)
--enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions (default: no)
--enable-mssql Use Microsoft SQL Server database (default: no, requires --enable-odbc)
--enable-transient_supervisors Use Erlang supervision for transient process (default: yes)
--enable-full-xml Use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)
--enable-mod_proxy65 enable mod_proxy65 (default: yes)
--enable-eldap enable eldap (default: yes)
--enable-pam enable pam (default: no)
--enable-web enable web (default: yes)
--enable-tls enable tls (default: yes)
--enable-odbc enable odbc (default: no)
--enable-ejabberd_zlib enable ejabberd_zlib (default: yes)
--enable-hipe compile natively with HiPE, not recommended
(default: no)
--enable-roster-gateway-workaround
turn on workaround for processing gateway
subscriptions (default: no)
--enable-mssql use Microsoft SQL Server database (default: no,
requires --enable-odbc)
--enable-transient_supervisors
use Erlang supervision for transient process
(default: yes)
--enable-full-xml use XML features in XMPP stream (ex: CDATA)
(default: no, requires XML compliant clients)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-erlang=PREFIX path to erlc and erl
--with-libiconv-prefix=PREFIX prefix where libiconv is installed
--with-expat=PREFIX prefix where EXPAT is installed
--with-zlib=PREFIX prefix where zlib is installed
--with-pam=PREFIX prefix where PAM is installed
--with-openssl=PREFIX prefix where OPENSSL is installed
--with-libiconv-prefix=PREFIX
prefix where libiconv is installed
--with-expat=PREFIX prefix where EXPAT is installed
--with-zlib=PREFIX prefix where zlib is installed
--with-pam=PREFIX prefix where PAM is installed
--with-openssl=PREFIX prefix where OPENSSL is installed
Some influential environment variables:
CC C compiler command
@@ -4755,6 +4763,9 @@ _ACEOF
fi
# Check Erlang headers are installed
#AC_CHECK_HEADER(erl_driver.h,,[AC_MSG_ERROR([cannot find Erlang header files])])
# Change default prefix
@@ -6910,12 +6921,3 @@ if test "$no_create" != yes; then
$ac_cs_success || { (exit 1); exit 1; }
fi
if test -n "$ERLANG_SSL39" ; then
echo
echo "**************** WARNING ! ********************"
echo "ejabberd will be compiled with Erlang R12."
echo "This version of Erlang is not supported"
echo "and not recommended for production servers"
echo "***********************************************"
fi
+8 -14
View File
@@ -26,6 +26,9 @@ AM_WITH_PAM
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Check Erlang headers are installed
#AC_CHECK_HEADER(erl_driver.h,,[AC_MSG_ERROR([cannot find Erlang header files])])
# Change default prefix
AC_PREFIX_DEFAULT(/)
@@ -45,7 +48,7 @@ AC_MOD_ENABLE(odbc, no)
AC_MOD_ENABLE(ejabberd_zlib, yes)
AC_ARG_ENABLE(hipe,
[ --enable-hipe Compile natively with HiPE, not recommended (default: no)],
[AC_HELP_STRING([--enable-hipe], [compile natively with HiPE, not recommended (default: no)])],
[case "${enableval}" in
yes) hipe=true ;;
no) hipe=false ;;
@@ -54,7 +57,7 @@ esac],[hipe=false])
AC_SUBST(hipe)
AC_ARG_ENABLE(roster_gateway_workaround,
[ --enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions (default: no)],
[AC_HELP_STRING([--enable-roster-gateway-workaround], [turn on workaround for processing gateway subscriptions (default: no)])],
[case "${enableval}" in
yes) roster_gateway_workaround=true ;;
no) roster_gateway_workaround=false ;;
@@ -63,7 +66,7 @@ esac],[roster_gateway_workaround=false])
AC_SUBST(roster_gateway_workaround)
AC_ARG_ENABLE(mssql,
[ --enable-mssql Use Microsoft SQL Server database (default: no, requires --enable-odbc)],
[AC_HELP_STRING([--enable-mssql], [use Microsoft SQL Server database (default: no, requires --enable-odbc)])],
[case "${enableval}" in
yes) db_type=mssql ;;
no) db_type=generic ;;
@@ -72,7 +75,7 @@ esac],[db_type=generic])
AC_SUBST(db_type)
AC_ARG_ENABLE(transient_supervisors,
[ --enable-transient_supervisors Use Erlang supervision for transient process (default: yes)],
[AC_HELP_STRING([--enable-transient_supervisors], [use Erlang supervision for transient process (default: yes)])],
[case "${enableval}" in
yes) transient_supervisors=true ;;
no) transient_supervisors=false ;;
@@ -81,7 +84,7 @@ esac],[transient_supervisors=true])
AC_SUBST(transient_supervisors)
AC_ARG_ENABLE(full_xml,
[ --enable-full-xml Use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)],
[AC_HELP_STRING([--enable-full-xml], [use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)])],
[case "${enableval}" in
yes) full_xml=true ;;
no) full_xml=false ;;
@@ -120,12 +123,3 @@ fi
AC_CHECK_HEADER(krb5.h,,)
AC_OUTPUT
if test -n "$ERLANG_SSL39" ; then
echo
echo "**************** WARNING ! ********************"
echo "ejabberd will be compiled with Erlang R12."
echo "This version of Erlang is not supported"
echo "and not recommended for production servers"
echo "***********************************************"
fi
+3 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 27 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -60,6 +60,8 @@ start() ->
EVersion = "ERLANG_VERSION = " ++ erlang:system_info(version) ++ "\n",
EIDirS = "EI_DIR = " ++ code:lib_dir("erl_interface") ++ "\n",
RootDirS = "ERLANG_DIR = " ++ code:root_dir() ++ "\n",
%% Load the ejabberd application description so that ?VERSION can read the vsn key
application:load(ejabberd),
Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n",
ExpatDir = "EXPAT_DIR = c:\\sdk\\Expat-2.0.0\n",
OpenSSLDir = "OPENSSL_DIR = c:\\sdk\\OpenSSL\n",
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 8 Mar 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+3 -2
View File
@@ -6,7 +6,7 @@
%%% Created : 23 Aug 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -51,5 +51,6 @@ mech_step(State, _ClientIn) ->
%% Checks that the username is available
case ejabberd_auth:is_user_exists(User, Server) of
true -> {error, "not-authorized"};
false -> {ok, [{username, User}]}
false -> {ok, [{username, User},
{auth_module, ejabberd_auth_anonymous}]}
end.
+10 -5
View File
@@ -14,9 +14,11 @@
mech_new/3,
mech_step/2]).
-include("ejabberd.hrl").
-behaviour(cyrsasl).
-record(state, {step, nonce, username, authzid, get_password}).
-record(state, {step, nonce, username, authzid, get_password, auth_module}).
start(_Opts) ->
cyrsasl:register_mechanism("DIGEST-MD5", ?MODULE, true).
@@ -42,9 +44,9 @@ mech_step(#state{step = 3, nonce = Nonce} = State, ClientIn) ->
UserName = xml:get_attr_s("username", KeyVals),
AuthzId = xml:get_attr_s("authzid", KeyVals),
case (State#state.get_password)(UserName) of
false ->
{false, _} ->
{error, "not-authorized", UserName};
Passwd ->
{Passwd, AuthModule} ->
Response = response(KeyVals, UserName, Passwd,
Nonce, AuthzId, "AUTHENTICATE"),
case xml:get_attr_s("response", KeyVals) of
@@ -55,6 +57,7 @@ mech_step(#state{step = 3, nonce = Nonce} = State, ClientIn) ->
{continue,
"rspauth=" ++ RspAuth,
State#state{step = 5,
auth_module = AuthModule,
username = UserName,
authzid = AuthzId}};
_ ->
@@ -63,11 +66,13 @@ mech_step(#state{step = 3, nonce = Nonce} = State, ClientIn) ->
end
end;
mech_step(#state{step = 5,
auth_module = AuthModule,
username = UserName,
authzid = AuthzId}, "") ->
{ok, [{username, UserName}, {authzid, AuthzId}]};
{ok, [{username, UserName}, {authzid, AuthzId},
{auth_module, AuthModule}]};
mech_step(A, B) ->
io:format("SASL DIGEST: A ~p B ~p", [A,B]),
?DEBUG("SASL DIGEST: A ~p B ~p", [A,B]),
{error, "bad-protocol"}.
+4 -3
View File
@@ -5,7 +5,7 @@
%%% Created : 8 Mar 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -47,8 +47,9 @@ mech_step(State, ClientIn) ->
case parse(ClientIn) of
[AuthzId, User, Password] ->
case (State#state.check_password)(User, Password) of
true ->
{ok, [{username, User}, {authzid, AuthzId}]};
{true, AuthModule} ->
{ok, [{username, User}, {authzid, AuthzId},
{auth_module, AuthModule}]};
_ ->
{error, "not-authorized", User}
end;
+1 -1
View File
@@ -2,7 +2,7 @@
{application, ejabberd,
[{description, "ejabberd"},
{vsn, "2.0.0"},
{vsn, "2.0.2"},
{modules, [acl,
adhoc,
configure,
+49 -8
View File
@@ -341,11 +341,20 @@
%%{acl, test, {user_regexp, "^test"}}.
%%{acl, test, {user_glob, "test*"}}.
%%
%% Define specific ACLs in a virtual host.
%%
%%{host_config, "localhost",
%% [
%% {acl, admin, {user, "bob-local", "localhost"}}
%% ]
%%}.
%%% ============
%%% ACCESS RULES
%% Define the maximum number of time a single user is allowed to connect:
%% Maximum number of simultaneous sessions allowed for a single user:
{access, max_user_sessions, [{10, all}]}.
%% This rule allows access only for local users:
@@ -355,11 +364,11 @@
{access, c2s, [{deny, blocked},
{allow, all}]}.
%% For all users except admins used "normal" shaper
%% For C2S connections, all users except admins use "normal" shaper
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
%% For all S2S connections used "fast" shaper
%% All S2S connections use "fast" shaper
{access, s2s_shaper, [{fast, all}]}.
%% Only admins can send announcement messages:
@@ -374,12 +383,26 @@
%% All users are allowed to use MUC service:
{access, muc, [{allow, all}]}.
%% Every username can be registered via in-band registration:
%% Everybody can create pubsub nodes
{access, pubsub_createnode, [{allow, all}]}.
%% In-band registration allows registration of any possible username.
%% To disable in-band registration, replace 'allow' with 'deny'.
{access, register, [{allow, all}]}.
%% Everybody can create pubsub nodes
{access, pubsub_createnode, [{allow, all}]}.
%% By default frequency of account registrations from a the same IP
%% is limited to 1 account every 10 minutes. To disable put: infinity
%%{registration_timeout, 600}.
%%
%% Define specific Access rules in a virtual host.
%%
%%{host_config, "localhost",
%% [
%% {access, c2s, [{allow, admin}, {deny, all}]},
%% {access, register, [{deny, all}]}
%% ]
%%}.
%%% ================
@@ -390,6 +413,13 @@
%%
{language, "en"}.
%%
%% Set a different default language in a virtual host.
%%
%%{host_config, "localhost",
%% [{language, "ru"}]
%%}.
%%% =======
%%% MODULES
@@ -400,7 +430,7 @@
{modules,
[
{mod_adhoc, []},
{mod_announce, [{access, announce}]}, % requires mod_adhoc
{mod_announce, [{access, announce}]}, % recommends mod_adhoc
{mod_caps, []},
{mod_configure,[]}, % requires mod_adhoc
{mod_disco, []},
@@ -429,7 +459,7 @@
%% a message with this subject and body.
%%
{welcome_message, {"Welcome!",
"Welcome to this Jabber server."}},
"Hi\nWelcome to this Jabber server."}},
%%
%% When a user registers, send a notification to
@@ -448,6 +478,17 @@
{mod_version, []}
]}.
%%
%% Enable modules with custom options in a specific virtual host
%%
%%{host_config, "localhost",
%% [{{add, modules},
%% [
%% {mod_echo, [{host, "mirror.localhost"}]}
%% ]
%% }
%% ]}.
%%% $Id$
+15 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -28,7 +28,7 @@
-author('alexey@process-one.net').
-export([start/0, stop/0,
get_so_path/0]).
get_so_path/0, get_bin_path/0]).
start() ->
application:start(ejabberd).
@@ -49,3 +49,16 @@ get_so_path() ->
Path ->
Path
end.
get_bin_path() ->
case os:getenv("EJABBERD_BIN_PATH") of
false ->
case code:priv_dir(ejabberd) of
{error, _} ->
".";
Path ->
filename:join([Path, "bin"])
end;
Path ->
Path
end.
+21 -16
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -19,14 +19,31 @@
%%%
%%%----------------------------------------------------------------------
%-define(ejabberd_debug, true).
%-define(DBGFSM, true).
%% This macro returns a string of the ejabberd version running, e.g. "2.3.4"
%% If the ejabberd application description isn't loaded, returns atom: undefined
-define(VERSION, element(2, application:get_key(ejabberd,vsn))).
-define(VERSION, "2.0.0").
-define(MYHOSTS, ejabberd_config:get_global_option(hosts)).
-define(MYNAME, hd(ejabberd_config:get_global_option(hosts))).
-define(MYLANG, ejabberd_config:get_global_option(language)).
-define(MSGS_DIR, "msgs").
-define(CONFIG_PATH, "ejabberd.cfg").
-define(LOG_PATH, "ejabberd.log").
-define(EJABBERD_URI, "http://www.process-one.net/en/ejabberd/").
-define(S2STIMEOUT, 600000).
%%-define(DBGFSM, true).
%% ---------------------------------
%% Logging mechanism
%% Print in standard output
-define(PRINT(Format, Args),
io:format(Format, Args)).
-define(DEBUG(Format, Args),
ejabberd_logger:debug_msg(?MODULE,?LINE,Format, Args)).
@@ -42,15 +59,3 @@
-define(CRITICAL_MSG(Format, Args),
ejabberd_logger:critical_msg(?MODULE,?LINE,Format, Args)).
-define(MYHOSTS, ejabberd_config:get_global_option(hosts)).
-define(MYNAME, hd(ejabberd_config:get_global_option(hosts))).
-define(S2STIMEOUT, 600000).
-define(MYLANG, ejabberd_config:get_global_option(language)).
-define(MSGS_DIR, "msgs").
-define(CONFIG_PATH, "ejabberd.cfg").
-define(LOG_PATH, "ejabberd.log").
-define(PRIVACY_SUPPORT, true).
-define(EJABBERD_URI, "http://www.process-one.net/en/ejabberd/").
+1 -1
View File
@@ -9,7 +9,7 @@
%%% Created : 7 May 2006 by Mickael Remond <mremond@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+41 -8
View File
@@ -1,11 +1,11 @@
%%%----------------------------------------------------------------------
%%% File : ejabberd_app.erl
%%% Author : Alexey Shchepin <alexey@process-one.net>
%%% Purpose : ejabberd OTP application definition.
%%% Purpose : ejabberd's application callback module
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -29,10 +29,15 @@
-behaviour(application).
-export([start/2, stop/1, init/0]).
-export([start/2, prep_stop/1, stop/1, init/0]).
-include("ejabberd.hrl").
%%%
%%% Application API
%%%
start(normal, _Args) ->
ejabberd_loglevel:set(4),
application:start(sasl),
@@ -46,6 +51,7 @@ start(normal, _Args) ->
ejabberd_ctl:init(),
gen_mod:start(),
ejabberd_config:start(),
ejabberd_check:config(),
start(),
connect_nodes(),
Sup = ejabberd_sup:start_link(),
@@ -56,14 +62,27 @@ start(normal, _Args) ->
%eprof:start(),
%eprof:profile([self()]),
%fprof:trace(start, "/tmp/fprof"),
load_modules(),
start_modules(),
Sup;
start(_, _) ->
{error, badarg}.
stop(_StartArgs) ->
%% Prepare the application for termination.
%% This function is called when an application is about to be stopped,
%% before shutting down the processes of the application.
prep_stop(State) ->
stop_modules(),
State.
%% All the processes were killed when this function is called
stop(_State) ->
ok.
%%%
%%% Internal functions
%%%
start() ->
spawn_link(?MODULE, init, []).
@@ -109,7 +128,8 @@ db_init() ->
mnesia:start(),
mnesia:wait_for_tables(mnesia:system_info(local_tables), infinity).
load_modules() ->
%% Start all the modules in all the hosts
start_modules() ->
lists:foreach(
fun(Host) ->
case ejabberd_config:get_local_option({modules, Host}) of
@@ -123,6 +143,21 @@ load_modules() ->
end
end, ?MYHOSTS).
%% Stop all the modules in all the hosts
stop_modules() ->
lists:foreach(
fun(Host) ->
case ejabberd_config:get_local_option({modules, Host}) of
undefined ->
ok;
Modules ->
lists:foreach(
fun({Module, _Args}) ->
gen_mod:stop_module_keep_config(Host, Module)
end, Modules)
end
end, ?MYHOSTS).
connect_nodes() ->
case ejabberd_config:get_local_option(cluster_nodes) of
undefined ->
@@ -133,5 +168,3 @@ connect_nodes() ->
end, Nodes)
end.
+66 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 23 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -34,6 +34,8 @@
set_password/3,
check_password/3,
check_password/5,
check_password_with_authmodule/3,
check_password_with_authmodule/5,
try_register/3,
dirty_get_registered_users/0,
get_vh_registered_users/1,
@@ -42,6 +44,7 @@
get_vh_registered_users_number/2,
get_password/2,
get_password_s/2,
get_password_with_authmodule/2,
is_user_exists/2,
is_user_exists_in_other_modules/3,
remove_user/2,
@@ -73,18 +76,63 @@ plain_password_required(Server) ->
M:plain_password_required()
end, auth_modules(Server)).
%% @doc Check if the user and password can login in server.
%% @spec (User::string(), Server::string(), Password::string()) ->
%% true | false
check_password(User, Server, Password) ->
lists:any(
fun(M) ->
M:check_password(User, Server, Password)
end, auth_modules(Server)).
%% @doc Check if the user and password can login in server.
%% @spec (User::string(), Server::string(), Password::string(),
%% StreamID::string(), Digest::string()) ->
%% true | false
check_password(User, Server, Password, StreamID, Digest) ->
lists:any(
fun(M) ->
M:check_password(User, Server, Password, StreamID, Digest)
end, auth_modules(Server)).
%% @doc Check if the user and password can login in server.
%% The user can login if at least an authentication method accepts the user
%% and the password.
%% The first authentication method that accepts the credentials is returned.
%% @spec (User::string(), Server::string(), Password::string()) ->
%% {true, AuthModule} | false
%% where
%% AuthModule = ejabberd_auth_anonymous | ejabberd_auth_external
%% | ejabberd_auth_internal | ejabberd_auth_ldap
%% | ejabberd_auth_odbc | ejabberd_auth_pam
check_password_with_authmodule(User, Server, Password) ->
Res = lists:dropwhile(
fun(M) ->
not apply(M, check_password,
[User, Server, Password])
end, auth_modules(Server)),
case Res of
[] -> false;
[AuthMod | _] -> {true, AuthMod}
end.
check_password_with_authmodule(User, Server, Password, StreamID, Digest) ->
Res = lists:dropwhile(
fun(M) ->
not apply(M, check_password,
[User, Server, Password, StreamID, Digest])
end, auth_modules(Server)),
case Res of
[] -> false;
[AuthMod | _] -> {true, AuthMod}
end.
%% @spec (User::string(), Server::string(), Password::string()) ->
%% ok | {error, ErrorType}
%% where ErrorType = empty_password | not_allowed | invalid_jid
set_password(_User, _Server, "") ->
%% We do not allow empty password
{error, empty_password};
set_password(User, Server, Password) ->
lists:foldl(
fun(M, {error, _}) ->
@@ -93,6 +141,9 @@ set_password(User, Server, Password) ->
Res
end, {error, not_allowed}, auth_modules(Server)).
try_register(_User, _Server, "") ->
%% We do not allow empty password
{error, not_allowed};
try_register(User, Server, Password) ->
case is_user_exists(User,Server) of
true ->
@@ -157,6 +208,8 @@ get_vh_registered_users_number(Server, Opts) ->
end
end, auth_modules(Server))).
%% @doc Get the password of the user.
%% @spec (User::string(), Server::string()) -> Password::string()
get_password(User, Server) ->
lists:foldl(
fun(M, false) ->
@@ -173,6 +226,17 @@ get_password_s(User, Server) ->
Password
end.
%% @doc Get the password of the user and the auth module.
%% @spec (User::string(), Server::string()) ->
%% {Password::string(), AuthModule::atom()} | {false, none}
get_password_with_authmodule(User, Server) ->
lists:foldl(
fun(M, {false, _}) ->
{M:get_password(User, Server), M};
(_M, {Password, AuthModule}) ->
{Password, AuthModule}
end, {false, none}, auth_modules(Server)).
%% Returns true if the user exists in the DB or if an anonymous user is logged
%% under the given name
is_user_exists(User, Server) ->
@@ -206,7 +270,7 @@ ctl_process_get_registered(_Val, Host, ["registered-users"]) ->
NewLine = io_lib:format("~n", []),
SUsers = lists:sort(Users),
FUsers = lists:map(fun({U, _S}) -> [U, NewLine] end, SUsers),
io:format("~s", [FUsers]),
?PRINT("~s", [FUsers]),
{stop, ?STATUS_SUCCESS};
ctl_process_get_registered(Val, _Host, _Args) ->
Val.
+12 -6
View File
@@ -5,7 +5,7 @@
%%% Created : 17 Feb 2006 by Mickael Remond <mremond@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -141,11 +141,17 @@ remove_connection(SID, LUser, LServer) ->
mnesia:transaction(F).
%% Register connection
register_connection(SID, #jid{luser = LUser, lserver = LServer}, _) ->
US = {LUser, LServer},
mnesia:sync_dirty(
fun() -> mnesia:write(#anonymous{us = US, sid=SID})
end).
register_connection(SID, #jid{luser = LUser, lserver = LServer}, Info) ->
AuthModule = xml:get_attr_s(auth_module, Info),
case AuthModule == ?MODULE of
true ->
US = {LUser, LServer},
mnesia:sync_dirty(
fun() -> mnesia:write(#anonymous{us = US, sid=SID})
end);
false ->
ok
end.
%% Remove an anonymous user from the anonymous users table
unregister_connection(SID, #jid{luser = LUser, lserver = LServer}, _) ->
+5 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -61,7 +61,10 @@ check_password(User, Server, Password, _StreamID, _Digest) ->
check_password(User, Server, Password).
set_password(User, Server, Password) ->
extauth:set_password(User, Server, Password).
case extauth:set_password(User, Server, Password) of
true -> ok;
_ -> {error, unknown_problem}
end.
try_register(_User, _Server, _Password) ->
{error, not_allowed}.
+5 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -98,6 +98,8 @@ check_password(User, Server, Password, StreamID, Digest) ->
false
end.
%% @spec (User::string(), Server::string(), Password::string()) ->
%% ok | {error, invalid_jid}
set_password(User, Server, Password) ->
LUser = jlib:nodeprep(User),
LServer = jlib:nameprep(Server),
@@ -110,7 +112,8 @@ set_password(User, Server, Password) ->
mnesia:write(#passwd{us = US,
password = Password})
end,
mnesia:transaction(F)
{atomic, ok} = mnesia:transaction(F),
ok
end.
+10 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -48,6 +48,7 @@
try_register/3,
dirty_get_registered_users/0,
get_vh_registered_users/1,
get_vh_registered_users_number/1,
get_password/2,
get_password_s/2,
is_user_exists/2,
@@ -85,6 +86,10 @@ handle_info(_Info, State) ->
{noreply, State}.
%% -----
-define(LDAP_SEARCH_TIMEOUT, 5). % Timeout for LDAP search queries in seconds
%%%----------------------------------------------------------------------
%%% API
%%%----------------------------------------------------------------------
@@ -171,6 +176,9 @@ get_vh_registered_users(Server) ->
Result -> Result
end.
get_vh_registered_users_number(Server) ->
length(get_vh_registered_users(Server)).
get_password(_User, _Server) ->
false.
@@ -216,6 +224,7 @@ get_vh_registered_users_ldap(Server) ->
{ok, EldapFilter} ->
case eldap_pool:search(Eldap_ID, [{base, State#state.base},
{filter, EldapFilter},
{timeout, ?LDAP_SEARCH_TIMEOUT},
{attributes, SortedDNAttrs}]) of
#eldap_search_result{entries = Entries} ->
lists:flatmap(
+7 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 12 Dec 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -101,6 +101,8 @@ check_password(User, Server, Password, StreamID, Digest) ->
end
end.
%% @spec (User::string(), Server::string(), Password::string()) ->
%% ok | {error, invalid_jid}
set_password(User, Server, Password) ->
case jlib:nodeprep(User) of
error ->
@@ -109,7 +111,10 @@ set_password(User, Server, Password) ->
Username = ejabberd_odbc:escape(LUser),
Pass = ejabberd_odbc:escape(Password),
LServer = jlib:nameprep(Server),
catch odbc_queries:set_password_t(LServer, Username, Pass)
case catch odbc_queries:set_password_t(LServer, Username, Pass) of
{atomic, ok} -> ok;
Other -> {error, Other}
end
end.
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 5 Jul 2007 by Evgeniy Khramtsov <xram@jabber.ru>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+95 -55
View File
@@ -5,7 +5,7 @@
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -37,6 +37,7 @@
send_element/2,
socket_type/0,
get_presence/1,
get_subscribed/1,
get_subscribed_and_online/1]).
%% gen_fsm callbacks
@@ -56,6 +57,7 @@
-include("ejabberd.hrl").
-include("jlib.hrl").
-include("mod_privacy.hrl").
-define(SETS, gb_sets).
-define(DICT, dict).
@@ -84,8 +86,9 @@
pres_last, pres_pri,
pres_timestamp,
pres_invis = false,
privacy_list = none,
privacy_list = #userlist{},
conn = unknown,
auth_module = unknown,
ip,
lang}).
@@ -174,29 +177,40 @@ init([{SockMod, Socket}, Opts]) ->
(_) -> false
end, Opts),
IP = peerip(SockMod, Socket),
Socket1 =
if
TLSEnabled ->
SockMod:starttls(Socket, TLSOpts);
true ->
Socket
end,
SocketMonitor = SockMod:monitor(Socket1),
{ok, wait_for_stream, #state{socket = Socket1,
sockmod = SockMod,
socket_monitor = SocketMonitor,
zlib = Zlib,
tls = TLS,
tls_required = StartTLSRequired,
tls_enabled = TLSEnabled,
tls_options = TLSOpts,
streamid = new_id(),
access = Access,
shaper = Shaper,
ip = IP}, ?C2S_OPEN_TIMEOUT}.
%% Check if IP is blacklisted:
case is_ip_blacklisted(IP) of
true ->
?INFO_MSG("Connection attempt from blacklisted IP: ~s",
[jlib:ip_to_list(IP)]),
{stop, normal};
false ->
Socket1 =
if
TLSEnabled ->
SockMod:starttls(Socket, TLSOpts);
true ->
Socket
end,
SocketMonitor = SockMod:monitor(Socket1),
{ok, wait_for_stream, #state{socket = Socket1,
sockmod = SockMod,
socket_monitor = SocketMonitor,
zlib = Zlib,
tls = TLS,
tls_required = StartTLSRequired,
tls_enabled = TLSEnabled,
tls_options = TLSOpts,
streamid = new_id(),
access = Access,
shaper = Shaper,
ip = IP}, ?C2S_OPEN_TIMEOUT}
end.
%% Return list of all available resources of contacts,
%% in form [{JID, Caps}].
get_subscribed(FsmRef) ->
gen_fsm:sync_send_all_state_event(
FsmRef, get_subscribed, 1000).
get_subscribed_and_online(FsmRef) ->
gen_fsm:sync_send_all_state_event(
FsmRef, get_subscribed_and_online, 1000).
@@ -237,11 +251,11 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
cyrsasl:server_new(
"jabber", Server, "", [],
fun(U) ->
ejabberd_auth:get_password(
ejabberd_auth:get_password_with_authmodule(
U, Server)
end,
fun(U, P) ->
ejabberd_auth:check_password(
ejabberd_auth:check_password_with_authmodule(
U, Server, P)
end),
Mechs = lists:map(
@@ -342,9 +356,9 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
true ->
send_text(StateData, Header),
fsm_next_state(wait_for_auth,
StateData#state{
server = Server,
lang = Lang})
StateData#state{
server = Server,
lang = Lang})
end
end;
_ ->
@@ -429,17 +443,18 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
(acl:match_rule(StateData#state.server,
StateData#state.access, JID) == allow) of
true ->
case ejabberd_auth:check_password(
case ejabberd_auth:check_password_with_authmodule(
U, StateData#state.server, P,
StateData#state.streamid, D) of
true ->
{true, AuthModule} ->
?INFO_MSG(
"(~w) Accepted legacy authentication for ~s",
[StateData#state.socket,
jlib:jid_to_string(JID)]),
SID = {now(), self()},
Conn = get_conn_type(StateData),
Info = [{ip, StateData#state.ip}, {conn, Conn}],
Info = [{ip, StateData#state.ip}, {conn, Conn},
{auth_module, AuthModule}],
ejabberd_sm:open_session(
SID, U, StateData#state.server, R, Info),
Res1 = jlib:make_result_iq_reply(El),
@@ -458,7 +473,7 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
PrivList =
ejabberd_hooks:run_fold(
privacy_get_user_list, StateData#state.server,
none,
#userlist{},
[U, StateData#state.server]),
fsm_next_state(session_established,
StateData#state{
@@ -467,6 +482,7 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
jid = JID,
sid = SID,
conn = Conn,
auth_module = AuthModule,
pres_f = ?SETS:from_list(Fs1),
pres_t = ?SETS:from_list(Ts1),
privacy_list = PrivList});
@@ -673,12 +689,14 @@ wait_for_sasl_response({xmlstreamelement, El}, StateData) ->
{xmlelement, "success",
[{"xmlns", ?NS_SASL}], []}),
U = xml:get_attr_s(username, Props),
AuthModule = xml:get_attr_s(auth_module, Props),
?INFO_MSG("(~w) Accepted authentication for ~s",
[StateData#state.socket, U]),
fsm_next_state(wait_for_stream,
StateData#state{
streamid = new_id(),
authenticated = true,
auth_module = AuthModule,
user = U});
{continue, ServerOut, NewSASLState} ->
send_element(StateData,
@@ -789,7 +807,8 @@ wait_for_session({xmlstreamelement, El}, StateData) ->
jlib:jid_to_string(JID)]),
SID = {now(), self()},
Conn = get_conn_type(StateData),
Info = [{ip, StateData#state.ip}, {conn, Conn}],
Info = [{ip, StateData#state.ip}, {conn, Conn},
{auth_module, StateData#state.auth_module}],
ejabberd_sm:open_session(
SID, U, StateData#state.server, R, Info),
Res = jlib:make_result_iq_reply(El),
@@ -806,7 +825,7 @@ wait_for_session({xmlstreamelement, El}, StateData) ->
PrivList =
ejabberd_hooks:run_fold(
privacy_get_user_list, StateData#state.server,
none,
#userlist{},
[U, StateData#state.server]),
fsm_next_state(session_established,
StateData#state{
@@ -900,24 +919,18 @@ session_established({xmlstreamelement, El}, StateData) ->
StateData)
end;
"iq" ->
case StateData#state.privacy_list of
none ->
ejabberd_router:route(FromJID, ToJID, NewEl),
StateData;
_PrivList ->
case jlib:iq_query_info(NewEl) of
#iq{xmlns = ?NS_PRIVACY} = IQ ->
process_privacy_iq(
FromJID, ToJID, IQ, StateData);
_ ->
ejabberd_hooks:run(
user_send_packet,
Server,
[FromJID, ToJID, NewEl]),
ejabberd_router:route(
FromJID, ToJID, NewEl),
StateData
end
case jlib:iq_query_info(NewEl) of
#iq{xmlns = ?NS_PRIVACY} = IQ ->
process_privacy_iq(
FromJID, ToJID, IQ, StateData);
_ ->
ejabberd_hooks:run(
user_send_packet,
Server,
[FromJID, ToJID, NewEl]),
ejabberd_router:route(
FromJID, ToJID, NewEl),
StateData
end;
"message" ->
ejabberd_hooks:run(user_send_packet,
@@ -996,6 +1009,20 @@ handle_sync_event({get_presence}, _From, StateName, StateData) ->
Reply = {User, Resource, Show, Status},
fsm_reply(Reply, StateName, StateData);
handle_sync_event(get_subscribed, _From, StateName, StateData) ->
Subscribed = StateData#state.pres_f,
Online = StateData#state.pres_available,
Pred = fun(User, _Caps) ->
?SETS:is_element(jlib:jid_remove_resource(User),
Subscribed) orelse
?SETS:is_element(User, Subscribed)
end,
SubscribedAndOnline = ?DICT:filter(Pred, Online),
SubscribedWithCaps = ?SETS:fold(fun(User, Acc) ->
[{User, undefined}|Acc]
end, ?DICT:to_list(SubscribedAndOnline), Subscribed),
{reply, SubscribedWithCaps, StateName, StateData};
handle_sync_event(get_subscribed_and_online, _From, StateName, StateData) ->
Subscribed = StateData#state.pres_f,
Online = StateData#state.pres_available,
@@ -1419,7 +1446,13 @@ process_presence_probe(From, To, StateData) ->
allow ->
Pid=element(2, StateData#state.sid),
ejabberd_hooks:run(presence_probe_hook, StateData#state.server, [From, To, Pid]),
ejabberd_router:route(To, From, Packet)
%% Don't route a presence probe to oneself
case From == To of
false ->
ejabberd_router:route(To, From, Packet);
true ->
ok
end
end;
Cond2 ->
ejabberd_router:route(To, From,
@@ -1441,7 +1474,8 @@ presence_update(From, Packet, StateData) ->
StatusTag ->
xml:get_tag_cdata(StatusTag)
end,
Info = [{ip, StateData#state.ip},{conn, StateData#state.conn}],
Info = [{ip, StateData#state.ip}, {conn, StateData#state.conn},
{auth_module, StateData#state.auth_module}],
ejabberd_sm:unset_presence(StateData#state.sid,
StateData#state.user,
StateData#state.server,
@@ -1773,7 +1807,8 @@ roster_change(IJID, ISubscription, StateData) ->
update_priority(Priority, Packet, StateData) ->
Info = [{ip, StateData#state.ip},{conn, StateData#state.conn}],
Info = [{ip, StateData#state.ip}, {conn, StateData#state.conn},
{auth_module, StateData#state.auth_module}],
ejabberd_sm:set_presence(StateData#state.sid,
StateData#state.user,
StateData#state.server,
@@ -1901,7 +1936,8 @@ process_unauthenticated_stanza(StateData, El) ->
Res = ejabberd_hooks:run_fold(c2s_unauthenticated_iq,
StateData#state.server,
empty,
[StateData#state.server, IQ]),
[StateData#state.server, IQ,
StateData#state.ip]),
case Res of
empty ->
% The only reasonable IQ's here are auth and register IQ's
@@ -1944,3 +1980,7 @@ fsm_reply(Reply, session_established, StateData) ->
{reply, Reply, session_established, StateData, ?C2S_HIBERNATE_TIMEOUT};
fsm_reply(Reply, StateName, StateData) ->
{reply, Reply, StateName, StateData, ?C2S_OPEN_TIMEOUT}.
%% Used by c2s blacklist plugins
is_ip_blacklisted({IP,_Port}) ->
ejabberd_hooks:run_fold(check_bl_c2s, false, [IP]).
+1 -1
View File
@@ -6,7 +6,7 @@
%%% Created : 2 Nov 2007 by Mickael Remond <mremond@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+112
View File
@@ -0,0 +1,112 @@
%%%----------------------------------------------------------------------
%%% File : ejabberd_check.erl
%%% Author : Mickael Remond <mremond@process-one.net>
%%% Purpose : Check ejabberd configuration and
%%% Created : 27 Feb 2008 by Mickael Remond <mremond@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%%% 02111-1307 USA
%%%
%%%----------------------------------------------------------------------
-module(ejabberd_check).
-export([libs/0, config/0]).
-include("ejabberd.hrl").
-include("ejabberd_config.hrl").
-compile([export_all]).
%% TODO:
%% We want to implement library checking at launch time to issue
%% human readable user messages.
libs() ->
ok.
%% @doc Consistency check on ejabberd configuration
config() ->
check_database_modules().
check_database_modules() ->
[check_database_module(M)||M<-get_db_used()].
check_database_module(odbc) ->
check_modules(odbc, [odbc, odbc_app, odbc_sup, ejabberd_odbc, ejabberd_odbc_sup, odbc_queries]);
check_database_module(mysql) ->
check_modules(mysql, [mysql, mysql_auth, mysql_conn, mysql_recv]);
check_database_module(pgsql) ->
check_modules(pgsql, [pgsql, pgsql_proto, pgsql_tcp, pgsql_util]).
%% @doc Issue a critical error and throw an exit if needing module is
%% missing.
check_modules(DB, Modules) ->
case get_missing_modules(Modules) of
[] ->
ok;
MissingModules when is_list(MissingModules) ->
?CRITICAL_MSG("ejabberd is configured to use '~p', but the following Erlang modules are not installed: '~p'", [DB, MissingModules]),
exit(database_module_missing)
end.
%% @doc Return the list of undefined modules
get_missing_modules(Modules) ->
lists:filter(fun(Module) ->
case catch Module:module_info() of
{'EXIT', {undef, _}} ->
true;
_ -> false
end
end, Modules).
%% @doc Return the list of databases used
get_db_used() ->
%% Retrieve domains with a database configured:
Domains =
ets:match(local_config, #local_config{key={odbc_server, '$1'},
value='$2'}),
%% Check that odbc is the auth method used for those domains:
%% and return the database name
DBs = lists:foldr(
fun([Domain, DB], Acc) ->
case check_odbc_option(
ejabberd_config:get_local_option(
{auth_method, Domain})) of
true -> [get_db_type(DB)|Acc];
_ -> Acc
end
end,
[], Domains),
lists:usort(DBs).
%% @doc Depending in the DB definition, return which type of DB this is
%% Note that MSSQL is detected as ODBC.
%% @spec (DB) -> mysql | pgsql | odbc
get_db_type(DB) when is_tuple(DB) ->
element(1, DB);
get_db_type(DB) when is_list(DB) ->
odbc.
%% @doc Return true if odbc option is used
check_odbc_option(odbc) ->
true;
check_odbc_option(AuthMethods) when is_list(AuthMethods) ->
lists:member(odbc, AuthMethods);
check_odbc_option(_) ->
false.
+18 -36
View File
@@ -5,7 +5,7 @@
%%% Created : 14 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -64,9 +64,15 @@ load_file(File) ->
State = lists:foldl(fun search_hosts/2, #state{}, Terms),
Res = lists:foldl(fun process_term/2, State, Terms),
set_opts(Res);
{error, {_LineNumber, erl_parse, _ParseMessage} = Reason} ->
ExitText = lists:flatten(File ++ " approximately in the line "
++ file:format_error(Reason)),
?ERROR_MSG("Problem loading ejabberd config file ~n~s", [ExitText]),
exit(ExitText);
{error, Reason} ->
?ERROR_MSG("Can't load config file ~p: ~p", [File, Reason]),
exit(File ++ ": " ++ file:format_error(Reason))
ExitText = lists:flatten(File ++ ": " ++ file:format_error(Reason)),
?ERROR_MSG("Problem loading ejabberd config file ~n~s", [ExitText]),
exit(ExitText)
end.
search_hosts(Term, State) ->
@@ -156,6 +162,8 @@ process_term(Term, State) ->
add_option({domain_balancing_component_number, Domain}, N, State);
{watchdog_admins, Admins} ->
add_option(watchdog_admins, Admins, State);
{registration_timeout, Timeout} ->
add_option(registration_timeout, Timeout, State);
{loglevel, Loglevel} ->
ejabberd_loglevel:set(Loglevel),
State;
@@ -182,7 +190,6 @@ process_host_term(Term, Host, State) ->
{hosts, _Hosts} ->
State;
{odbc_server, ODBC_server} ->
odbc_modules_found = check_odbc_modules(ODBC_server),
add_option({odbc_server, Host}, ODBC_server, State);
{Opt, Val} ->
add_option({Opt, Host}, Val, State)
@@ -212,11 +219,16 @@ add_option(Opt, Val, State) ->
end
end.
compact(Opt, Val, [], Os) ->
compact({OptName, Host} = Opt, Val, [], Os) ->
?WARNING_MSG("The option '~p' is defined for the host ~p using host_config "
"before the global '~p' option. This host_config option may get overwritten.", [OptName, Host, OptName]),
[#local_config{key = Opt, value = Val}] ++ Os;
%% Traverse the list of the options already parsed
compact(Opt, Val, [O | Os1], Os2) ->
case O#local_config.key of
case catch O#local_config.key of
%% If the key of a local_config matches the Opt that wants to be added
Opt ->
%% Then prepend the new value to the list of old values
Os2 ++ [#local_config{key = Opt,
value = Val++O#local_config.value}
] ++ Os1;
@@ -309,33 +321,3 @@ get_vh_by_auth_method(AuthMethod) ->
mnesia:dirty_select(local_config,
[{#local_config{key = {auth_method, '$1'},
value=AuthMethod},[],['$1']}]).
check_odbc_modules(ODBC_server) ->
case catch check_odbc_modules2(ODBC_server) of
{'EXIT', {undef, [{Module, module_info, []} | _]}} ->
?CRITICAL_MSG("ejabberd is configured to use ODBC, but the Erlang module '~p' is not installed.", [Module]),
odbc_module_not_found;
_ -> odbc_modules_found
end.
check_odbc_modules2(ODBC_server) ->
check_modules_exists([ejabberd_odbc, ejabberd_odbc_sup, odbc_queries]),
case ODBC_server of
{mysql, _Server, _DB, _Username, _Password} ->
check_modules_exists([mysql, mysql_auth, mysql_conn, mysql_recv]);
{mysql, _Server, _Port, _DB, _Username, _Password} ->
check_modules_exists([mysql, mysql_auth, mysql_conn, mysql_recv]);
{pgsql, _Server, _DB, _Username, _Password} ->
check_modules_exists([pgsql, pgsql_proto, pgsql_tcp, pgsql_util]);
{pgsql, _Server, _Port, _DB, _Username, _Password} ->
check_modules_exists([pgsql, pgsql_proto, pgsql_tcp, pgsql_util]);
Server when is_list(Server) ->
ok
end.
check_modules_exists(Modules) ->
[true = is_list(Module:module_info()) || Module <- Modules].
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+31 -30
View File
@@ -5,7 +5,7 @@
%%% Created : 11 Jan 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -30,6 +30,7 @@
-export([start/0,
init/0,
process/1,
dump_to_textfile/1,
register_commands/3,
register_commands/4,
unregister_commands/3,
@@ -58,7 +59,7 @@ start() ->
Node = list_to_atom(SNode1),
Status = case rpc:call(Node, ?MODULE, process, [Args]) of
{badrpc, Reason} ->
io:format("RPC failed on the node ~p: ~p~n",
?PRINT("RPC failed on the node ~p: ~p~n",
[Node, Reason]),
?STATUS_BADRPC;
S ->
@@ -77,14 +78,14 @@ init() ->
process(["status"]) ->
{InternalStatus, ProvidedStatus} = init:get_status(),
io:format("Node ~p is ~p. Status: ~p~n",
?PRINT("Node ~p is ~p. Status: ~p~n",
[node(), InternalStatus, ProvidedStatus]),
case lists:keysearch(ejabberd, 1, application:which_applications()) of
false ->
io:format("ejabberd is not running~n", []),
?PRINT("ejabberd is not running~n", []),
?STATUS_ERROR;
{value,_Version} ->
io:format("ejabberd is running~n", []),
?PRINT("ejabberd is running~n", []),
?STATUS_SUCCESS
end;
@@ -105,11 +106,11 @@ process(["register", User, Server, Password]) ->
{atomic, ok} ->
?STATUS_SUCCESS;
{atomic, exists} ->
io:format("User ~p already registered at node ~p~n",
?PRINT("User ~p already registered at node ~p~n",
[User ++ "@" ++ Server, node()]),
?STATUS_ERROR;
{error, Reason} ->
io:format("Can't register user ~p at node ~p: ~p~n",
?PRINT("Can't register user ~p at node ~p: ~p~n",
[User ++ "@" ++ Server, node(), Reason]),
?STATUS_ERROR
end;
@@ -117,7 +118,7 @@ process(["register", User, Server, Password]) ->
process(["unregister", User, Server]) ->
case ejabberd_auth:remove_user(User, Server) of
{error, Reason} ->
io:format("Can't unregister user ~p at node ~p: ~p~n",
?PRINT("Can't unregister user ~p at node ~p: ~p~n",
[User ++ "@" ++ Server, node(), Reason]),
?STATUS_ERROR;
_ ->
@@ -129,7 +130,7 @@ process(["backup", Path]) ->
ok ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't store backup in ~p at node ~p: ~p~n",
?PRINT("Can't store backup in ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR
end;
@@ -139,7 +140,7 @@ process(["dump", Path]) ->
ok ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't store dump in ~p at node ~p: ~p~n",
?PRINT("Can't store dump in ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR
end;
@@ -149,7 +150,7 @@ process(["load", Path]) ->
{atomic, ok} ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't load dump in ~p at node ~p: ~p~n",
?PRINT("Can't load dump in ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR
end;
@@ -159,15 +160,15 @@ process(["restore", Path]) ->
{atomic, _} ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't restore backup from ~p at node ~p: ~p~n",
?PRINT("Can't restore backup from ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR;
{aborted,{no_exists,Table}} ->
io:format("Can't restore backup from ~p at node ~p: Table ~p does not exist.~n",
?PRINT("Can't restore backup from ~p at node ~p: Table ~p does not exist.~n",
[filename:absname(Path), node(), Table]),
?STATUS_ERROR;
{aborted,enoent} ->
io:format("Can't restore backup from ~p at node ~p: File not found.~n",
?PRINT("Can't restore backup from ~p at node ~p: File not found.~n",
[filename:absname(Path), node()]),
?STATUS_ERROR
end;
@@ -177,7 +178,7 @@ process(["install-fallback", Path]) ->
ok ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't install fallback from ~p at node ~p: ~p~n",
?PRINT("Can't install fallback from ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR
end;
@@ -187,7 +188,7 @@ process(["import-file", Path]) ->
ok ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't import jabberd 1.4 spool file ~p at node ~p: ~p~n",
?PRINT("Can't import jabberd 1.4 spool file ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR
end;
@@ -197,7 +198,7 @@ process(["import-dir", Path]) ->
ok ->
?STATUS_SUCCESS;
{error, Reason} ->
io:format("Can't import jabberd 1.4 spool dir ~p at node ~p: ~p~n",
?PRINT("Can't import jabberd 1.4 spool dir ~p at node ~p: ~p~n",
[filename:absname(Path), node(), Reason]),
?STATUS_ERROR
end;
@@ -207,7 +208,7 @@ process(["delete-expired-messages"]) ->
?STATUS_SUCCESS;
process(["mnesia"]) ->
io:format("~p~n", [mnesia:system_info(all)]),
?PRINT("~p~n", [mnesia:system_info(all)]),
?STATUS_SUCCESS;
process(["mnesia", "info"]) ->
@@ -216,30 +217,30 @@ process(["mnesia", "info"]) ->
process(["mnesia", Arg]) when is_list(Arg) ->
case catch mnesia:system_info(list_to_atom(Arg)) of
{'EXIT', Error} -> io:format("Error: ~p~n", [Error]);
Return -> io:format("~p~n", [Return])
{'EXIT', Error} -> ?PRINT("Error: ~p~n", [Error]);
Return -> ?PRINT("~p~n", [Return])
end,
?STATUS_SUCCESS;
process(["delete-old-messages", Days]) ->
case catch list_to_integer(Days) of
{'EXIT',{Reason, _Stack}} ->
io:format("Can't delete old messages (~p). Please pass an integer as parameter.~n",
?PRINT("Can't delete old messages (~p). Please pass an integer as parameter.~n",
[Reason]),
?STATUS_ERROR;
Integer when Integer >= 0 ->
{atomic, _} = mod_offline:remove_old_messages(Integer),
io:format("Removed messages older than ~s days~n", [Days]),
?PRINT("Removed messages older than ~s days~n", [Days]),
?STATUS_SUCCESS;
_Integer ->
io:format("Can't delete old messages. Please pass a positive integer as parameter.~n", []),
?PRINT("Can't delete old messages. Please pass a positive integer as parameter.~n", []),
?STATUS_ERROR
end;
process(["vhost", H | Args]) ->
case jlib:nameprep(H) of
false ->
io:format("Bad hostname: ~p~n", [H]),
?PRINT("Bad hostname: ~p~n", [H]),
?STATUS_ERROR;
Host ->
case ejabberd_hooks:run_fold(
@@ -294,7 +295,7 @@ print_usage() ->
[" ", Cmd, string:chars($\s, MaxCmdLen - length(Cmd) + 2),
Desc, NewLine]
end, CmdDescs),
io:format(
?PRINT(
"Usage: ejabberdctl [--node nodename] command [options]~n"
"~n"
"Available commands in this ejabberd node:~n"
@@ -303,8 +304,8 @@ print_usage() ->
"Examples:~n"
" ejabberdctl restart~n"
" ejabberdctl --node ejabberd@host restart~n"
" ejabberdctl vhost jabber.example.org ...~n"
).
" ejabberdctl vhost jabber.example.org ...~n",
[]).
print_vhost_usage(Host) ->
CmdDescs =
@@ -327,15 +328,15 @@ print_vhost_usage(Host) ->
[" ", Cmd, string:chars($\s, MaxCmdLen - length(Cmd) + 2),
Desc, NewLine]
end, CmdDescs),
io:format(
?PRINT(
"Usage: ejabberdctl [--node nodename] vhost hostname command [options]~n"
"~n"
"Available commands in this ejabberd node and this vhost:~n"
++ FmtCmdDescs ++
"~n"
"Examples:~n"
" ejabberdctl vhost "++Host++" registered-users~n"
).
" ejabberdctl vhost "++Host++" registered-users~n",
[]).
register_commands(CmdDescs, Module, Function) ->
ets:insert(ejabberd_ctl_cmds, CmdDescs),
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 23 Aug 2006 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 8 Aug 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 16 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+9 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 30 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -37,6 +37,7 @@
register_iq_handler/5,
register_iq_response_handler/4,
unregister_iq_handler/2,
unregister_iq_response_handler/2,
refresh_iq_handlers/0,
bounce_resource_packet/3
]).
@@ -138,6 +139,9 @@ register_iq_handler(Host, XMLNS, Module, Fun) ->
register_iq_handler(Host, XMLNS, Module, Fun, Opts) ->
ejabberd_local ! {register_iq_handler, Host, XMLNS, Module, Fun, Opts}.
unregister_iq_response_handler(Host, ID) ->
ejabberd_local ! {unregister_iq_response_handler, Host, ID}.
unregister_iq_handler(Host, XMLNS) ->
ejabberd_local ! {unregister_iq_handler, Host, XMLNS}.
@@ -171,6 +175,7 @@ init([]) ->
mnesia:create_table(iq_response,
[{ram_copies, [node()]},
{attributes, record_info(fields, iq_response)}]),
mnesia:add_table_copy(iq_response, node(), ram_copies),
{ok, #state{}}.
%%--------------------------------------------------------------------
@@ -213,6 +218,9 @@ handle_info({route, From, To, Packet}, State) ->
handle_info({register_iq_response_handler, _Host, ID, Module, Function}, State) ->
mnesia:dirty_write(#iq_response{id = ID, module = Module, function = Function}),
{noreply, State};
handle_info({unregister_iq_response_handler, _Host, ID}, State) ->
mnesia:dirty_delete({iq_response, ID}),
{noreply, State};
handle_info({register_iq_handler, Host, XMLNS, Module, Function}, State) ->
ets:insert(?IQTABLE, {{XMLNS, Host}, Module, Function}),
catch mod_disco:register_feature(Host, XMLNS),
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 23 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+4 -2
View File
@@ -9,7 +9,7 @@
%%% Created : 29 Nov 2006 by Mickael Remond <mremond@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -33,6 +33,8 @@
-export([set/1]).
-include("ejabberd.hrl").
-define(LOGMODULE, "error_logger").
%% Error levels:
@@ -80,7 +82,7 @@ load_logger(Forms, Mod, Loglevel) ->
{ok, M, Bin} ->
code:load_binary(M, Fname, Bin);
Error ->
io:format("Error ~p~n", [Error])
?CRITICAL_MSG("Error ~p~n", [Error])
end.
%% --------------------------------------------------------------
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 1 Nov 2006 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+5 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 10 Nov 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -293,11 +293,14 @@ activate_socket(#state{socket = Socket,
process_data(Data,
#state{xml_stream_state = XMLStreamState,
shaper_state = ShaperState} = State) ->
shaper_state = ShaperState,
c2s_pid = C2SPid} = State) ->
?DEBUG("Received XML on stream = ~p", [binary_to_list(Data)]),
XMLStreamState1 = xml_stream:parse(XMLStreamState, Data),
{NewShaperState, Pause} = shaper:update(ShaperState, size(Data)),
if
C2SPid == undefined ->
ok;
Pause > 0 ->
erlang:start_timer(Pause, self(), activate);
true ->
+4 -4
View File
@@ -5,7 +5,7 @@
%%% Created : 27 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -150,9 +150,9 @@ unregister_route(Domain) ->
mnesia:transaction(F);
_ ->
F = fun() ->
case mnesia:match(#route{domain = LDomain,
pid = Pid,
_ = '_'}) of
case mnesia:match_object(#route{domain=LDomain,
pid = Pid,
_ = '_'}) of
[R] ->
I = R#route.local_hint,
mnesia:write(
+12 -3
View File
@@ -5,7 +5,7 @@
%%% Created : 7 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -34,6 +34,7 @@
route/3,
have_connection/1,
has_key/2,
get_connections_pids/1,
try_register/1,
remove_connection/3,
dirty_get_connections/0,
@@ -108,6 +109,14 @@ has_key(FromTo, Key) ->
true
end.
get_connections_pids(FromTo) ->
case catch mnesia:dirty_read(s2s, FromTo) of
L when is_list(L) ->
[Connection#s2s.pid || Connection <- L];
_ ->
[]
end.
try_register(FromTo) ->
Key = randoms:get_string(),
MaxS2SConnectionsNumber = max_s2s_connections_number(FromTo),
@@ -415,11 +424,11 @@ send_element(Pid, El) ->
ctl_process(_Val, ["incoming-s2s-number"]) ->
N = length(supervisor:which_children(ejabberd_s2s_in_sup)),
io:format("~p~n", [N]),
?PRINT("~p~n", [N]),
{stop, ?STATUS_SUCCESS};
ctl_process(_Val, ["outgoing-s2s-number"]) ->
N = length(supervisor:which_children(ejabberd_s2s_out_sup)),
io:format("~p~n", [N]),
?PRINT("~p~n", [N]),
{stop, ?STATUS_SUCCESS};
ctl_process(Val, _Args) ->
Val.
+8 -3
View File
@@ -5,7 +5,7 @@
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -50,9 +50,13 @@
-include("jlib.hrl").
-ifdef(SSL39).
-include_lib("ssl/include/ssl_pkix.hrl").
-define(PKIXEXPLICIT, 'OTP-PKIX').
-define(PKIXIMPLICIT, 'OTP-PKIX').
-else.
-include_lib("ssl/include/PKIX1Explicit88.hrl").
-include_lib("ssl/include/PKIX1Implicit88.hrl").
-define(PKIXEXPLICIT, 'PKIX1Explicit88').
-define(PKIXIMPLICIT, 'PKIX1Implicit88').
-endif.
-include("XmppAddr.hrl").
@@ -348,6 +352,7 @@ stream_established({xmlstreamelement, El}, StateData) ->
case {ejabberd_s2s:allow_host(To, From),
lists:member(LTo, ejabberd_router:dirty_get_all_domains())} of
{true, true} ->
ejabberd_s2s_out:terminate_if_waiting_delay(To, From),
ejabberd_s2s_out:start(To, From,
{verify, self(),
Key, StateData#state.streamid}),
@@ -603,7 +608,7 @@ get_cert_domains(Cert) ->
lists:flatmap(
fun(#'AttributeTypeAndValue'{type = ?'id-at-commonName',
value = Val}) ->
case 'PKIX1Explicit88':decode('X520CommonName', Val) of
case ?PKIXEXPLICIT:decode('X520CommonName', Val) of
{ok, {_, D1}} ->
D = if
is_list(D1) -> D1;
@@ -637,7 +642,7 @@ get_cert_domains(Cert) ->
is_binary(Val) -> Val;
true -> Val
end,
case 'PKIX1Implicit88':decode('SubjectAltName', BVal) of
case ?PKIXIMPLICIT:decode('SubjectAltName', BVal) of
{ok, SANs} ->
lists:flatmap(
fun({otherName,
+65 -5
View File
@@ -5,7 +5,7 @@
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -33,6 +33,7 @@
-export([start/3,
start_link/3,
start_connection/1,
terminate_if_waiting_delay/2,
stop_connection/1]).
%% p1_fsm callbacks (same as gen_fsm)
@@ -67,6 +68,7 @@
db_enabled = true,
try_auth = true,
myname, server, queue,
delay_to_retry = undefined_delay,
new = false, verify = false,
timer}).
@@ -90,7 +92,11 @@
%% Only change this value if you now what your are doing:
-define(FSMLIMITS,[]).
%% -define(FSMLIMITS, [{max_queue, 2000}]).
-define(FSMTIMEOUT, 5000).
-define(FSMTIMEOUT, 30000).
%% Maximum delay to wait before retrying to connect after a failed attempt.
%% Specified in miliseconds. Default value is 5 minutes.
-define(MAX_RETRY_DELAY, 300000).
-define(STREAM_HEADER,
"<?xml version='1.0'?>"
@@ -217,7 +223,7 @@ open_socket(init, StateData) ->
{error, _Reason} ->
?INFO_MSG("s2s connection: ~s -> ~s (remote server not found)",
[StateData#state.myname, StateData#state.server]),
wait_before_reconnect(StateData, 300000)
wait_before_reconnect(StateData)
%%{stop, normal, StateData}
end;
open_socket(stop, StateData) ->
@@ -312,6 +318,9 @@ wait_for_validation({xmlstreamelement, El}, StateData) ->
send_queue(StateData, StateData#state.queue),
?INFO_MSG("Connection established: ~s -> ~s",
[StateData#state.myname, StateData#state.server]),
ejabberd_hooks:run(s2s_connect_hook,
[StateData#state.myname,
StateData#state.server]),
{next_state, stream_established,
StateData#state{queue = queue:new()}};
_ ->
@@ -366,6 +375,14 @@ wait_for_validation({xmlstreamerror, _}, StateData) ->
?INVALID_XML_ERR ++ ?STREAM_TRAILER),
{stop, normal, StateData};
wait_for_validation(timeout, #state{verify = {VPid, VKey, SID}} = StateData)
when is_pid(VPid) and is_list(VKey) and is_list(SID) ->
%% This is an auxiliary s2s connection for dialback.
%% This timeout is normal and doesn't represent a problem.
?DEBUG("wait_for_validation: ~s -> ~s (timeout in verify connection)",
[StateData#state.myname, StateData#state.server]),
{stop, normal, StateData};
wait_for_validation(timeout, StateData) ->
?INFO_MSG("wait_for_validation: ~s -> ~s (connect timeout)",
[StateData#state.myname, StateData#state.server]),
@@ -420,6 +437,9 @@ wait_for_features({xmlstreamelement, El}, StateData) ->
send_queue(StateData, StateData#state.queue),
?INFO_MSG("Connection established: ~s -> ~s",
[StateData#state.myname, StateData#state.server]),
ejabberd_hooks:run(s2s_connect_hook,
[StateData#state.myname,
StateData#state.server]),
{next_state, stream_established,
StateData#state{queue = queue:new()}};
SASLEXT and StateData#state.try_auth and
@@ -762,6 +782,12 @@ handle_info({timeout, Timer, _}, _StateName,
?INFO_MSG("Closing connection with ~s: timeout", [StateData#state.server]),
{stop, normal, StateData};
handle_info(terminate_if_waiting_before_retry, wait_before_retry, StateData) ->
{stop, normal, StateData};
handle_info(terminate_if_waiting_before_retry, StateName, StateData) ->
{next_state, StateName, StateData, get_timeout_interval(StateName)};
handle_info(_, StateName, StateData) ->
{next_state, StateName, StateData, get_timeout_interval(StateName)}.
@@ -983,7 +1009,7 @@ log_s2s_out(false, _, _) -> ok;
log_s2s_out(_, Myname, Server) ->
?INFO_MSG("Trying to open s2s connection: ~s -> ~s",[Myname, Server]).
%% Calcultate timeout depending on which state we are in:
%% Calculate timeout depending on which state we are in:
%% Can return integer > 0 | infinity
get_timeout_interval(StateName) ->
case StateName of
@@ -999,11 +1025,45 @@ get_timeout_interval(StateName) ->
%% This function is intended to be called at the end of a state
%% function that want to wait for a reconnect delay before stopping.
wait_before_reconnect(StateData, Delay) ->
wait_before_reconnect(StateData) ->
%% bounce queue manage by process and Erlang message queue
bounce_queue(StateData#state.queue, ?ERR_REMOTE_SERVER_NOT_FOUND),
bounce_messages(?ERR_REMOTE_SERVER_NOT_FOUND),
cancel_timer(StateData#state.timer),
Delay = case StateData#state.delay_to_retry of
undefined_delay ->
%% The initial delay is random between 1 and 15 seconds
%% Return a random integer between 1000 and 15000
{_, _, MicroSecs} = now(),
(MicroSecs rem 14000) + 1000;
D1 ->
%% Duplicate the delay with each successive failed
%% reconnection attempt, but don't exceed the max
lists:min([D1 * 2, get_max_retry_delay()])
end,
Timer = erlang:start_timer(Delay, self(), []),
{next_state, wait_before_retry, StateData#state{timer=Timer,
delay_to_retry = Delay,
queue = queue:new()}}.
%% @doc Get the maximum allowed delay for retry to reconnect (in miliseconds).
%% The default value is 5 minutes.
%% The option {s2s_max_retry_delay, Seconds} can be used (in seconds).
%% @spec () -> integer()
get_max_retry_delay() ->
case ejabberd_config:get_local_option(s2s_max_retry_delay) of
Seconds when is_integer(Seconds) ->
Seconds*1000;
_ ->
?MAX_RETRY_DELAY
end.
%% Terminate s2s_out connections that are in state wait_before_retry
terminate_if_waiting_delay(From, To) ->
FromTo = {From, To},
Pids = ejabberd_s2s:get_connections_pids(FromTo),
lists:foreach(
fun(Pid) ->
Pid ! terminate_if_waiting_before_retry
end,
Pids).
+10 -5
View File
@@ -1,11 +1,11 @@
%%%----------------------------------------------------------------------
%%% File : ejabberd_service.erl
%%% Author : Alexey Shchepin <alexey@process-one.net>
%%% Purpose : External component management
%%% Purpose : External component management (XEP-0114)
%%% Created : 6 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -73,7 +73,8 @@
-define(STREAM_TRAILER, "</stream:stream>").
-define(INVALID_HEADER_ERR,
"<stream:stream>"
"<stream:stream "
"xmlns:stream='http://etherx.jabber.org/streams'>"
"<stream:error>Invalid Stream Header</stream:error>"
"</stream:stream>"
).
@@ -168,11 +169,15 @@ init([{SockMod, Socket}, Opts]) ->
%%----------------------------------------------------------------------
wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) ->
% TODO
case xml:get_attr_s("xmlns", Attrs) of
"jabber:component:accept" ->
%% Note: XEP-0114 requires to check that destination is a Jabber
%% component served by this Jabber server.
%% However several transports don't respect that,
%% so ejabberd doesn't check 'to' attribute (EJAB-717)
To = xml:get_attr_s("to", Attrs),
Header = io_lib:format(?STREAM_HEADER,
[StateData#state.streamid, ?MYNAME]),
[StateData#state.streamid, xml:crypt(To)]),
send_text(StateData, Header),
{next_state, wait_for_handshake, StateData};
_ ->
+4 -4
View File
@@ -5,7 +5,7 @@
%%% Created : 24 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -652,18 +652,18 @@ ctl_process(_Val, ["connected-users"]) ->
NewLine = io_lib:format("~n", []),
SUSRs = lists:sort(USRs),
FUSRs = lists:map(fun({U, S, R}) -> [U, $@, S, $/, R, NewLine] end, SUSRs),
io:format("~s", [FUSRs]),
?PRINT("~s", [FUSRs]),
{stop, ?STATUS_SUCCESS};
ctl_process(_Val, ["connected-users-number"]) ->
N = length(dirty_get_sessions_list()),
io:format("~p~n", [N]),
?PRINT("~p~n", [N]),
{stop, ?STATUS_SUCCESS};
ctl_process(_Val, ["user-resources", User, Server]) ->
Resources = get_user_resources(User, Server),
NewLine = io_lib:format("~n", []),
SResources = lists:sort(Resources),
FResources = lists:map(fun(R) -> [R, NewLine] end, SResources),
io:format("~s", [FResources]),
?PRINT("~s", [FResources]),
{stop, ?STATUS_SUCCESS};
ctl_process(Val, _Args) ->
Val.
+19 -11
View File
@@ -5,7 +5,7 @@
%%% Created : 23 Aug 2006 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -65,19 +65,27 @@ start(Module, SockMod, Socket, Opts) ->
SocketData = #socket_state{sockmod = SockMod,
socket = Socket,
receiver = Receiver},
{ok, Pid} = Module:start({?MODULE, SocketData}, Opts),
case SockMod:controlling_process(Socket, Receiver) of
ok ->
ok;
case Module:start({?MODULE, SocketData}, Opts) of
{ok, Pid} ->
case SockMod:controlling_process(Socket, Receiver) of
ok ->
ok;
{error, _Reason} ->
SockMod:close(Socket)
end,
ejabberd_receiver:become_controller(Receiver, Pid);
{error, _Reason} ->
SockMod:close(Socket)
end,
ejabberd_receiver:become_controller(Receiver, Pid);
end;
raw ->
{ok, Pid} = Module:start({SockMod, Socket}, Opts),
case SockMod:controlling_process(Socket, Pid) of
ok ->
ok;
case Module:start({SockMod, Socket}, Opts) of
{ok, Pid} ->
case SockMod:controlling_process(Socket, Pid) of
ok ->
ok;
{error, _Reason} ->
SockMod:close(Socket)
end;
{error, _Reason} ->
SockMod:close(Socket)
end
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 21 Mar 2007 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 18 Jul 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+10 -8
View File
@@ -5,7 +5,7 @@
%%% Created : 27 Jan 2006 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -30,6 +30,8 @@
%% API
-export([update/0, update_info/0]).
-include("ejabberd.hrl").
%%====================================================================
%% API
%%====================================================================
@@ -40,7 +42,7 @@ update() ->
release_handler_1:eval_script(
LowLevelScript, [],
[{ejabberd, "", filename:join(Dir, "..")}]),
io:format("eval: ~p~n", [Eval]),
?INFO_MSG("eval: ~p~n", [Eval]),
Eval;
{error, Reason} ->
{error, Reason}
@@ -55,28 +57,28 @@ update_info() ->
UpdatedBeams =
lists:filter(
fun(Module) ->
{ok, {Module, [NewVsn]}} =
{ok, {Module, NewVsn}} =
beam_lib:version(code:which(Module)),
case code:is_loaded(Module) of
{file, _} ->
Attrs = Module:module_info(attributes),
{value, {vsn, [CurVsn]}} =
{value, {vsn, CurVsn}} =
lists:keysearch(vsn, 1, Attrs),
NewVsn /= CurVsn;
false ->
false
end
end, Beams),
io:format("beam files: ~p~n", [UpdatedBeams]),
?INFO_MSG("beam files: ~p~n", [UpdatedBeams]),
Script = make_script(UpdatedBeams),
io:format("script: ~p~n", [Script]),
?INFO_MSG("script: ~p~n", [Script]),
LowLevelScript = make_low_level_script(UpdatedBeams, Script),
io:format("low level script: ~p~n", [LowLevelScript]),
?INFO_MSG("low level script: ~p~n", [LowLevelScript]),
Check =
release_handler_1:check_script(
LowLevelScript,
[{ejabberd, "", filename:join(Dir, "..")}]),
io:format("check: ~p~n", [Check]),
?INFO_MSG("check: ~p~n", [Check]),
{ok, Dir, UpdatedBeams, Script, LowLevelScript, Check};
{error, Reason} ->
{error, Reason}
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 19 Jan 2006 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* ejabberd, Copyright (C) 2002-2008 Process-one
* ejabberd, Copyright (C) 2002-2008 ProcessOne
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -107,14 +107,14 @@ static int ejabberd_zlib_drv_control(ErlDrvData handle,
b = driver_alloc_binary(size);
b->orig_bytes[0] = 0;
d->d_stream->next_in = buf;
d->d_stream->next_in = (unsigned char *)buf;
d->d_stream->avail_in = len;
d->d_stream->avail_out = 0;
err = Z_OK;
while (err == Z_OK && d->d_stream->avail_out == 0)
{
d->d_stream->next_out = b->orig_bytes + rlen;
d->d_stream->next_out = (unsigned char *)b->orig_bytes + rlen;
d->d_stream->avail_out = BUF_SIZE;
err = deflate(d->d_stream, Z_SYNC_FLUSH);
@@ -135,14 +135,14 @@ static int ejabberd_zlib_drv_control(ErlDrvData handle,
b->orig_bytes[0] = 0;
if (len > 0) {
d->i_stream->next_in = buf;
d->i_stream->next_in = (unsigned char *)buf;
d->i_stream->avail_in = len;
d->i_stream->avail_out = 0;
err = Z_OK;
while (err == Z_OK && d->i_stream->avail_out == 0)
{
d->i_stream->next_out = b->orig_bytes + rlen;
d->i_stream->next_out = (unsigned char *)b->orig_bytes + rlen;
d->i_stream->avail_out = BUF_SIZE;
err = inflate(d->i_stream, Z_SYNC_FLUSH);
+8 -5
View File
@@ -11,6 +11,7 @@ ERL_MAX_ETS_TABLES=1400
NODE=ejabberd
HOST=localhost
ERLANG_NODE=$NODE@$HOST
ERL=@erl@
ROOTDIR=@rootdir@
EJABBERD_CONFIG_PATH=$ROOTDIR/etc/ejabberd/ejabberd.cfg
LOGS_DIR=$ROOTDIR/var/log/ejabberd/
@@ -45,6 +46,7 @@ ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES"
EJABBERD_EBIN=$ROOTDIR/var/lib/ejabberd/ebin
EJABBERD_MSGS_PATH=$ROOTDIR/var/lib/ejabberd/priv/msgs
EJABBERD_SO_PATH=$ROOTDIR/var/lib/ejabberd/priv/lib
EJABBERD_BIN_PATH=$ROOTDIR/var/lib/ejabberd/priv/bin
EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
SASL_LOG_PATH=$LOGS_DIR/sasl.log
DATETIME=`date "+%Y%m%d-%H%M%S"`
@@ -57,6 +59,7 @@ export EJABBERD_CONFIG_PATH
export EJABBERD_MSGS_PATH
export EJABBERD_LOG_PATH
export EJABBERD_SO_PATH
export EJABBERD_BIN_PATH
export ERL_CRASH_DUMP
export ERL_INETRC
export ERL_MAX_PORTS
@@ -72,7 +75,7 @@ export HOME
# start server
start ()
{
erl \
$ERL \
$NAME $ERLANG_NODE \
-noinput -detached \
-pa $EJABBERD_EBIN \
@@ -101,7 +104,7 @@ debug ()
echo "Press any key to continue"
read foo
echo ""
erl \
$ERL \
$NAME ${NODE}debug \
-remsh $ERLANG_NODE \
$ERLANG_OPTS $ARGS "$@"
@@ -125,9 +128,8 @@ live ()
echo "Press any key to continue"
read foo
echo ""
erl \
$ERL \
$NAME $ERLANG_NODE \
$ERLANG_OPTS \
-pa $EJABBERD_EBIN \
-mnesia dir "\"$EJABBERD_DB\"" \
-s ejabberd \
@@ -137,7 +139,7 @@ live ()
# common control function
ctl ()
{
erl \
$ERL \
$NAME ejabberdctl \
-noinput \
-pa $EJABBERD_EBIN \
@@ -157,6 +159,7 @@ ctl ()
echo " --ctl-config file Config file of ejabberdctl: $CONFIG"
echo " --logs dir Directory for logs: $LOGS_DIR"
echo " --spool dir Database spool dir: $EJABBERD_DB"
echo " --node nodename ejabberd node name: $ERLANG_NODE"
echo "";;
esac
return $result
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 22 Aug 2005 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+4 -2
View File
@@ -16,11 +16,13 @@ ifdef debug
endif
OUTDIR = ..
SOURCES = $(wildcard *.erl)
SOURCES = $(wildcard *.erl) ELDAPv3.erl
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
all: $(BEAMS)
all: $(BEAMS) ELDAPv3.beam
ELDAPv3.beam: ELDAPv3.erl
ELDAPv3.erl: ELDAPv3.asn
@ERLC@ -bber_bin -W $(EFLAGS) $<
+63 -85
View File
@@ -35,6 +35,14 @@
%%% Modified by Evgeniy Khramtsov <xram@jabber.ru>
%%% Implemented queue for bind() requests to prevent pending binds.
%%% Modified by Christophe Romain <christophe.romain@process-one.net>
%%% Improve error case handling
%%% Modified by Mickael Remond <mremond@process-one.net>
%%% Now use ejabberd log mechanism
%%% --------------------------------------------------------------------
-vc('$Id$ ').
@@ -48,20 +56,19 @@
%%% active_bind - sent bind() request and waiting for response
%%%----------------------------------------------------------------------
%%-compile(export_all).
%%-export([Function/Arity, ...]).
-behaviour(gen_fsm).
-include("ejabberd.hrl").
%% External exports
-export([start_link/1, start_link/5, start_link/6]).
-export([start_link/1, start_link/5]).
-export([baseObject/0,singleLevel/0,wholeSubtree/0,close/1,
equalityMatch/2,greaterOrEqual/2,lessOrEqual/2,
approxMatch/2,search/2,substrings/2,present/1,
'and'/1,'or'/1,'not'/1,modify/3, mod_add/2, mod_delete/2,
mod_replace/2, add/3, delete/2, modify_dn/5, bind/3]).
-export([debug_level/2, get_status/1]).
-export([get_status/1]).
%% gen_fsm callbacks
-export([init/1, connecting/2,
@@ -75,26 +82,24 @@
-include("eldap.hrl").
-define(LDAP_VERSION, 3).
-define(RETRY_TIMEOUT, 5000).
-define(RETRY_TIMEOUT, 500).
-define(BIND_TIMEOUT, 10000).
-define(CMD_TIMEOUT, 100000).
-define(MAX_TRANSACTION_ID, 65535).
-define(MIN_TRANSACTION_ID, 0).
-record(eldap, {version = ?LDAP_VERSION,
hosts, % Possible hosts running LDAP servers
hosts, % Possible hosts running LDAP servers
host = null, % Connected Host LDAP server
port = 389 , % The LDAP server port
port = 389, % The LDAP server port
fd = null, % Socket filedescriptor.
rootdn = "", % Name of the entry to bind as
passwd, % Password for (above) entry
id = 0, % LDAP Request ID
log, % User provided log function
bind_timer, % Ref to bind timeout
dict, % dict holding operation params and results
bind_q, % Queue for bind() requests
debug_level % Integer debug/logging level
}).
bind_q % Queue for bind() requests
}).
%%%----------------------------------------------------------------------
%%% API
@@ -104,20 +109,8 @@ start_link(Name) ->
gen_fsm:start_link({local, Reg_name}, ?MODULE, [], []).
start_link(Name, Hosts, Port, Rootdn, Passwd) ->
Log = fun(_N, Fmt, Args) -> io:format("---- " ++ Fmt, [Args]) end,
Reg_name = list_to_atom("eldap_" ++ Name),
gen_fsm:start_link({local, Reg_name}, ?MODULE, {Hosts, Port, Rootdn, Passwd, Log}, []).
start_link(Name, Hosts, Port, Rootdn, Passwd, Log) ->
Reg_name = list_to_atom("eldap_" ++ Name),
gen_fsm:start_link({local, Reg_name}, ?MODULE, {Hosts, Port, Rootdn, Passwd, Log}, []).
%%% --------------------------------------------------------------------
%%% Set Debug Level. 0 - none, 1 - errors, 2 - ldap events
%%% --------------------------------------------------------------------
debug_level(Handle, N) when integer(N) ->
Handle1 = get_handle(Handle),
gen_fsm:sync_send_all_state_event(Handle1, {debug_level,N}).
gen_fsm:start_link({local, Reg_name}, ?MODULE, {Hosts, Port, Rootdn, Passwd}, []).
%%% --------------------------------------------------------------------
%%% Get status of connection.
@@ -377,21 +370,19 @@ get_handle(Name) when list(Name) -> list_to_atom("eldap_" ++ Name).
%%----------------------------------------------------------------------
init([]) ->
case get_config() of
{ok, Hosts, Rootdn, Passwd, Log} ->
init({Hosts, Rootdn, Passwd, Log});
{ok, Hosts, Rootdn, Passwd} ->
init({Hosts, Rootdn, Passwd});
{error, Reason} ->
{stop, Reason}
end;
init({Hosts, Port, Rootdn, Passwd, Log}) ->
init({Hosts, Port, Rootdn, Passwd}) ->
{ok, connecting, #eldap{hosts = Hosts,
port = Port,
rootdn = Rootdn,
passwd = Passwd,
id = 0,
log = Log,
dict = dict:new(),
bind_q = queue:new(),
debug_level = 0}, 0}.
bind_q = queue:new()}, 0}.
%%----------------------------------------------------------------------
%% Func: StateName/2
@@ -484,9 +475,6 @@ handle_event(_Event, StateName, S) ->
%% {stop, Reason, NewStateData} |
%% {stop, Reason, Reply, NewStateData}
%%----------------------------------------------------------------------
handle_sync_event({debug_level, N}, _From, StateName, S) ->
{reply, ok, StateName, S#eldap{debug_level = N}};
handle_sync_event(_Event, _From, StateName, S) ->
{reply, {StateName, S}, StateName, S}.
@@ -501,7 +489,7 @@ handle_sync_event(_Event, _From, StateName, S) ->
%% Packets arriving in various states
%%
handle_info({tcp, _Socket, Data}, connecting, S) ->
log1("eldap. tcp packet received when disconnected!~n~p~n", [Data], S),
?DEBUG("eldap. tcp packet received when disconnected!~n~p", [Data]),
{next_state, connecting, S};
handle_info({tcp, _Socket, Data}, wait_bind_response, S) ->
@@ -526,19 +514,26 @@ handle_info({tcp, _Socket, Data}, StateName, S)
{error, _Reason} -> {next_state, StateName, S}
end;
handle_info({tcp_closed, _Socket}, _All_fsm_states, S) ->
handle_info({tcp_closed, _Socket}, Fsm_state, S) ->
?WARNING_MSG("LDAP server closed the connection: ~s:~p~nIn State: ~p",
[S#eldap.host, S#eldap.port ,Fsm_state]),
F = fun(_Id, [{Timer, From, _Name}|_]) ->
gen_fsm:reply(From, {error, tcp_closed}),
cancel_timer(Timer)
end,
dict:map(F, S#eldap.dict),
retry_connect(),
{next_state, connecting, S#eldap{fd = null,
dict = dict:new(), bind_q=queue:new()}};
{ok, NextState, NewS} = connect_bind(S#eldap{fd = null,
dict = dict:new(),
bind_q=queue:new()}),
{next_state, NextState, NewS};
handle_info({tcp_error, _Socket, Reason}, Fsm_state, S) ->
log1("eldap received tcp_error: ~p~nIn State: ~p~n", [Reason, Fsm_state], S),
?DEBUG("eldap received tcp_error: ~p~nIn State: ~p", [Reason, Fsm_state]),
%% XXX wouldn't it be safer to try reconnect ?
%% if we were waiting a result, we may mait forever
%% cause request is probably lost....
{next_state, Fsm_state, S};
%%
%% Timers
%%
@@ -561,8 +556,8 @@ handle_info({timeout, _Timer, bind_timeout}, wait_bind_response, S) ->
%% Make sure we don't fill the message queue with rubbish
%%
handle_info(Info, StateName, S) ->
log1("eldap. Unexpected Info: ~p~nIn state: ~p~n when StateData is: ~p~n",
[Info, StateName, S], S),
?DEBUG("eldap. Unexpected Info: ~p~nIn state: ~p~n when StateData is: ~p",
[Info, StateName, S]),
{next_state, StateName, S}.
%%----------------------------------------------------------------------
@@ -589,13 +584,16 @@ send_command(Command, From, S) ->
{Name, Request} = gen_req(Command),
Message = #'LDAPMessage'{messageID = Id,
protocolOp = {Name, Request}},
log2("~p~n",[{Name, Request}], S),
?DEBUG("~p~n",[{Name, Request}]),
{ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage', Message),
ok = gen_tcp:send(S#eldap.fd, Bytes),
Timer = erlang:start_timer(?CMD_TIMEOUT, self(), {cmd_timeout, Id}),
New_dict = dict:store(Id, [{Timer, From, Name}], S#eldap.dict),
{ok, S#eldap{id = Id,
dict = New_dict}}.
case gen_tcp:send(S#eldap.fd, Bytes) of
ok ->
Timer = erlang:start_timer(?CMD_TIMEOUT, self(), {cmd_timeout, Id}),
New_dict = dict:store(Id, [{Timer, From, Name}], S#eldap.dict),
{ok, S#eldap{id = Id, dict = New_dict}};
Error ->
Error
end.
gen_req({search, A}) ->
{searchRequest,
@@ -647,7 +645,7 @@ recvd_packet(Pkt, S) ->
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
{ok,Msg} ->
Op = Msg#'LDAPMessage'.protocolOp,
log2("~p~n",[Op], S),
?DEBUG("~p",[Op]),
Dict = S#eldap.dict,
Id = Msg#'LDAPMessage'.messageID,
{Timer, From, Name, Result_so_far} = get_op_rec(Id, Dict),
@@ -744,7 +742,7 @@ recvd_wait_bind_response(Pkt, S) ->
check_tag(Pkt),
case asn1rt:decode('ELDAPv3', 'LDAPMessage', Pkt) of
{ok,Msg} ->
log2("~p", [Msg], S),
?DEBUG("~p", [Msg]),
check_id(S#eldap.id, Msg#'LDAPMessage'.messageID),
case Msg#'LDAPMessage'.protocolOp of
{bindResponse, Result} ->
@@ -844,6 +842,7 @@ polish([], Res, Ref) ->
connect_bind(S) ->
Host = next_host(S#eldap.host, S#eldap.hosts),
TcpOpts = [{packet, asn1}, {active, true}, {keepalive, true}, binary],
?INFO_MSG("LDAP connection on ~s:~p", [Host, S#eldap.port]),
case gen_tcp:connect(Host, S#eldap.port, TcpOpts) of
{ok, Socket} ->
case bind_request(Socket, S) of
@@ -853,15 +852,15 @@ connect_bind(S) ->
{ok, wait_bind_response, NewS#eldap{fd = Socket,
host = Host,
bind_timer = Timer}};
{error, _Reason} ->
{error, Reason} ->
?ERROR_MSG("LDAP bind failed on ~s:~p~nReason: ~p", [Host, S#eldap.port, Reason]),
gen_tcp:close(Socket),
erlang:send_after(?RETRY_TIMEOUT, self(),
{timeout, retry_connect}),
retry_connect(),
{ok, connecting, S#eldap{host = Host}}
end;
{error, _Reason} ->
erlang:send_after(?RETRY_TIMEOUT, self(),
{timeout, retry_connect}),
{error, Reason} ->
?ERROR_MSG("LDAP connection failed on ~s:~p~nReason: ~p", [Host, S#eldap.port, Reason]),
retry_connect(),
{ok, connecting, S#eldap{host = Host}}
end.
@@ -872,10 +871,12 @@ bind_request(Socket, S) ->
authentication = {simple, S#eldap.passwd}},
Message = #'LDAPMessage'{messageID = Id,
protocolOp = {bindRequest, Req}},
log2("Message:~p~n",[Message], S),
?DEBUG("Bind Request Message:~p~n",[Message]),
{ok, Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage', Message),
ok = gen_tcp:send(Socket, Bytes),
{ok, S#eldap{id = Id}}.
case gen_tcp:send(Socket, Bytes) of
ok -> {ok, S#eldap{id = Id}};
Error -> Error
end.
%% Given last tried Server, find next one to try
next_host(null, [H|_]) -> H; % First time, take first
@@ -946,8 +947,8 @@ get_config() ->
case file:consult(File) of
{ok, Entries} ->
case catch parse(Entries) of
{ok, Hosts, Port, Rootdn, Passwd, Log} ->
{ok, Hosts, Port, Rootdn, Passwd, Log};
{ok, Hosts, Port, Rootdn, Passwd} ->
{ok, Hosts, Port, Rootdn, Passwd};
{error, Reason} ->
{error, Reason};
{'EXIT', Reason} ->
@@ -962,8 +963,7 @@ parse(Entries) ->
get_hosts(host, Entries),
get_integer(port, Entries),
get_list(rootdn, Entries),
get_list(passwd, Entries),
get_log(log, Entries)}.
get_list(passwd, Entries)}.
get_integer(Key, List) ->
case lists:keysearch(Key, 1, List) of
@@ -985,16 +985,6 @@ get_list(Key, List) ->
throw({error, "No Entry in Config for " ++ atom_to_list(Key)})
end.
get_log(Key, List) ->
case lists:keysearch(Key, 1, List) of
{value, {Key, Value}} when function(Value) ->
Value;
{value, {Key, _Else}} ->
false;
false ->
fun(_Level, Format, Args) -> io:format("--- " ++ Format, Args) end
end.
get_hosts(Key, List) ->
lists:map(fun({Key1, {A,B,C,D}}) when integer(A),
integer(B),
@@ -1016,15 +1006,3 @@ bump_id(#eldap{id = Id}) when Id > ?MAX_TRANSACTION_ID ->
?MIN_TRANSACTION_ID;
bump_id(#eldap{id = Id}) ->
Id + 1.
%%% --------------------------------------------------------------------
%%% Log routines. Call a user provided log routine Fun.
%%% --------------------------------------------------------------------
log1(Str, Args, #eldap{log = Fun, debug_level = N}) -> log(Fun, Str, Args, 1, N).
log2(Str, Args, #eldap{log = Fun, debug_level = N}) -> log(Fun, Str, Args, 2, N).
log(Fun, Str, Args, This_level, Status) when function(Fun), This_level =< Status ->
catch Fun(This_level, Str, Args);
log(_, _, _, _, _) ->
ok.
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -6,7 +6,7 @@
%%% Author: Evgeniy Khramtsov <xramtsov@gmail.com>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 12 Nov 2006 by Evgeniy Khramtsov <xram@jabber.ru>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 12 Oct 2006 by Mickael Remond <mremond@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+3 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 30 Jul 2004 by Leif Johansson <leifj@it.su.se>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -30,6 +30,7 @@
-export([start/2, stop/1, init/2,
check_password/3, set_password/3, is_user_exists/2]).
-include("ejabberd.hrl").
start(Host, ExtPrg) ->
spawn(?MODULE, init, [Host, ExtPrg]).
@@ -76,7 +77,7 @@ loop(Port) ->
exit(normal)
end;
{'EXIT', Port, Reason} ->
io:format("~p ~n", [Reason]),
?CRITICAL_MSG("~p ~n", [Reason]),
exit(port_terminated)
end.
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 22 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+18 -5
View File
@@ -5,7 +5,7 @@
%%% Created : 24 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -30,6 +30,7 @@
-export([start/0,
start_module/3,
stop_module/2,
stop_module_keep_config/2,
get_opt/2,
get_opt/3,
get_opt_host/3,
@@ -72,22 +73,34 @@ start_module(Host, Module, Opts) ->
ok
end.
%% @doc Stop the module in a host, and forget its configuration.
stop_module(Host, Module) ->
case stop_module_keep_config(Host, Module) of
error ->
error;
ok ->
del_module_mnesia(Host, Module)
end.
%% @doc Stop the module in a host, but keep its configuration.
%% As the module configuration is kept in the Mnesia local_config table,
%% when ejabberd is restarted the module will be started again.
%% This function is useful when ejabberd is being stopped
%% and it stops all modules.
stop_module_keep_config(Host, Module) ->
case catch Module:stop(Host) of
{'EXIT', Reason} ->
?ERROR_MSG("~p", [Reason]);
?ERROR_MSG("~p", [Reason]),
error;
{wait, ProcList} when is_list(ProcList) ->
lists:foreach(fun wait_for_process/1, ProcList),
del_module_mnesia(Host, Module),
ets:delete(ejabberd_modules, {Module, Host}),
ok;
{wait, Process} ->
wait_for_process(Process),
del_module_mnesia(Host, Module),
ets:delete(ejabberd_modules, {Module, Host}),
ok;
_ ->
del_module_mnesia(Host, Module),
ets:delete(ejabberd_modules, {Module, Host}),
ok
end.
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 10 Apr 2004 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 2 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+9 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 23 Nov 2002 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -59,7 +59,8 @@
now_to_local_string/1,
datetime_string_to_timestamp/1,
decode_base64/1,
encode_base64/1]).
encode_base64/1,
ip_to_list/1]).
-include("jlib.hrl").
@@ -676,3 +677,9 @@ e(X) when X>51, X<62 -> X-4;
e(62) -> $+;
e(63) -> $/;
e(X) -> exit({bad_encode_base64_token, X}).
%% Convert Erlang inet IP to list
ip_to_list({IP, _Port}) ->
ip_to_list(IP);
ip_to_list({A,B,C,D}) ->
lists:flatten(io_lib:format("~w.~w.~w.~w",[A,B,C,D])).
+1 -1
View File
@@ -1,6 +1,6 @@
%%%----------------------------------------------------------------------
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 15 Nov 2005 by Magnus Henoch <henoch@dtek.chalmers.se>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 11 Aug 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+32 -7
View File
@@ -5,7 +5,7 @@
%%% Created : 7 Oct 2006 by Magnus Henoch <henoch@dtek.chalmers.se>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -53,6 +53,7 @@
-define(PROCNAME, ejabberd_mod_caps).
-define(DICT, dict).
-define(CAPS_QUERY_TIMEOUT, 60000). % 1mn without answer, consider client never answer
-record(caps, {node, version, exts}).
-record(caps_features, {node_pair, features}).
@@ -127,8 +128,7 @@ start(Host, Opts) ->
stop(Host) ->
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
gen_server:call(Proc, stop),
supervisor:stop_child(ejabberd_sup, Proc).
gen_server:call(Proc, stop).
%%====================================================================
%% gen_server callbacks
@@ -215,11 +215,13 @@ handle_cast({note_caps, From,
[{"type", "get"},
{"id", ID}],
[{xmlelement, "query",
[{"xmlns", ?NS_DISCO_INFO}],
[{"xmlns", ?NS_DISCO_INFO},
{"node", lists:concat([Node, "#", SubNode])}],
[]}]},
ejabberd_local:register_iq_response_handler
(Host, ID, ?MODULE, handle_disco_response),
ejabberd_router:route(jlib:make_jid("", Host, ""), From, Stanza),
timer:send_after(?CAPS_QUERY_TIMEOUT, self(), {disco_timeout, ID}),
?DICT:store(ID, {Node, SubNode}, Dict)
end, Requests, Missing),
{noreply, State#state{disco_requests = NewRequests}};
@@ -251,16 +253,39 @@ handle_cast({disco_response, From, _To,
?ERROR_MSG("ID '~s' matches no query", [ID])
end;
{error, _} ->
gen_server:cast(self(), visit_feature_queries),
?ERROR_MSG("Error IQ reponse IQ from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
%% XXX: if we get error, we cache empty feature not to probe the client continuously
case ?DICT:find(ID, Requests) of
{ok, {Node, SubNode}} ->
Features = [],
mnesia:transaction(
fun() ->
mnesia:write(#caps_features{node_pair = {Node, SubNode},
features = Features})
end),
gen_server:cast(self(), visit_feature_queries);
error ->
?ERROR_MSG("ID '~s' matches no query", [ID])
end;
%gen_server:cast(self(), visit_feature_queries),
%?DEBUG("Error IQ reponse from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
{result, _} ->
?ERROR_MSG("Invalid IQ contents from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
?DEBUG("Invalid IQ contents from ~s:~n~p", [jlib:jid_to_string(From), SubEls]);
_ ->
%% Can't do anything about errors
ok
end,
NewRequests = ?DICT:erase(ID, Requests),
{noreply, State#state{disco_requests = NewRequests}};
handle_cast({disco_timeout, ID}, #state{host = Host, disco_requests = Requests} = State) ->
%% do not wait a response anymore for this IQ, client certainly will never answer
NewRequests = case ?DICT:is_key(ID, Requests) of
true ->
ejabberd_local:unregister_iq_response_handler(Host, ID),
?DICT:erase(ID, Requests);
false ->
Requests
end,
{noreply, State#state{disco_requests = NewRequests}};
handle_cast(visit_feature_queries, #state{feature_queries = FeatureQueries} = State) ->
Timestamp = timestamp(),
NewFeatureQueries =
+2 -2
View File
@@ -5,7 +5,7 @@
%%% Created : 19 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -1416,7 +1416,7 @@ set_form(_From, _Host, ["running nodes", ENode, "backup", "textfile"], _Lang, XD
false ->
{error, ?ERR_BAD_REQUEST};
{value, {_, [String]}} ->
case rpc:call(Node, mnesia, dump_to_textfile, [String]) of
case rpc:call(Node, ejabberd_ctl, dump_to_textfile, [String]) of
{badrpc, _Reason} ->
{error, ?ERR_INTERNAL_SERVER_ERROR};
{error, _Reason} ->
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 26 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 1 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+8 -5
View File
@@ -5,7 +5,7 @@
%%% Created : 15 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -121,7 +121,7 @@ handle_info({route, From, To, Packet}, State) ->
"" -> jlib:make_error_reply(Packet, ?ERR_BAD_REQUEST);
_ -> Packet
end,
%%do_client_version(To, From),
do_client_version(disabled, To, From), % Put 'enabled' to enable it
ejabberd_router:route(To, From, Packet2),
{noreply, State};
handle_info(_Info, State) ->
@@ -149,8 +149,9 @@ code_change(_OldVsn, State, _Extra) ->
%% Example of routing XMPP packets using Erlang's message passing
%%--------------------------------------------------------------------
%% To enable this educational example, uncomment the call to the
%% function do_client_version in handle_info.
%% To enable this educational example, edit the function handle_info:
%% replace the argument 'disabled' with 'enabled' in the call to the
%% function do_client_version.
%% ejabberd provides a method to receive XMPP packets using Erlang's
%% message passing mechanism.
@@ -167,7 +168,9 @@ code_change(_OldVsn, State, _Extra) ->
%% using exactly the same JID. We add a (mostly) random resource to
%% try to guarantee that the received response matches the request sent.
%% Finally, the received response is printed in the ejabberd log file.
do_client_version(From, To) ->
do_client_version(disabled, _From, _To) ->
ok;
do_client_version(enabled, From, To) ->
ToS = jlib:jid_to_string(To),
%% It is important to identify this process and packet
Random_resource = integer_to_list(random:uniform(100000)),
+119
View File
@@ -0,0 +1,119 @@
%%%----------------------------------------------------------------------
%%% File : mod_ip_blacklist.erl
%%% Author : Mickael Remond <mremond@process-one.net>
%%% Purpose : Download blacklists from ProcessOne
%%% Created : 5 May 2008 by Mickael Remond <mremond@process-one.net>
%%% Usage : Add the following line in modules section of ejabberd.cfg:
%%% {mod_ip_blacklist, []}
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%%% 02111-1307 USA
%%%
%%%----------------------------------------------------------------------
-module(mod_ip_blacklist).
-author('mremond@process-one.net').
-behaviour(gen_mod).
%% API:
-export([start/2,
init/1,
stop/1]).
-export([update_bl_c2s/0]).
%% Hooks:
-export([is_ip_in_c2s_blacklist/2]).
-include("ejabberd.hrl").
-define(PROCNAME, ?MODULE).
-define(BLC2S, "http://xaai.process-one.net/bl_c2s.txt").
-define(UPDATE_INTERVAL, 6). %% in hours
-record(state, {timer}).
-record(bl_c2s, {ip}).
%% Start once for all vhost
start(Host, Opts) ->
case whereis(?PROCNAME) of
undefined ->
?DEBUG("Starting mod_ip_blacklist ~p ~p~n", [Host, Opts]),
register(?PROCNAME,
spawn(?MODULE, init, [#state{}]));
_ ->
ok
end.
%% TODO:
stop(_Host) ->
ok.
init(State)->
inets:start(),
ets:new(bl_c2s, [named_table, public, {keypos, #bl_c2s.ip}]),
update_bl_c2s(),
%% Register hooks for blacklist
ejabberd_hooks:add(check_bl_c2s, ?MODULE, is_ip_in_c2s_blacklist, 50),
%% Set timer: Download the blacklist file every 6 hours
timer:apply_interval(timer:hours(?UPDATE_INTERVAL), ?MODULE, update_bl_c2s, []),
loop(State).
%% Remove timer when stop is received.
loop(_State) ->
receive
stop ->
ok
end.
%% Download blacklist file from ProcessOne XAAI
%% and update the table internal table
%% TODO: Support comment lines starting by %
update_bl_c2s() ->
?INFO_MSG("Updating C2S Blacklist", []),
case http:request(?BLC2S) of
{ok, {{_Version, 200, _Reason}, _Headers, Body}} ->
IPs = string:tokens(Body,"\n"),
ets:delete_all_objects(bl_c2s),
lists:foreach(
fun(IP) ->
ets:insert(bl_c2s, #bl_c2s{ip=list_to_binary(IP)})
end, IPs);
{error, Reason} ->
?ERROR_MSG("Cannot download C2S blacklist file. Reason: ~p",
[Reason])
end.
%% Hook is run with:
%% ejabberd_hooks:run_fold(check_bl_c2s, false, [IP]),
%% Return: false: IP not blacklisted
%% true: IP is blacklisted
%% IPV4 IP tuple:
is_ip_in_c2s_blacklist(_Val, IP) when is_tuple(IP) ->
BinaryIP = list_to_binary(jlib:ip_to_list(IP)),
case ets:lookup(bl_c2s, BinaryIP) of
[] -> %% Not in blacklist
false;
[_] -> %% Blacklisted!
{stop, true}
end;
is_ip_in_c2s_blacklist(_Val, _IP) ->
false.
%% TODO:
%% - For now, we do not kick user already logged on a given IP after
%% we update the blacklist.
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 16 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* ejabberd, Copyright (C) 2002-2008 Process-one
* ejabberd, Copyright (C) 2002-2008 ProcessOne
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
+4 -4
View File
@@ -5,7 +5,7 @@
%%% Created : 15 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -254,7 +254,7 @@ do_route1(Host, ServerHost, From, To, Packet, DefEnc) ->
[[_ | _] = Channel, [_ | _] = Server] ->
case ets:lookup(irc_connection, {From, Server, Host}) of
[] ->
io:format("open new connection~n"),
?DEBUG("open new connection~n", []),
{Username, Encoding} = get_user_and_encoding(
Host, From, Server, DefEnc),
{ok, Pid} = mod_irc_connection:start(
@@ -269,7 +269,7 @@ do_route1(Host, ServerHost, From, To, Packet, DefEnc) ->
ok;
[R] ->
Pid = R#irc_connection.pid,
io:format("send to process ~p~n",
?DEBUG("send to process ~p~n",
[Pid]),
mod_irc_connection:route_chan(
Pid, Channel, Resource, Packet),
@@ -285,7 +285,7 @@ do_route1(Host, ServerHost, From, To, Packet, DefEnc) ->
ejabberd_router:route(To, From, Err);
[R] ->
Pid = R#irc_connection.pid,
io:format("send to process ~p~n",
?DEBUG("send to process ~p~n",
[Pid]),
mod_irc_connection:route_nick(
Pid, Nick, Packet),
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 15 Feb 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+1 -1
View File
@@ -5,7 +5,7 @@
%%% Created : 24 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
+7 -7
View File
@@ -5,7 +5,7 @@
%%% Created : 24 Oct 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
%%% ejabberd, Copyright (C) 2002-2008 Process-one
%%% ejabberd, Copyright (C) 2002-2008 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -114,8 +114,6 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) ->
get_last(IQ, SubEl, LUser, LServer) ->
Username = ejabberd_odbc:escape(LUser),
case catch odbc_queries:get_last(LServer, Username) of
{'EXIT', _Reason} ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]};
{selected, ["seconds","state"], []} ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_SERVICE_UNAVAILABLE]};
{selected, ["seconds","state"], [{STimeStamp, Status}]} ->
@@ -132,7 +130,9 @@ get_last(IQ, SubEl, LUser, LServer) ->
_ ->
IQ#iq{type = error,
sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}
end
end;
_ ->
IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}
end.
on_presence_update(User, Server, _Resource, Status) ->
@@ -152,8 +152,6 @@ store_last_info(User, Server, TimeStamp, Status) ->
get_last_info(LUser, LServer) ->
Username = ejabberd_odbc:escape(LUser),
case catch odbc_queries:get_last(LServer, Username) of
{'EXIT', _Reason} ->
not_found;
{selected, ["seconds","state"], []} ->
not_found;
{selected, ["seconds","state"], [{STimeStamp, Status}]} ->
@@ -162,7 +160,9 @@ get_last_info(LUser, LServer) ->
{ok, TimeStamp, Status};
_ ->
not_found
end
end;
_ ->
not_found
end.
remove_user(User, Server) ->

Some files were not shown because too many files have changed in this diff Show More