From 8538997d615f58ef061115731eaf0b09d47595ce Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Sat, 22 Feb 2014 10:27:40 +0000 Subject: Update FSF address --- src/acl.erl | 7 +++---- src/adhoc.erl | 7 +++---- src/cyrsasl.erl | 7 +++---- src/cyrsasl_anonymous.erl | 7 +++---- src/cyrsasl_digest.erl | 7 +++---- src/cyrsasl_plain.erl | 7 +++---- src/cyrsasl_scram.erl | 7 +++---- src/ejabberd.erl | 7 +++---- src/ejabberd_admin.erl | 7 +++---- src/ejabberd_app.erl | 7 +++---- src/ejabberd_auth.erl | 7 +++---- src/ejabberd_auth_anonymous.erl | 7 +++---- src/ejabberd_auth_external.erl | 7 +++---- src/ejabberd_auth_internal.erl | 7 +++---- src/ejabberd_auth_ldap.erl | 7 +++---- src/ejabberd_auth_odbc.erl | 7 +++---- src/ejabberd_auth_pam.erl | 7 +++---- src/ejabberd_c2s.erl | 7 +++---- src/ejabberd_c2s_config.erl | 7 +++---- src/ejabberd_captcha.erl | 7 +++---- src/ejabberd_commands.erl | 7 +++---- src/ejabberd_config.erl | 7 +++---- src/ejabberd_ctl.erl | 7 +++---- src/ejabberd_frontend_socket.erl | 7 +++---- src/ejabberd_hooks.erl | 7 +++---- src/ejabberd_http.erl | 7 +++---- src/ejabberd_http_poll.erl | 7 +++---- src/ejabberd_listener.erl | 7 +++---- src/ejabberd_local.erl | 7 +++---- src/ejabberd_logger.erl | 7 +++---- src/ejabberd_node_groups.erl | 7 +++---- src/ejabberd_odbc.erl | 7 +++---- src/ejabberd_odbc_sup.erl | 7 +++---- src/ejabberd_piefxis.erl | 7 +++---- src/ejabberd_rdbms.erl | 7 +++---- src/ejabberd_receiver.erl | 7 +++---- src/ejabberd_regexp.erl | 7 +++---- src/ejabberd_router.erl | 7 +++---- src/ejabberd_s2s.erl | 7 +++---- src/ejabberd_s2s_in.erl | 7 +++---- src/ejabberd_s2s_out.erl | 7 +++---- src/ejabberd_service.erl | 7 +++---- src/ejabberd_sm.erl | 7 +++---- src/ejabberd_socket.erl | 7 +++---- src/ejabberd_sup.erl | 7 +++---- src/ejabberd_system_monitor.erl | 7 +++---- src/ejabberd_tmp_sup.erl | 7 +++---- src/ejabberd_update.erl | 7 +++---- src/ejabberd_web.erl | 7 +++---- src/ejabberd_web_admin.erl | 7 +++---- src/ejd2odbc.erl | 7 +++---- src/eldap.erl | 6 +++--- src/eldap_filter.erl | 7 +++---- src/eldap_pool.erl | 7 +++---- src/eldap_utils.erl | 7 +++---- src/extauth.erl | 7 +++---- src/gen_iq_handler.erl | 7 +++---- src/gen_mod.erl | 7 +++---- src/idna.erl | 7 +++---- src/jd2ejd.erl | 7 +++---- src/jlib.erl | 7 +++---- src/mod_adhoc.erl | 7 +++---- src/mod_announce.erl | 7 +++---- src/mod_blocking.erl | 7 +++---- src/mod_caps.erl | 7 +++---- src/mod_carboncopy.erl | 7 +++---- src/mod_configure.erl | 7 +++---- src/mod_configure2.erl | 7 +++---- src/mod_disco.erl | 7 +++---- src/mod_echo.erl | 7 +++---- src/mod_http_bind.erl | 7 +++---- src/mod_http_fileserver.erl | 7 +++---- src/mod_ip_blacklist.erl | 7 +++---- src/mod_irc.erl | 7 +++---- src/mod_irc_connection.erl | 7 +++---- src/mod_last.erl | 7 +++---- src/mod_muc.erl | 7 +++---- src/mod_muc_log.erl | 7 +++---- src/mod_muc_room.erl | 7 +++---- src/mod_offline.erl | 7 +++---- src/mod_ping.erl | 7 +++---- src/mod_pres_counter.erl | 7 +++---- src/mod_privacy.erl | 7 +++---- src/mod_private.erl | 7 +++---- src/mod_proxy65.erl | 7 +++---- src/mod_proxy65_lib.erl | 7 +++---- src/mod_proxy65_service.erl | 7 +++---- src/mod_proxy65_sm.erl | 7 +++---- src/mod_proxy65_stream.erl | 7 +++---- src/mod_register.erl | 7 +++---- src/mod_register_web.erl | 7 +++---- src/mod_roster.erl | 7 +++---- src/mod_service_log.erl | 7 +++---- src/mod_shared_roster.erl | 7 +++---- src/mod_shared_roster_ldap.erl | 7 +++---- src/mod_sic.erl | 7 +++---- src/mod_stats.erl | 7 +++---- src/mod_time.erl | 7 +++---- src/mod_vcard.erl | 7 +++---- src/mod_vcard_ldap.erl | 7 +++---- src/mod_version.erl | 7 +++---- src/odbc_queries.erl | 7 +++---- src/randoms.erl | 7 +++---- src/scram.erl | 7 +++---- src/shaper.erl | 7 +++---- src/str.erl | 7 +++---- src/translate.erl | 7 +++---- src/treap.erl | 7 +++---- src/win32_dns.erl | 7 +++---- 109 files changed, 327 insertions(+), 435 deletions(-) (limited to 'src') diff --git a/src/acl.erl b/src/acl.erl index 3cd789463..4ef702568 100644 --- a/src/acl.erl +++ b/src/acl.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/adhoc.erl b/src/adhoc.erl index 50ef7e5bf..ff677f980 100644 --- a/src/adhoc.erl +++ b/src/adhoc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/cyrsasl.erl b/src/cyrsasl.erl index 6c847bb52..08c8a647f 100644 --- a/src/cyrsasl.erl +++ b/src/cyrsasl.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/cyrsasl_anonymous.erl b/src/cyrsasl_anonymous.erl index 1daa1c103..156ee348a 100644 --- a/src/cyrsasl_anonymous.erl +++ b/src/cyrsasl_anonymous.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/cyrsasl_digest.erl b/src/cyrsasl_digest.erl index b837a2e25..d87d015c6 100644 --- a/src/cyrsasl_digest.erl +++ b/src/cyrsasl_digest.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/cyrsasl_plain.erl b/src/cyrsasl_plain.erl index c5c5f2e02..971f6c435 100644 --- a/src/cyrsasl_plain.erl +++ b/src/cyrsasl_plain.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/cyrsasl_scram.erl b/src/cyrsasl_scram.erl index 7338ea7bb..718336831 100644 --- a/src/cyrsasl_scram.erl +++ b/src/cyrsasl_scram.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd.erl b/src/ejabberd.erl index 78ef10089..52631a624 100644 --- a/src/ejabberd.erl +++ b/src/ejabberd.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_admin.erl b/src/ejabberd_admin.erl index a21331536..0e903b0b4 100644 --- a/src/ejabberd_admin.erl +++ b/src/ejabberd_admin.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl index dba61b7d9..75639b60c 100644 --- a/src/ejabberd_app.erl +++ b/src/ejabberd_app.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 704c82cd4..2905f7e41 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl index 180e9d0df..6ef1853c8 100644 --- a/src/ejabberd_auth_anonymous.erl +++ b/src/ejabberd_auth_anonymous.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl index 514b551d7..949cab7c3 100644 --- a/src/ejabberd_auth_external.erl +++ b/src/ejabberd_auth_external.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth_internal.erl b/src/ejabberd_auth_internal.erl index 8d7d0a0dd..23aa68815 100644 --- a/src/ejabberd_auth_internal.erl +++ b/src/ejabberd_auth_internal.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth_ldap.erl b/src/ejabberd_auth_ldap.erl index 1c1a4f313..2045bce4b 100644 --- a/src/ejabberd_auth_ldap.erl +++ b/src/ejabberd_auth_ldap.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth_odbc.erl b/src/ejabberd_auth_odbc.erl index a1841f3d1..33e25c164 100644 --- a/src/ejabberd_auth_odbc.erl +++ b/src/ejabberd_auth_odbc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_auth_pam.erl b/src/ejabberd_auth_pam.erl index 8e744e2c4..af320544b 100644 --- a/src/ejabberd_auth_pam.erl +++ b/src/ejabberd_auth_pam.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- -module(ejabberd_auth_pam). diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index ae5fc97b8..64676234e 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_c2s_config.erl b/src/ejabberd_c2s_config.erl index 2229e5ef1..d77aee8a0 100644 --- a/src/ejabberd_c2s_config.erl +++ b/src/ejabberd_c2s_config.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index e9a3ea3a9..e938c4673 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl index 5287876ce..640ac9f4e 100644 --- a/src/ejabberd_commands.erl +++ b/src/ejabberd_commands.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index 0551b49a5..55dfd32ce 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 46a365019..e526b298a 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_frontend_socket.erl b/src/ejabberd_frontend_socket.erl index 583396ec9..b3118224d 100644 --- a/src/ejabberd_frontend_socket.erl +++ b/src/ejabberd_frontend_socket.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_hooks.erl b/src/ejabberd_hooks.erl index 3891fd9ff..fdc543e40 100644 --- a/src/ejabberd_hooks.erl +++ b/src/ejabberd_hooks.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index 4919242a2..1347cc148 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_http_poll.erl b/src/ejabberd_http_poll.erl index a00e690e2..62c59a8e6 100644 --- a/src/ejabberd_http_poll.erl +++ b/src/ejabberd_http_poll.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 5dc26c68e..ab74f7dca 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index f288bed9a..c9dc651d2 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_logger.erl b/src/ejabberd_logger.erl index 92eefcff3..e1883f1db 100644 --- a/src/ejabberd_logger.erl +++ b/src/ejabberd_logger.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%%------------------------------------------------------------------- -module(ejabberd_logger). diff --git a/src/ejabberd_node_groups.erl b/src/ejabberd_node_groups.erl index eb39b7265..9a142ddc9 100644 --- a/src/ejabberd_node_groups.erl +++ b/src/ejabberd_node_groups.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_odbc.erl b/src/ejabberd_odbc.erl index d3d8a2a84..b64ec0450 100644 --- a/src/ejabberd_odbc.erl +++ b/src/ejabberd_odbc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_odbc_sup.erl b/src/ejabberd_odbc_sup.erl index 86b737948..b16720daf 100644 --- a/src/ejabberd_odbc_sup.erl +++ b/src/ejabberd_odbc_sup.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl index 6c13e7426..d7fc03736 100644 --- a/src/ejabberd_piefxis.erl +++ b/src/ejabberd_piefxis.erl @@ -21,10 +21,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_rdbms.erl b/src/ejabberd_rdbms.erl index b5525de10..5b7eccc1d 100644 --- a/src/ejabberd_rdbms.erl +++ b/src/ejabberd_rdbms.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_receiver.erl b/src/ejabberd_receiver.erl index f666ea837..3d75be3a3 100644 --- a/src/ejabberd_receiver.erl +++ b/src/ejabberd_receiver.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_regexp.erl b/src/ejabberd_regexp.erl index 6603ec626..91e1dac12 100644 --- a/src/ejabberd_regexp.erl +++ b/src/ejabberd_regexp.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index 24f52d329..e1057ea13 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index b13fdd58e..4dfccae40 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 2823cde62..8e6099dca 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index a5acdad95..000cd051c 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl index 35f7c187a..818639d33 100644 --- a/src/ejabberd_service.erl +++ b/src/ejabberd_service.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index c7e277a8d..c30599939 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_socket.erl b/src/ejabberd_socket.erl index 58bb80efe..b5ed21d3d 100644 --- a/src/ejabberd_socket.erl +++ b/src/ejabberd_socket.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_sup.erl b/src/ejabberd_sup.erl index b3da8369d..8f35f3ac7 100644 --- a/src/ejabberd_sup.erl +++ b/src/ejabberd_sup.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_system_monitor.erl b/src/ejabberd_system_monitor.erl index 92a41b9d8..6aaf6736b 100644 --- a/src/ejabberd_system_monitor.erl +++ b/src/ejabberd_system_monitor.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- diff --git a/src/ejabberd_tmp_sup.erl b/src/ejabberd_tmp_sup.erl index c3d2a186e..fbd412214 100644 --- a/src/ejabberd_tmp_sup.erl +++ b/src/ejabberd_tmp_sup.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_update.erl b/src/ejabberd_update.erl index 41c2ea510..b07955503 100644 --- a/src/ejabberd_update.erl +++ b/src/ejabberd_update.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- diff --git a/src/ejabberd_web.erl b/src/ejabberd_web.erl index 70f62de7f..b0b109a1b 100644 --- a/src/ejabberd_web.erl +++ b/src/ejabberd_web.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index a1c4b25a9..8b80a071c 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/ejd2odbc.erl b/src/ejd2odbc.erl index 7afcd6154..bc7ede491 100644 --- a/src/ejd2odbc.erl +++ b/src/ejd2odbc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/eldap.erl b/src/eldap.erl index 0dae3cbe8..0f1a1a445 100644 --- a/src/eldap.erl +++ b/src/eldap.erl @@ -18,9 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% Modified by Sean Hinde 7th Dec 2000 %%% Turned into gen_fsm, made non-blocking, added timers etc to support this. diff --git a/src/eldap_filter.erl b/src/eldap_filter.erl index 6771fc2af..1c253c713 100644 --- a/src/eldap_filter.erl +++ b/src/eldap_filter.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- -module(eldap_filter). diff --git a/src/eldap_pool.erl b/src/eldap_pool.erl index 35fabeb74..fe59c8d8e 100644 --- a/src/eldap_pool.erl +++ b/src/eldap_pool.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- diff --git a/src/eldap_utils.erl b/src/eldap_utils.erl index a18a04ed6..6083563e2 100644 --- a/src/eldap_utils.erl +++ b/src/eldap_utils.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/extauth.erl b/src/extauth.erl index e57ac0b8d..b41067c22 100644 --- a/src/extauth.erl +++ b/src/extauth.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl index 628c1c90c..906de114b 100644 --- a/src/gen_iq_handler.erl +++ b/src/gen_iq_handler.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/gen_mod.erl b/src/gen_mod.erl index 0b06529b5..33a014107 100644 --- a/src/gen_mod.erl +++ b/src/gen_mod.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/idna.erl b/src/idna.erl index 7e3d0aefb..8b19f1606 100644 --- a/src/idna.erl +++ b/src/idna.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/jd2ejd.erl b/src/jd2ejd.erl index a60033998..c904cce7f 100644 --- a/src/jd2ejd.erl +++ b/src/jd2ejd.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/jlib.erl b/src/jlib.erl index 46e864b0c..daaacdf78 100644 --- a/src/jlib.erl +++ b/src/jlib.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_adhoc.erl b/src/mod_adhoc.erl index ae37bb9d6..03db638da 100644 --- a/src/mod_adhoc.erl +++ b/src/mod_adhoc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_announce.erl b/src/mod_announce.erl index b558897a0..0cbe328c2 100644 --- a/src/mod_announce.erl +++ b/src/mod_announce.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_blocking.erl b/src/mod_blocking.erl index 2aaff7bae..e8ca99d82 100644 --- a/src/mod_blocking.erl +++ b/src/mod_blocking.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_caps.erl b/src/mod_caps.erl index ac115d646..e221cd14d 100644 --- a/src/mod_caps.erl +++ b/src/mod_caps.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%% 2009, improvements from ProcessOne to support correct PEP handling %%% through s2s, use less memory, and speedup global caps handling diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index cc5cb83b0..ed7c0531f 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -19,10 +19,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- -module (mod_carboncopy). diff --git a/src/mod_configure.erl b/src/mod_configure.erl index b6c8f55b7..52f7b4763 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_configure2.erl b/src/mod_configure2.erl index 375621441..6756c2f37 100644 --- a/src/mod_configure2.erl +++ b/src/mod_configure2.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_disco.erl b/src/mod_disco.erl index b11c9629a..873e095e5 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_echo.erl b/src/mod_echo.erl index 077a4de49..87f2f2671 100644 --- a/src/mod_echo.erl +++ b/src/mod_echo.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_http_bind.erl b/src/mod_http_bind.erl index dcaa8a91a..2d4e1f1d5 100644 --- a/src/mod_http_bind.erl +++ b/src/mod_http_bind.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_http_fileserver.erl b/src/mod_http_fileserver.erl index fcfa12b59..5ae125e1a 100644 --- a/src/mod_http_fileserver.erl +++ b/src/mod_http_fileserver.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_ip_blacklist.erl b/src/mod_ip_blacklist.erl index 3af5aaac0..a6d4698ec 100644 --- a/src/mod_ip_blacklist.erl +++ b/src/mod_ip_blacklist.erl @@ -19,10 +19,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_irc.erl b/src/mod_irc.erl index 3aa57002f..4ad632631 100644 --- a/src/mod_irc.erl +++ b/src/mod_irc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_irc_connection.erl b/src/mod_irc_connection.erl index c37ca7cb4..569e8beff 100644 --- a/src/mod_irc_connection.erl +++ b/src/mod_irc_connection.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_last.erl b/src/mod_last.erl index 6e35938d2..c170026f0 100644 --- a/src/mod_last.erl +++ b/src/mod_last.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_muc.erl b/src/mod_muc.erl index 7934e6f95..34f174bed 100644 --- a/src/mod_muc.erl +++ b/src/mod_muc.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl index 357d19216..cc95ecef0 100644 --- a/src/mod_muc_log.erl +++ b/src/mod_muc_log.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 1ef90b1eb..e30511891 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_offline.erl b/src/mod_offline.erl index f4e0a888f..d316d3b7c 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_ping.erl b/src/mod_ping.erl index 078b0d13d..a4fc74499 100644 --- a/src/mod_ping.erl +++ b/src/mod_ping.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_pres_counter.erl b/src/mod_pres_counter.erl index 30f5308c0..0161e701a 100644 --- a/src/mod_pres_counter.erl +++ b/src/mod_pres_counter.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 5edfccd28..4de601670 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_private.erl b/src/mod_private.erl index ae7068480..b21427e21 100644 --- a/src/mod_private.erl +++ b/src/mod_private.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_proxy65.erl b/src/mod_proxy65.erl index 85bec283b..e4b4666a4 100644 --- a/src/mod_proxy65.erl +++ b/src/mod_proxy65.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_proxy65_lib.erl b/src/mod_proxy65_lib.erl index 388811436..e85cabc98 100644 --- a/src/mod_proxy65_lib.erl +++ b/src/mod_proxy65_lib.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl index 33d40b1cc..a44e6ddb2 100644 --- a/src/mod_proxy65_service.erl +++ b/src/mod_proxy65_service.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_proxy65_sm.erl b/src/mod_proxy65_sm.erl index fa9d257ef..7b15a6609 100644 --- a/src/mod_proxy65_sm.erl +++ b/src/mod_proxy65_sm.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_proxy65_stream.erl b/src/mod_proxy65_stream.erl index b37dcc13a..e088b935a 100644 --- a/src/mod_proxy65_stream.erl +++ b/src/mod_proxy65_stream.erl @@ -16,10 +16,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_register.erl b/src/mod_register.erl index c7da225ef..4ac18957e 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index 841685a94..48be33934 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 7415aa3de..04b4a236f 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_service_log.erl b/src/mod_service_log.erl index 82497a609..97d5e954d 100644 --- a/src/mod_service_log.erl +++ b/src/mod_service_log.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 743b1dd62..850be38f2 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_shared_roster_ldap.erl b/src/mod_shared_roster_ldap.erl index 322909a2c..63ae55899 100644 --- a/src/mod_shared_roster_ldap.erl +++ b/src/mod_shared_roster_ldap.erl @@ -19,10 +19,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%------------------------------------------------------------------- -module(mod_shared_roster_ldap). diff --git a/src/mod_sic.erl b/src/mod_sic.erl index b1ae44d04..326a95962 100644 --- a/src/mod_sic.erl +++ b/src/mod_sic.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_stats.erl b/src/mod_stats.erl index a35928975..1da857cf0 100644 --- a/src/mod_stats.erl +++ b/src/mod_stats.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_time.erl b/src/mod_time.erl index d6c8363d7..db6c26e67 100644 --- a/src/mod_time.erl +++ b/src/mod_time.erl @@ -18,10 +18,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 08feb071a..730ed9aa2 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 1c96dd4a1..2a426f8cd 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/mod_version.erl b/src/mod_version.erl index 3ae9b8428..a16e86e40 100644 --- a/src/mod_version.erl +++ b/src/mod_version.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/odbc_queries.erl b/src/odbc_queries.erl index 314b7cc13..29442b472 100644 --- a/src/odbc_queries.erl +++ b/src/odbc_queries.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/randoms.erl b/src/randoms.erl index 0fd1f304c..39c106675 100644 --- a/src/randoms.erl +++ b/src/randoms.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/scram.erl b/src/scram.erl index 407f69d2f..38992a688 100644 --- a/src/scram.erl +++ b/src/scram.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/shaper.erl b/src/shaper.erl index b9f460395..643fa5b2b 100644 --- a/src/shaper.erl +++ b/src/shaper.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/str.erl b/src/str.erl index d4d448594..1bd9440df 100644 --- a/src/str.erl +++ b/src/str.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/translate.erl b/src/translate.erl index fd2ebcc64..9abb12f1f 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/treap.erl b/src/treap.erl index 607f2c8ab..50c0b9534 100644 --- a/src/treap.erl +++ b/src/treap.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- diff --git a/src/win32_dns.erl b/src/win32_dns.erl index 9f80a08de..cbcefb280 100644 --- a/src/win32_dns.erl +++ b/src/win32_dns.erl @@ -17,10 +17,9 @@ %%% 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 +%%% 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., +%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %%% %%%---------------------------------------------------------------------- -- cgit v1.2.3 From 9ef1ad0b6e44c2e41c2086e70253cbf5538b90c6 Mon Sep 17 00:00:00 2001 From: iulianlaz Date: Thu, 6 Mar 2014 08:40:38 +0000 Subject: #148 Carbon copy sends message back to original sender solved --- src/mod_carboncopy.erl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index cc5cb83b0..ac1a1ef56 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -151,7 +151,19 @@ check_and_forward(JID, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, Dir false -> case xml:get_subtag(Packet,<<"received">>) of false -> - send_copies(JID, Packet, Direction); + %% We must check if a packet contains "" tags in order to avoid + %% receiving message back to original sender. + SubTag = xml:get_subtag(Packet,<<"sent">>), + if SubTag == false -> + send_copies(JID, Packet, Direction); + true -> + case xml:get_subtag(SubTag,<<"forwarded">>) of + false-> + send_copies(JID, Packet, Direction); + _ -> + stop + end + end; _ -> %% stop the hook chain, we don't want mod_logdb to register this message (duplicate) stop -- cgit v1.2.3 From 633d47f7845c6295f5c3cf46c3a92972713b4951 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 13 Mar 2014 12:29:21 +0100 Subject: Update copyright dates to 2014 (EJAB-1679) --- src/acl.erl | 2 +- src/adhoc.erl | 2 +- src/cyrsasl.erl | 2 +- src/cyrsasl_anonymous.erl | 2 +- src/cyrsasl_digest.erl | 2 +- src/cyrsasl_plain.erl | 2 +- src/cyrsasl_scram.erl | 2 +- src/ejabberd.erl | 2 +- src/ejabberd_admin.erl | 2 +- src/ejabberd_app.erl | 2 +- src/ejabberd_auth.erl | 2 +- src/ejabberd_auth_anonymous.erl | 2 +- src/ejabberd_auth_external.erl | 2 +- src/ejabberd_auth_internal.erl | 2 +- src/ejabberd_auth_ldap.erl | 2 +- src/ejabberd_auth_odbc.erl | 2 +- src/ejabberd_auth_pam.erl | 2 +- src/ejabberd_c2s.erl | 2 +- src/ejabberd_c2s_config.erl | 2 +- src/ejabberd_captcha.erl | 2 +- src/ejabberd_commands.erl | 2 +- src/ejabberd_config.erl | 2 +- src/ejabberd_ctl.erl | 2 +- src/ejabberd_frontend_socket.erl | 2 +- src/ejabberd_hooks.erl | 2 +- src/ejabberd_http.erl | 2 +- src/ejabberd_http_poll.erl | 2 +- src/ejabberd_listener.erl | 2 +- src/ejabberd_local.erl | 2 +- src/ejabberd_node_groups.erl | 2 +- src/ejabberd_odbc.erl | 2 +- src/ejabberd_odbc_sup.erl | 2 +- src/ejabberd_piefxis.erl | 2 +- src/ejabberd_rdbms.erl | 2 +- src/ejabberd_receiver.erl | 2 +- src/ejabberd_regexp.erl | 2 +- src/ejabberd_router.erl | 2 +- src/ejabberd_s2s.erl | 2 +- src/ejabberd_s2s_in.erl | 2 +- src/ejabberd_s2s_out.erl | 2 +- src/ejabberd_service.erl | 2 +- src/ejabberd_sm.erl | 2 +- src/ejabberd_socket.erl | 2 +- src/ejabberd_sup.erl | 2 +- src/ejabberd_system_monitor.erl | 2 +- src/ejabberd_tmp_sup.erl | 2 +- src/ejabberd_update.erl | 2 +- src/ejabberd_web.erl | 2 +- src/ejabberd_web_admin.erl | 4 ++-- src/ejd2odbc.erl | 2 +- src/eldap_filter.erl | 2 +- src/eldap_pool.erl | 2 +- src/eldap_utils.erl | 2 +- src/extauth.erl | 2 +- src/gen_iq_handler.erl | 2 +- src/gen_mod.erl | 2 +- src/gen_pubsub_node.erl | 6 +++--- src/gen_pubsub_nodetree.erl | 6 +++--- src/idna.erl | 2 +- src/jd2ejd.erl | 2 +- src/jlib.erl | 2 +- src/mod_adhoc.erl | 2 +- src/mod_announce.erl | 2 +- src/mod_blocking.erl | 2 +- src/mod_caps.erl | 2 +- src/mod_carboncopy.erl | 2 +- src/mod_configure.erl | 2 +- src/mod_configure2.erl | 2 +- src/mod_disco.erl | 2 +- src/mod_echo.erl | 2 +- src/mod_http_bind.erl | 2 +- src/mod_http_fileserver.erl | 2 +- src/mod_ip_blacklist.erl | 2 +- src/mod_irc.erl | 4 ++-- src/mod_irc_connection.erl | 2 +- src/mod_last.erl | 2 +- src/mod_muc.erl | 4 ++-- src/mod_muc_log.erl | 2 +- src/mod_muc_room.erl | 2 +- src/mod_offline.erl | 2 +- src/mod_ping.erl | 2 +- src/mod_pres_counter.erl | 2 +- src/mod_privacy.erl | 2 +- src/mod_private.erl | 2 +- src/mod_proxy65.erl | 2 +- src/mod_proxy65_lib.erl | 2 +- src/mod_proxy65_service.erl | 4 ++-- src/mod_proxy65_sm.erl | 2 +- src/mod_proxy65_stream.erl | 2 +- src/mod_pubsub.erl | 8 ++++---- src/mod_pubsub_odbc.erl | 8 ++++---- src/mod_register.erl | 2 +- src/mod_register_web.erl | 2 +- src/mod_roster.erl | 2 +- src/mod_service_log.erl | 2 +- src/mod_shared_roster.erl | 2 +- src/mod_shared_roster_ldap.erl | 2 +- src/mod_sic.erl | 2 +- src/mod_stats.erl | 2 +- src/mod_time.erl | 2 +- src/mod_vcard.erl | 6 +++--- src/mod_vcard_ldap.erl | 6 +++--- src/mod_version.erl | 2 +- src/node.template | 6 +++--- src/node_buddy.erl | 6 +++--- src/node_club.erl | 6 +++--- src/node_dispatch.erl | 6 +++--- src/node_flat.erl | 6 +++--- src/node_flat_odbc.erl | 6 +++--- src/node_hometree.erl | 6 +++--- src/node_hometree_odbc.erl | 6 +++--- src/node_mb.erl | 6 +++--- src/node_pep.erl | 6 +++--- src/node_pep_odbc.erl | 6 +++--- src/node_private.erl | 6 +++--- src/node_public.erl | 6 +++--- src/nodetree_tree.erl | 6 +++--- src/nodetree_tree_odbc.erl | 6 +++--- src/nodetree_virtual.erl | 6 +++--- src/odbc_queries.erl | 2 +- src/p1_fsm.erl | 2 +- src/p1_mnesia.erl | 4 ++-- src/pubsub_db_odbc.erl | 4 ++-- src/pubsub_index.erl | 6 +++--- src/pubsub_subscription.erl | 4 ++-- src/pubsub_subscription_odbc.erl | 4 ++-- src/randoms.erl | 2 +- src/scram.erl | 2 +- src/shaper.erl | 2 +- src/str.erl | 2 +- src/translate.erl | 2 +- src/treap.erl | 2 +- src/win32_dns.erl | 2 +- 133 files changed, 189 insertions(+), 189 deletions(-) (limited to 'src') diff --git a/src/acl.erl b/src/acl.erl index 3cd789463..32c743ede 100644 --- a/src/acl.erl +++ b/src/acl.erl @@ -5,7 +5,7 @@ %%% Created : 18 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/adhoc.erl b/src/adhoc.erl index 50ef7e5bf..5b1300a4c 100644 --- a/src/adhoc.erl +++ b/src/adhoc.erl @@ -5,7 +5,7 @@ %%% Created : 31 Oct 2005 by Magnus Henoch %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/cyrsasl.erl b/src/cyrsasl.erl index 6c847bb52..fe1500ec2 100644 --- a/src/cyrsasl.erl +++ b/src/cyrsasl.erl @@ -5,7 +5,7 @@ %%% Created : 8 Mar 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/cyrsasl_anonymous.erl b/src/cyrsasl_anonymous.erl index 1daa1c103..5a4893d6b 100644 --- a/src/cyrsasl_anonymous.erl +++ b/src/cyrsasl_anonymous.erl @@ -6,7 +6,7 @@ %%% Created : 23 Aug 2005 by Magnus Henoch %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/cyrsasl_digest.erl b/src/cyrsasl_digest.erl index b837a2e25..39e663cc7 100644 --- a/src/cyrsasl_digest.erl +++ b/src/cyrsasl_digest.erl @@ -5,7 +5,7 @@ %%% Created : 11 Mar 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/cyrsasl_plain.erl b/src/cyrsasl_plain.erl index c5c5f2e02..7bb4f39e4 100644 --- a/src/cyrsasl_plain.erl +++ b/src/cyrsasl_plain.erl @@ -5,7 +5,7 @@ %%% Created : 8 Mar 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/cyrsasl_scram.erl b/src/cyrsasl_scram.erl index 7338ea7bb..3e95660b2 100644 --- a/src/cyrsasl_scram.erl +++ b/src/cyrsasl_scram.erl @@ -5,7 +5,7 @@ %%% Created : 7 Aug 2011 by Stephen Röttger %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd.erl b/src/ejabberd.erl index 78ef10089..057b4e1d7 100644 --- a/src/ejabberd.erl +++ b/src/ejabberd.erl @@ -5,7 +5,7 @@ %%% Created : 16 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_admin.erl b/src/ejabberd_admin.erl index a21331536..3cf5319e6 100644 --- a/src/ejabberd_admin.erl +++ b/src/ejabberd_admin.erl @@ -5,7 +5,7 @@ %%% Created : 7 May 2006 by Mickael Remond %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl index dba61b7d9..db364c0ee 100644 --- a/src/ejabberd_app.erl +++ b/src/ejabberd_app.erl @@ -5,7 +5,7 @@ %%% Created : 31 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 704c82cd4..8790ad505 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -5,7 +5,7 @@ %%% Created : 23 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl index 180e9d0df..3523593e8 100644 --- a/src/ejabberd_auth_anonymous.erl +++ b/src/ejabberd_auth_anonymous.erl @@ -5,7 +5,7 @@ %%% Created : 17 Feb 2006 by Mickael Remond %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl index 514b551d7..640e44091 100644 --- a/src/ejabberd_auth_external.erl +++ b/src/ejabberd_auth_external.erl @@ -5,7 +5,7 @@ %%% Created : 12 Dec 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth_internal.erl b/src/ejabberd_auth_internal.erl index 8d7d0a0dd..cf50c6f4e 100644 --- a/src/ejabberd_auth_internal.erl +++ b/src/ejabberd_auth_internal.erl @@ -5,7 +5,7 @@ %%% Created : 12 Dec 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth_ldap.erl b/src/ejabberd_auth_ldap.erl index 1c1a4f313..0afa87194 100644 --- a/src/ejabberd_auth_ldap.erl +++ b/src/ejabberd_auth_ldap.erl @@ -5,7 +5,7 @@ %%% Created : 12 Dec 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth_odbc.erl b/src/ejabberd_auth_odbc.erl index a1841f3d1..48fd34bf7 100644 --- a/src/ejabberd_auth_odbc.erl +++ b/src/ejabberd_auth_odbc.erl @@ -5,7 +5,7 @@ %%% Created : 12 Dec 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_auth_pam.erl b/src/ejabberd_auth_pam.erl index 8e744e2c4..bace7ddbb 100644 --- a/src/ejabberd_auth_pam.erl +++ b/src/ejabberd_auth_pam.erl @@ -5,7 +5,7 @@ %%% Created : 5 Jul 2007 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index ae5fc97b8..fdaa8586d 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -5,7 +5,7 @@ %%% Created : 16 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_c2s_config.erl b/src/ejabberd_c2s_config.erl index 2229e5ef1..9c7297d3b 100644 --- a/src/ejabberd_c2s_config.erl +++ b/src/ejabberd_c2s_config.erl @@ -6,7 +6,7 @@ %%% Created : 2 Nov 2007 by Mickael Remond %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index e9a3ea3a9..f4515ec5b 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -5,7 +5,7 @@ %%% Created : 26 Apr 2008 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl index 5287876ce..a6de0a20b 100644 --- a/src/ejabberd_commands.erl +++ b/src/ejabberd_commands.erl @@ -5,7 +5,7 @@ %%% Created : 20 May 2008 by Badlop %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index 0551b49a5..79b7b77ca 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -5,7 +5,7 @@ %%% Created : 14 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 46a365019..06f4bce15 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -5,7 +5,7 @@ %%% Created : 11 Jan 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_frontend_socket.erl b/src/ejabberd_frontend_socket.erl index 583396ec9..41c329af9 100644 --- a/src/ejabberd_frontend_socket.erl +++ b/src/ejabberd_frontend_socket.erl @@ -5,7 +5,7 @@ %%% Created : 23 Aug 2006 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_hooks.erl b/src/ejabberd_hooks.erl index 3891fd9ff..2e5790755 100644 --- a/src/ejabberd_hooks.erl +++ b/src/ejabberd_hooks.erl @@ -5,7 +5,7 @@ %%% Created : 8 Aug 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index 4919242a2..3e6b54d6c 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -5,7 +5,7 @@ %%% Created : 27 Feb 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_http_poll.erl b/src/ejabberd_http_poll.erl index a00e690e2..fbf929025 100644 --- a/src/ejabberd_http_poll.erl +++ b/src/ejabberd_http_poll.erl @@ -5,7 +5,7 @@ %%% Created : 4 Mar 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 5dc26c68e..b0d261ccb 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -5,7 +5,7 @@ %%% Created : 16 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index f288bed9a..52accef40 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -5,7 +5,7 @@ %%% Created : 30 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_node_groups.erl b/src/ejabberd_node_groups.erl index eb39b7265..58594b423 100644 --- a/src/ejabberd_node_groups.erl +++ b/src/ejabberd_node_groups.erl @@ -5,7 +5,7 @@ %%% Created : 1 Nov 2006 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_odbc.erl b/src/ejabberd_odbc.erl index 554322c23..494f6a961 100644 --- a/src/ejabberd_odbc.erl +++ b/src/ejabberd_odbc.erl @@ -5,7 +5,7 @@ %%% Created : 8 Dec 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_odbc_sup.erl b/src/ejabberd_odbc_sup.erl index 86b737948..c7a1f1278 100644 --- a/src/ejabberd_odbc_sup.erl +++ b/src/ejabberd_odbc_sup.erl @@ -5,7 +5,7 @@ %%% Created : 22 Dec 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl index 6c13e7426..fd5a66df2 100644 --- a/src/ejabberd_piefxis.erl +++ b/src/ejabberd_piefxis.erl @@ -9,7 +9,7 @@ %%% @doc %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_rdbms.erl b/src/ejabberd_rdbms.erl index b5525de10..b73710562 100644 --- a/src/ejabberd_rdbms.erl +++ b/src/ejabberd_rdbms.erl @@ -5,7 +5,7 @@ %%% Created : 31 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_receiver.erl b/src/ejabberd_receiver.erl index f666ea837..64cd67df5 100644 --- a/src/ejabberd_receiver.erl +++ b/src/ejabberd_receiver.erl @@ -5,7 +5,7 @@ %%% Created : 10 Nov 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_regexp.erl b/src/ejabberd_regexp.erl index 6603ec626..81943d1cf 100644 --- a/src/ejabberd_regexp.erl +++ b/src/ejabberd_regexp.erl @@ -5,7 +5,7 @@ %%% Created : 8 Dec 2011 by Badlop %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index 24f52d329..b2ca301d2 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -5,7 +5,7 @@ %%% Created : 27 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index b13fdd58e..88604cd7c 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -5,7 +5,7 @@ %%% Created : 7 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 4789f8652..97c65af74 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -5,7 +5,7 @@ %%% Created : 6 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index a5acdad95..7222e43b1 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -5,7 +5,7 @@ %%% Created : 6 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl index 35f7c187a..8dc017563 100644 --- a/src/ejabberd_service.erl +++ b/src/ejabberd_service.erl @@ -5,7 +5,7 @@ %%% Created : 6 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index c7e277a8d..19ab9cb5a 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -5,7 +5,7 @@ %%% Created : 24 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_socket.erl b/src/ejabberd_socket.erl index 58bb80efe..0da34180b 100644 --- a/src/ejabberd_socket.erl +++ b/src/ejabberd_socket.erl @@ -5,7 +5,7 @@ %%% Created : 23 Aug 2006 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_sup.erl b/src/ejabberd_sup.erl index b3da8369d..08164c970 100644 --- a/src/ejabberd_sup.erl +++ b/src/ejabberd_sup.erl @@ -5,7 +5,7 @@ %%% Created : 31 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_system_monitor.erl b/src/ejabberd_system_monitor.erl index 92a41b9d8..c32629da8 100644 --- a/src/ejabberd_system_monitor.erl +++ b/src/ejabberd_system_monitor.erl @@ -5,7 +5,7 @@ %%% Created : 21 Mar 2007 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_tmp_sup.erl b/src/ejabberd_tmp_sup.erl index c3d2a186e..1ac20c649 100644 --- a/src/ejabberd_tmp_sup.erl +++ b/src/ejabberd_tmp_sup.erl @@ -5,7 +5,7 @@ %%% Created : 18 Jul 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_update.erl b/src/ejabberd_update.erl index 41c2ea510..63d06b5a1 100644 --- a/src/ejabberd_update.erl +++ b/src/ejabberd_update.erl @@ -5,7 +5,7 @@ %%% Created : 27 Jan 2006 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_web.erl b/src/ejabberd_web.erl index 70f62de7f..72ab57646 100644 --- a/src/ejabberd_web.erl +++ b/src/ejabberd_web.erl @@ -6,7 +6,7 @@ %%% Created : 28 Feb 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index 7a676f674..c8974e637 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -5,7 +5,7 @@ %%% Created : 9 Apr 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -341,7 +341,7 @@ make_xhtml(Els, Host, Node, Lang, JID) -> ?XAE(<<"div">>, [{<<"id">>, <<"copyrightouter">>}], [?XAE(<<"div">>, [{<<"id">>, <<"copyright">>}], [?XC(<<"p">>, - <<"ejabberd (c) 2002-2013 ProcessOne">>)])])])]}}. + <<"ejabberd (c) 2002-2014 ProcessOne">>)])])])]}}. get_base_path(global, cluster) -> <<"/admin/">>; get_base_path(Host, cluster) -> diff --git a/src/ejd2odbc.erl b/src/ejd2odbc.erl index 7afcd6154..4aaaddbf6 100644 --- a/src/ejd2odbc.erl +++ b/src/ejd2odbc.erl @@ -5,7 +5,7 @@ %%% Created : 22 Aug 2005 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/eldap_filter.erl b/src/eldap_filter.erl index 6771fc2af..582a30d24 100644 --- a/src/eldap_filter.erl +++ b/src/eldap_filter.erl @@ -6,7 +6,7 @@ %%% Author: Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/eldap_pool.erl b/src/eldap_pool.erl index 35fabeb74..663467aa8 100644 --- a/src/eldap_pool.erl +++ b/src/eldap_pool.erl @@ -5,7 +5,7 @@ %%% Created : 12 Nov 2006 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/eldap_utils.erl b/src/eldap_utils.erl index a18a04ed6..ea90e0c39 100644 --- a/src/eldap_utils.erl +++ b/src/eldap_utils.erl @@ -5,7 +5,7 @@ %%% Created : 12 Oct 2006 by Mickael Remond %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/extauth.erl b/src/extauth.erl index e57ac0b8d..6b34533df 100644 --- a/src/extauth.erl +++ b/src/extauth.erl @@ -5,7 +5,7 @@ %%% Created : 30 Jul 2004 by Leif Johansson %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl index 628c1c90c..1f183a16b 100644 --- a/src/gen_iq_handler.erl +++ b/src/gen_iq_handler.erl @@ -5,7 +5,7 @@ %%% Created : 22 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/gen_mod.erl b/src/gen_mod.erl index 0b06529b5..0ae63ef1f 100644 --- a/src/gen_mod.erl +++ b/src/gen_mod.erl @@ -6,7 +6,7 @@ %%% Created : 24 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/gen_pubsub_node.erl b/src/gen_pubsub_node.erl index 0cf1fd2ff..a1252f9f8 100644 --- a/src/gen_pubsub_node.erl +++ b/src/gen_pubsub_node.erl @@ -11,12 +11,12 @@ %%% under the License. %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/gen_pubsub_nodetree.erl b/src/gen_pubsub_nodetree.erl index 8acba659c..e343f4581 100644 --- a/src/gen_pubsub_nodetree.erl +++ b/src/gen_pubsub_nodetree.erl @@ -11,12 +11,12 @@ %%% under the License. %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/idna.erl b/src/idna.erl index 7e3d0aefb..18b14ff89 100644 --- a/src/idna.erl +++ b/src/idna.erl @@ -5,7 +5,7 @@ %%% Created : 10 Apr 2004 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/jd2ejd.erl b/src/jd2ejd.erl index a60033998..229f0997b 100644 --- a/src/jd2ejd.erl +++ b/src/jd2ejd.erl @@ -5,7 +5,7 @@ %%% Created : 2 Feb 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/jlib.erl b/src/jlib.erl index 46e864b0c..8606686d0 100644 --- a/src/jlib.erl +++ b/src/jlib.erl @@ -5,7 +5,7 @@ %%% Created : 23 Nov 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_adhoc.erl b/src/mod_adhoc.erl index ae37bb9d6..d64052e2b 100644 --- a/src/mod_adhoc.erl +++ b/src/mod_adhoc.erl @@ -5,7 +5,7 @@ %%% Created : 15 Nov 2005 by Magnus Henoch %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_announce.erl b/src/mod_announce.erl index b558897a0..ec924edf0 100644 --- a/src/mod_announce.erl +++ b/src/mod_announce.erl @@ -5,7 +5,7 @@ %%% Created : 11 Aug 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_blocking.erl b/src/mod_blocking.erl index 2aaff7bae..6cdb20d9d 100644 --- a/src/mod_blocking.erl +++ b/src/mod_blocking.erl @@ -5,7 +5,7 @@ %%% Created : 24 Aug 2008 by Stephan Maka %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_caps.erl b/src/mod_caps.erl index ac115d646..a4b4d5698 100644 --- a/src/mod_caps.erl +++ b/src/mod_caps.erl @@ -5,7 +5,7 @@ %%% Created : 7 Oct 2006 by Magnus Henoch %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index cc5cb83b0..d5d1db6c5 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -7,7 +7,7 @@ %%% {mod_carboncopy, []} %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_configure.erl b/src/mod_configure.erl index b6c8f55b7..c8a8ebddd 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -5,7 +5,7 @@ %%% Created : 19 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_configure2.erl b/src/mod_configure2.erl index 375621441..bfab4789f 100644 --- a/src/mod_configure2.erl +++ b/src/mod_configure2.erl @@ -5,7 +5,7 @@ %%% Created : 26 Oct 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_disco.erl b/src/mod_disco.erl index b11c9629a..ba4e59ab3 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -5,7 +5,7 @@ %%% Created : 1 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_echo.erl b/src/mod_echo.erl index 077a4de49..ff33f7bfb 100644 --- a/src/mod_echo.erl +++ b/src/mod_echo.erl @@ -5,7 +5,7 @@ %%% Created : 15 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_http_bind.erl b/src/mod_http_bind.erl index dcaa8a91a..a4ab85dbe 100644 --- a/src/mod_http_bind.erl +++ b/src/mod_http_bind.erl @@ -5,7 +5,7 @@ %%% Created : Tue Feb 20 13:15:52 CET 2007 %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_http_fileserver.erl b/src/mod_http_fileserver.erl index fcfa12b59..1d05a367c 100644 --- a/src/mod_http_fileserver.erl +++ b/src/mod_http_fileserver.erl @@ -5,7 +5,7 @@ %%% Created : %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_ip_blacklist.erl b/src/mod_ip_blacklist.erl index 3af5aaac0..98f27bbf4 100644 --- a/src/mod_ip_blacklist.erl +++ b/src/mod_ip_blacklist.erl @@ -7,7 +7,7 @@ %%% {mod_ip_blacklist, []} %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_irc.erl b/src/mod_irc.erl index 3aa57002f..20cf62d48 100644 --- a/src/mod_irc.erl +++ b/src/mod_irc.erl @@ -5,7 +5,7 @@ %%% Created : 15 Feb 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -466,7 +466,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd IRC module">>))/binary, - "\nCopyright (c) 2003-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2003-2014 ProcessOne">>}]}]. command_items(ServerHost, Host, Lang) -> lists:map(fun ({Node, Name, _Function}) -> diff --git a/src/mod_irc_connection.erl b/src/mod_irc_connection.erl index c37ca7cb4..dc7643cd0 100644 --- a/src/mod_irc_connection.erl +++ b/src/mod_irc_connection.erl @@ -5,7 +5,7 @@ %%% Created : 15 Feb 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_last.erl b/src/mod_last.erl index 6e35938d2..45448feb6 100644 --- a/src/mod_last.erl +++ b/src/mod_last.erl @@ -5,7 +5,7 @@ %%% Created : 24 Oct 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_muc.erl b/src/mod_muc.erl index 7934e6f95..276f66239 100644 --- a/src/mod_muc.erl +++ b/src/mod_muc.erl @@ -5,7 +5,7 @@ %%% Created : 19 Mar 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -1020,7 +1020,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd MUC module">>))/binary, - "\nCopyright (c) 2003-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2003-2014 ProcessOne">>}]}]. broadcast_service_message(Host, Msg) -> diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl index 357d19216..ba26819f4 100644 --- a/src/mod_muc_log.erl +++ b/src/mod_muc_log.erl @@ -5,7 +5,7 @@ %%% Created : 12 Mar 2006 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 1ef90b1eb..844e89470 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -5,7 +5,7 @@ %%% Created : 19 Mar 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_offline.erl b/src/mod_offline.erl index f4e0a888f..ffcca8169 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -5,7 +5,7 @@ %%% Created : 5 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_ping.erl b/src/mod_ping.erl index 078b0d13d..c5dd16018 100644 --- a/src/mod_ping.erl +++ b/src/mod_ping.erl @@ -5,7 +5,7 @@ %%% Created : 11 Jul 2009 by Brian Cully %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_pres_counter.erl b/src/mod_pres_counter.erl index 30f5308c0..257b215ba 100644 --- a/src/mod_pres_counter.erl +++ b/src/mod_pres_counter.erl @@ -5,7 +5,7 @@ %%% Created : 23 Sep 2010 by Ahmed Omar %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 5edfccd28..ac886fef4 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -5,7 +5,7 @@ %%% Created : 21 Jul 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_private.erl b/src/mod_private.erl index ae7068480..0f4aa5bca 100644 --- a/src/mod_private.erl +++ b/src/mod_private.erl @@ -5,7 +5,7 @@ %%% Created : 16 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_proxy65.erl b/src/mod_proxy65.erl index 85bec283b..361bbb4e6 100644 --- a/src/mod_proxy65.erl +++ b/src/mod_proxy65.erl @@ -5,7 +5,7 @@ %%% Created : 12 Oct 2006 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_proxy65_lib.erl b/src/mod_proxy65_lib.erl index 388811436..18e4714be 100644 --- a/src/mod_proxy65_lib.erl +++ b/src/mod_proxy65_lib.erl @@ -5,7 +5,7 @@ %%% Created : 12 Oct 2006 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl index 33d40b1cc..b53a31fc9 100644 --- a/src/mod_proxy65_service.erl +++ b/src/mod_proxy65_service.erl @@ -5,7 +5,7 @@ %%% Created : 12 Oct 2006 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -248,7 +248,7 @@ iq_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd SOCKS5 Bytestreams module">>))/binary, - "\nCopyright (c) 2003-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2003-2014 ProcessOne">>}]}]. parse_options(ServerHost, Opts) -> MyHost = gen_mod:get_opt_host(ServerHost, Opts, diff --git a/src/mod_proxy65_sm.erl b/src/mod_proxy65_sm.erl index fa9d257ef..5b185b2eb 100644 --- a/src/mod_proxy65_sm.erl +++ b/src/mod_proxy65_sm.erl @@ -5,7 +5,7 @@ %%% Created : 12 Oct 2006 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_proxy65_stream.erl b/src/mod_proxy65_stream.erl index b37dcc13a..f8cdce975 100644 --- a/src/mod_proxy65_stream.erl +++ b/src/mod_proxy65_stream.erl @@ -4,7 +4,7 @@ %%% Purpose : Bytestream process. %%% Created : 12 Oct 2006 by Evgeniy Khramtsov %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 9bb5acfa4..87d49cb54 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -13,11 +13,11 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} @@ -1910,7 +1910,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd Publish-Subscribe module">>))/binary, - "\nCopyright (c) 2004-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2004-2014 ProcessOne">>}]}]. -spec(iq_pubsub/6 :: ( diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 1a182e4d6..3d26ad0fa 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -13,11 +13,11 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} @@ -1569,7 +1569,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd Publish-Subscribe module">>))/binary, - "\nCopyright (c) 2004-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2004-2014 ProcessOne">>}]}]. -spec(iq_pubsub/6 :: ( diff --git a/src/mod_register.erl b/src/mod_register.erl index c7da225ef..335d116db 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -5,7 +5,7 @@ %%% Created : 8 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index 841685a94..cade4bcc8 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -5,7 +5,7 @@ %%% Created : 4 May 2008 by Badlop %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 4851b8fb5..93e0b665a 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -5,7 +5,7 @@ %%% Created : 11 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_service_log.erl b/src/mod_service_log.erl index 82497a609..11216f951 100644 --- a/src/mod_service_log.erl +++ b/src/mod_service_log.erl @@ -5,7 +5,7 @@ %%% Created : 24 Aug 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 743b1dd62..2f542a9bb 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -5,7 +5,7 @@ %%% Created : 5 Mar 2005 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_shared_roster_ldap.erl b/src/mod_shared_roster_ldap.erl index 322909a2c..8f7b30729 100644 --- a/src/mod_shared_roster_ldap.erl +++ b/src/mod_shared_roster_ldap.erl @@ -7,7 +7,7 @@ %%% Created : 5 Mar 2005 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_sic.erl b/src/mod_sic.erl index b1ae44d04..5df41018d 100644 --- a/src/mod_sic.erl +++ b/src/mod_sic.erl @@ -5,7 +5,7 @@ %%% Created : 6 Mar 2010 by Karim Gemayel %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_stats.erl b/src/mod_stats.erl index a35928975..cdd2b6acf 100644 --- a/src/mod_stats.erl +++ b/src/mod_stats.erl @@ -5,7 +5,7 @@ %%% Created : 11 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_time.erl b/src/mod_time.erl index d6c8363d7..e27490855 100644 --- a/src/mod_time.erl +++ b/src/mod_time.erl @@ -6,7 +6,7 @@ %%% Created : 18 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 08feb071a..b709811a1 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -5,7 +5,7 @@ %%% Created : 2 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -163,7 +163,7 @@ process_local_iq(_From, _To, [{xmlcdata, <<(translate:translate(Lang, <<"Erlang Jabber Server">>))/binary, - "\nCopyright (c) 2002-2013 ProcessOne">>}]}, + "\nCopyright (c) 2002-2014 ProcessOne">>}]}, #xmlel{name = <<"BDAY">>, attrs = [], children = [{xmlcdata, <<"2002-11-16">>}]}]}]} @@ -533,7 +533,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd vCard module">>))/binary, - "\nCopyright (c) 2003-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2003-2014 ProcessOne">>}]}]. find_xdata_el(#xmlel{children = SubEls}) -> find_xdata_el1(SubEls). diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 1c96dd4a1..4ef9fb545 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -5,7 +5,7 @@ %%% Created : 2 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -221,7 +221,7 @@ process_local_iq(_From, _To, [{xmlcdata, <<(translate:translate(Lang, <<"Erlang Jabber Server">>))/binary, - "\nCopyright (c) 2002-2013 ProcessOne">>}]}, + "\nCopyright (c) 2002-2014 ProcessOne">>}]}, #xmlel{name = <<"BDAY">>, attrs = [], children = [{xmlcdata, <<"2002-11-16">>}]}]}]} @@ -582,7 +582,7 @@ iq_get_vcard(Lang) -> [{xmlcdata, <<(translate:translate(Lang, <<"ejabberd vCard module">>))/binary, - "\nCopyright (c) 2003-2013 ProcessOne">>}]}]. + "\nCopyright (c) 2003-2014 ProcessOne">>}]}]. -define(LFIELD(Label, Var), #xmlel{name = <<"field">>, diff --git a/src/mod_version.erl b/src/mod_version.erl index 3ae9b8428..695c0dd7e 100644 --- a/src/mod_version.erl +++ b/src/mod_version.erl @@ -5,7 +5,7 @@ %%% Created : 18 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/node.template b/src/node.template index b31d8a8e2..45744c059 100644 --- a/src/node.template +++ b/src/node.template @@ -11,11 +11,11 @@ %%% under the License. %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_buddy.erl b/src/node_buddy.erl index 23269b1eb..6db076935 100644 --- a/src/node_buddy.erl +++ b/src/node_buddy.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_club.erl b/src/node_club.erl index 10849b36d..5e6581ad8 100644 --- a/src/node_club.erl +++ b/src/node_club.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_dispatch.erl b/src/node_dispatch.erl index 9b72af7e7..81fe20d2b 100644 --- a/src/node_dispatch.erl +++ b/src/node_dispatch.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_flat.erl b/src/node_flat.erl index 836858520..e28fd3477 100644 --- a/src/node_flat.erl +++ b/src/node_flat.erl @@ -13,11 +13,11 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_flat_odbc.erl b/src/node_flat_odbc.erl index 5736832ea..d299c8d52 100644 --- a/src/node_flat_odbc.erl +++ b/src/node_flat_odbc.erl @@ -13,11 +13,11 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_hometree.erl b/src/node_hometree.erl index ff291635f..f59d8d9c0 100644 --- a/src/node_hometree.erl +++ b/src/node_hometree.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_hometree_odbc.erl b/src/node_hometree_odbc.erl index a98e56dcf..dfb9886f2 100644 --- a/src/node_hometree_odbc.erl +++ b/src/node_hometree_odbc.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_mb.erl b/src/node_mb.erl index c626b7a93..6587b5c07 100644 --- a/src/node_mb.erl +++ b/src/node_mb.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Eric Cestari %%% @version {@vsn}, {@date} {@time} %%% @end diff --git a/src/node_pep.erl b/src/node_pep.erl index 5635dee94..47afee945 100644 --- a/src/node_pep.erl +++ b/src/node_pep.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_pep_odbc.erl b/src/node_pep_odbc.erl index e4e1fafa9..4c7d8909b 100644 --- a/src/node_pep_odbc.erl +++ b/src/node_pep_odbc.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_private.erl b/src/node_private.erl index 27b7158a1..61f6d6a68 100644 --- a/src/node_private.erl +++ b/src/node_private.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/node_public.erl b/src/node_public.erl index 3c391cfe8..bcabec6eb 100644 --- a/src/node_public.erl +++ b/src/node_public.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/nodetree_tree.erl b/src/nodetree_tree.erl index 23159d7a2..1dc7fa9fb 100644 --- a/src/nodetree_tree.erl +++ b/src/nodetree_tree.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/nodetree_tree_odbc.erl b/src/nodetree_tree_odbc.erl index 1cc45cfb5..1a5a4317f 100644 --- a/src/nodetree_tree_odbc.erl +++ b/src/nodetree_tree_odbc.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/nodetree_virtual.erl b/src/nodetree_virtual.erl index 1486fbc05..9e2e31f9f 100644 --- a/src/nodetree_virtual.erl +++ b/src/nodetree_virtual.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/odbc_queries.erl b/src/odbc_queries.erl index 314b7cc13..168db9fe0 100644 --- a/src/odbc_queries.erl +++ b/src/odbc_queries.erl @@ -5,7 +5,7 @@ %%% Created : by Mickael Remond %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/p1_fsm.erl b/src/p1_fsm.erl index 70773e9b8..80f08c609 100644 --- a/src/p1_fsm.erl +++ b/src/p1_fsm.erl @@ -14,7 +14,7 @@ %% AB. All Rights Reserved.'' %% %% The code has been modified and improved by ProcessOne. -%% Copyright 2007-2013, ProcessOne +%% Copyright 2007-2014, ProcessOne %% %% The change adds the following features: %% - You can send exit(priority_shutdown) to the p1_fsm process to diff --git a/src/p1_mnesia.erl b/src/p1_mnesia.erl index fa308176c..b792472a6 100644 --- a/src/p1_mnesia.erl +++ b/src/p1_mnesia.erl @@ -13,10 +13,10 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' %%% -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. -module(p1_mnesia). diff --git a/src/pubsub_db_odbc.erl b/src/pubsub_db_odbc.erl index ca1318865..320a58c90 100644 --- a/src/pubsub_db_odbc.erl +++ b/src/pubsub_db_odbc.erl @@ -11,9 +11,9 @@ %%% under the License. %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% @author Pablo Polvorin %%% @version {@vsn}, {@date} {@time} diff --git a/src/pubsub_index.erl b/src/pubsub_index.erl index 1ff5a1e45..9859141df 100644 --- a/src/pubsub_index.erl +++ b/src/pubsub_index.erl @@ -13,12 +13,12 @@ %%% %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% -%%% @copyright 2006-2013 ProcessOne +%%% @copyright 2006-2014 ProcessOne %%% @author Christophe Romain %%% [http://www.process-one.net/] %%% @version {@vsn}, {@date} {@time} diff --git a/src/pubsub_subscription.erl b/src/pubsub_subscription.erl index bb09cdd60..64bb8c2da 100644 --- a/src/pubsub_subscription.erl +++ b/src/pubsub_subscription.erl @@ -11,9 +11,9 @@ %%% under the License. %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% @author Brian Cully %%% @version {@vsn}, {@date} {@time} diff --git a/src/pubsub_subscription_odbc.erl b/src/pubsub_subscription_odbc.erl index 55b337c80..f0efcefb5 100644 --- a/src/pubsub_subscription_odbc.erl +++ b/src/pubsub_subscription_odbc.erl @@ -11,9 +11,9 @@ %%% under the License. %%% %%% The Initial Developer of the Original Code is ProcessOne. -%%% Portions created by ProcessOne are Copyright 2006-2013, ProcessOne +%%% Portions created by ProcessOne are Copyright 2006-2014, ProcessOne %%% All Rights Reserved.'' -%%% This software is copyright 2006-2013, ProcessOne. +%%% This software is copyright 2006-2014, ProcessOne. %%% %%% @author Pablo Polvorin %%% @author based on pubsub_subscription.erl by Brian Cully diff --git a/src/randoms.erl b/src/randoms.erl index 0fd1f304c..13653b63e 100644 --- a/src/randoms.erl +++ b/src/randoms.erl @@ -5,7 +5,7 @@ %%% Created : 13 Dec 2002 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/scram.erl b/src/scram.erl index 407f69d2f..5868784ca 100644 --- a/src/scram.erl +++ b/src/scram.erl @@ -5,7 +5,7 @@ %%% Created : 7 Aug 2011 by Stephen Röttger %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/shaper.erl b/src/shaper.erl index b9f460395..d89f60fbe 100644 --- a/src/shaper.erl +++ b/src/shaper.erl @@ -5,7 +5,7 @@ %%% Created : 9 Feb 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/str.erl b/src/str.erl index d4d448594..bf1b16af3 100644 --- a/src/str.erl +++ b/src/str.erl @@ -5,7 +5,7 @@ %%% Created : 23 Feb 2012 by Evgeniy Khramtsov %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/translate.erl b/src/translate.erl index fd2ebcc64..9dba065f9 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -5,7 +5,7 @@ %%% Created : 6 Jan 2003 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/treap.erl b/src/treap.erl index 607f2c8ab..cafbcaf4e 100644 --- a/src/treap.erl +++ b/src/treap.erl @@ -5,7 +5,7 @@ %%% Created : 22 Apr 2008 by Alexey Shchepin %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as diff --git a/src/win32_dns.erl b/src/win32_dns.erl index 9f80a08de..535b688fc 100644 --- a/src/win32_dns.erl +++ b/src/win32_dns.erl @@ -5,7 +5,7 @@ %%% Created : 5 Mar 2009 by Geoff Cant %%% %%% -%%% ejabberd, Copyright (C) 2002-2013 ProcessOne +%%% ejabberd, Copyright (C) 2002-2014 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as -- cgit v1.2.3 From d5f90965d72d617fd8cc604f78c530a50ec48087 Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 24 Mar 2014 19:40:55 +0100 Subject: Fix ACLs syntax change (thanks to jokker23)(issue #140) --- src/acl.erl | 2 ++ src/ejabberd_web_admin.erl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/acl.erl b/src/acl.erl index 32c743ede..809d6ff33 100644 --- a/src/acl.erl +++ b/src/acl.erl @@ -237,6 +237,8 @@ normalize_spec(Spec) -> {server_regexp, SR} -> {server_regexp, b(SR)}; {server_glob, S} -> {server_glob, b(S)}; {resource_glob, R} -> {resource_glob, b(R)}; + {ip, {Net, Mask}} -> + {ip, {Net, Mask}}; {ip, S} -> case parse_ip_netmask(b(S)) of {ok, Net, Mask} -> diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index c8974e637..9f5a5f08f 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -1138,7 +1138,7 @@ string_to_spec2(ACLName, Val) -> jlib:string_to_jid(Val), case U of <<"">> -> {ACLName, S}; - _ -> {ACLName, U, S} + _ -> {ACLName, {U, S}} end. acl_parse_delete(ACLs, Query) -> -- cgit v1.2.3 From 5c36c44689a435fb93b5d1f2e13c763ab92ecbeb Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 21 Aug 2013 11:42:56 +1000 Subject: Remove annyoing warnings --- src/acl.erl | 3 --- src/shaper.erl | 2 -- 2 files changed, 5 deletions(-) (limited to 'src') diff --git a/src/acl.erl b/src/acl.erl index 809d6ff33..6e05b2002 100644 --- a/src/acl.erl +++ b/src/acl.erl @@ -265,9 +265,6 @@ match_rule(Host, Access, JID) -> end, case GAccess ++ LAccess of [] -> - ?WARNING_MSG("Attempt to match against unspecified " - "access rule '~s' (scope: ~s)", - [Access, Host]), deny; AccessList -> Rules = lists:flatmap( diff --git a/src/shaper.erl b/src/shaper.erl index d89f60fbe..bdccac329 100644 --- a/src/shaper.erl +++ b/src/shaper.erl @@ -84,8 +84,6 @@ new(Name) -> [#shaper{maxrate = R}] -> R; [] -> - ?WARNING_MSG("Attempt to initialize an " - "unspecified shaper '~s'", [Name]), none end, new1(MaxRate). -- cgit v1.2.3 From 2150b10901f1630c70f0da235de9d49a45dfde8d Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Tue, 25 Mar 2014 09:52:39 +0400 Subject: Fix service_info options processing --- src/mod_disco.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mod_disco.erl b/src/mod_disco.erl index ba4e59ab3..627b9ab0f 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -488,10 +488,10 @@ get_fields_xml(Host, Module) -> lists:map( fun(Opts) -> Mods = proplists:get_value(modules, Opts, all), - Name = proplists:get_value(names, Opts, <<>>), + Name = proplists:get_value(name, Opts, <<>>), URLs = proplists:get_value(urls, Opts, []), {Mods, Name, URLs} - end, lists:flatten(L)) + end, L) end, []), Fields_good = lists:filter(fun ({Modules, _, _}) -> case Modules of -- cgit v1.2.3 From ac0e199d368c9cbe308c3e64cc925b03e42f3806 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 26 Mar 2014 16:01:37 +0100 Subject: Provide meaningful text to user when admin kicks session (EJAB-1455) --- src/ejabberd_c2s.erl | 11 ++++++----- src/mod_configure.erl | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index fdaa8586d..83dfd2f07 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -1217,14 +1217,15 @@ handle_info({send_text, Text}, StateName, StateData) -> send_text(StateData, Text), ejabberd_hooks:run(c2s_loop_debug, [Text]), fsm_next_state(StateName, StateData); -handle_info(replaced, _StateName, StateData) -> +handle_info(replaced, StateName, StateData) -> Lang = StateData#state.lang, - send_element(StateData, - ?SERRT_CONFLICT(Lang, - <<"Replaced by new connection">>)), + Xmlelement = ?SERRT_CONFLICT(Lang, <<"Replaced by new connection">>), + handle_info({kick, replaced, Xmlelement}, StateName, StateData); +handle_info({kick, Reason, Xmlelement}, _StateName, StateData) -> + send_element(StateData, Xmlelement), send_trailer(StateData), {stop, normal, - StateData#state{authenticated = replaced}}; + StateData#state{authenticated = Reason}}; handle_info({route, _From, _To, {broadcast, Data}}, StateName, StateData) -> ?DEBUG("broadcast~n~p~n", [Data]), diff --git a/src/mod_configure.erl b/src/mod_configure.erl index c8a8ebddd..d9c825b5c 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -1846,13 +1846,14 @@ set_form(From, Host, ?NS_ADMINL(<<"delete-user">>), || {User, Server} <- ASL2], {result, []}; set_form(From, Host, ?NS_ADMINL(<<"end-user-session">>), - _Lang, XData) -> + Lang, XData) -> AccountString = get_value(<<"accountjid">>, XData), JID = jlib:string_to_jid(AccountString), LUser = JID#jid.luser, LServer = JID#jid.lserver, true = LServer == Host orelse get_permission_level(From) == global, + Xmlelement = ?SERRT_POLICY_VIOLATION(Lang, <<"has been kicked">>), case JID#jid.lresource of <<>> -> SIDs = mnesia:dirty_select(session, @@ -1860,14 +1861,14 @@ set_form(From, Host, ?NS_ADMINL(<<"end-user-session">>), usr = {LUser, LServer, '_'}, _ = '_'}, [], ['$1']}]), - [Pid ! replaced || {_, Pid} <- SIDs]; + [Pid ! {kick, kicked_by_admin, Xmlelement} || {_, Pid} <- SIDs]; R -> [{_, Pid}] = mnesia:dirty_select(session, [{#session{sid = '$1', usr = {LUser, LServer, R}, _ = '_'}, [], ['$1']}]), - Pid ! replaced + Pid ! {kick, kicked_by_admin, Xmlelement} end, {result, []}; set_form(From, Host, -- cgit v1.2.3 From a5a065290b51e3f6b3f7b6f47241a979631e5a25 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 26 Mar 2014 16:39:35 +0100 Subject: Small change in ejabberd_ctl output format to support bash completion --- src/ejabberd_ctl.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 06f4bce15..9d5538431 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -565,7 +565,7 @@ format_command_lines(CALD, MaxCmdLen, MaxC, ShCode, dual) -> lists:map( fun({Cmd, Args, CmdArgsL, Desc}) -> DescFmt = prepare_description(MaxCmdLen+4, MaxC, Desc), - [" ", ?B(Cmd), " ", [[?U(Arg), " "] || Arg <- Args], + [" ", ?B(Cmd), " ", [[?U(Arg), " "] || Arg <- Args], string:chars($\s, MaxCmdLen - CmdArgsL + 1), DescFmt, "\n"] end, CALD); @@ -574,7 +574,7 @@ format_command_lines(CALD, _MaxCmdLen, MaxC, ShCode, long) -> lists:map( fun({Cmd, Args, _CmdArgsL, Desc}) -> DescFmt = prepare_description(8, MaxC, Desc), - ["\n ", ?B(Cmd), " ", [[?U(Arg), " "] || Arg <- Args], "\n", " ", + ["\n ", ?B(Cmd), " ", [[?U(Arg), " "] || Arg <- Args], "\n", " ", DescFmt, "\n"] end, CALD). -- cgit v1.2.3 From 8b9c49440a34ef0eb7a68671f2847b1db3e4ae4a Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 31 Mar 2014 16:51:47 +0200 Subject: Fix user_resources command, and ejabberd_xmlrpc parsing auth details in call --- src/ejabberd_sm.erl | 2 +- src/ejabberd_xmlrpc.erl | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 19ab9cb5a..2b704d999 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -800,7 +800,7 @@ commands() -> tags = [session], desc = "List user's connected resources", module = ?MODULE, function = user_resources, - args = [{user, string}, {host, string}], + args = [{user, binary}, {host, binary}], result = {resources, {list, {resource, string}}}}]. -spec connected_users() -> [binary()]. diff --git a/src/ejabberd_xmlrpc.erl b/src/ejabberd_xmlrpc.erl index acda0c7f9..76610af8e 100644 --- a/src/ejabberd_xmlrpc.erl +++ b/src/ejabberd_xmlrpc.erl @@ -345,14 +345,18 @@ build_fault_response(Code, ParseString, ParseArgs) -> do_command(AccessCommands, Auth, Command, AttrL, ArgsF, ResultF) -> ArgsFormatted = format_args(AttrL, ArgsF), - {UserT, ServerT, PasswordT} = Auth, - AuthBin = {list_to_binary(UserT), list_to_binary(ServerT), list_to_binary(PasswordT)}, + AuthBin = convert_auth(Auth), Result = ejabberd_commands:execute_command(AccessCommands, AuthBin, Command, ArgsFormatted), ResultFormatted = format_result(Result, ResultF), {command_result, ResultFormatted}. +convert_auth(noauth) -> + noauth; +convert_auth({UserT, ServerT, PasswordT}) -> + {list_to_binary(UserT), list_to_binary(ServerT), list_to_binary(PasswordT)}. + %%----------------------------- %% Format arguments %%----------------------------- -- cgit v1.2.3 From 1250ee5d77f22e927ffafb54c98fc45ed5d31026 Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Fri, 4 Apr 2014 04:07:29 +0900 Subject: mod_register_web: check same acl as mod_register. --- src/mod_register_web.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index cade4bcc8..cbb6cd082 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -485,9 +485,15 @@ form_del_get(Host, Lang) -> %% {error, not_allowed} | %% {error, invalid_jid} register_account(Username, Host, Password) -> - case jlib:make_jid(Username, Host, <<"">>) of - error -> {error, invalid_jid}; - _ -> register_account2(Username, Host, Password) + Access = gen_mod:get_module_opt(Host, mod_register, access, + fun(A) when is_atom(A) -> A end, + all), + JID = jlib:make_jid(Username, Host, <<"">>), + Match = acl:match_rule(Host, Access, JID), + case {JID, Match} of + {error, _} -> {error, invalid_jid}; + {_, deny} -> {error, not_allowed}; + {_, allow} -> register_account2(Username, Host, Password) end. register_account2(Username, Host, Password) -> -- cgit v1.2.3 From e02a4913d2c6009f33febd2a3fc652cf08099ca9 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 5 Apr 2014 23:23:44 +0200 Subject: Fix badarg issue on module update web site --- src/ejabberd_web_admin.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index 9f5a5f08f..781c125dd 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -2183,7 +2183,7 @@ get_node(global, Node, [<<"update">>], Query, Lang) -> ?XCT(<<"h3">>, <<"Update script">>), FmtScript, ?XCT(<<"h3">>, <<"Low level update script">>), FmtLowLevelScript, ?XCT(<<"h3">>, <<"Script check">>), - ?XC(<<"pre">>, (iolist_to_binary(Check))), + ?XC(<<"pre">>, (jlib:atom_to_binary(Check))), ?BR, ?INPUTT(<<"submit">>, <<"update">>, <<"Update">>)])]; get_node(Host, Node, NPath, Query, Lang) -> -- cgit v1.2.3 From 37f409d254586bb0d560d7a1c6a2338ab0220884 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 6 Apr 2014 00:39:51 +0200 Subject: Fix a type error --- src/ejabberd_http.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index 3e6b54d6c..ce450ebd9 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -51,7 +51,7 @@ request_auth, request_keepalive, request_content_length, - request_lang = "en", + request_lang = <<"en">>, %% XXX bard: request handlers are configured in %% ejabberd.cfg under the HTTP service. For example, %% to have the module test_web handle requests with -- cgit v1.2.3 From 9d5426315f796fd1467f469e888e4aee58b30d37 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 7 Apr 2014 22:10:08 +0200 Subject: Carbons: Also forward messages sent to bare JIDs Don't ignore messages sent to bare JIDs, but forward them to all carbon-copy-enabled resources that don't have the highest priority. --- src/ejabberd_sm.erl | 29 +++++++++++++++-------------- src/mod_carboncopy.erl | 43 +++++++++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 2b704d999..a8038a280 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -38,6 +38,7 @@ bounce_offline_message/3, disconnect_removed_user/2, get_user_resources/2, + get_user_present_resources/2, set_presence/7, unset_presence/6, close_session_unset_presence/5, @@ -167,6 +168,20 @@ get_user_resources(User, Server) -> [element(3, S#session.usr) || S <- clean_session_list(Ss)] end. +-spec get_user_present_resources(binary(), binary()) -> [tuple()]. + +get_user_present_resources(LUser, LServer) -> + US = {LUser, LServer}, + case catch mnesia:dirty_index_read(session, US, + #session.us) + of + {'EXIT', _Reason} -> []; + Ss -> + [{S#session.priority, element(3, S#session.usr)} + || S <- clean_session_list(Ss), + is_integer(S#session.priority)] + end. + -spec get_user_ip(binary(), binary(), binary()) -> ip(). get_user_ip(User, Server, Resource) -> @@ -670,20 +685,6 @@ clean_session_list([S1, S2 | Rest], Res) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -get_user_present_resources(LUser, LServer) -> - US = {LUser, LServer}, - case catch mnesia:dirty_index_read(session, US, - #session.us) - of - {'EXIT', _Reason} -> []; - Ss -> - [{S#session.priority, element(3, S#session.usr)} - || S <- clean_session_list(Ss), - is_integer(S#session.priority)] - end. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %% On new session, check if some existing connections need to be replace check_for_sessions_to_replace(User, Server, Resource) -> LUser = jlib:nodeprep(User), diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index d31791cd5..6a5c88706 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -128,23 +128,18 @@ iq_handler(From, _To, #iq{type=set, sub_el = #xmlel{name = Operation, children iq_handler(_From, _To, IQ, _CC)-> IQ#iq{type=error, sub_el = [?ERR_NOT_ALLOWED]}. -user_send_packet(From, _To, Packet) -> - check_and_forward(From, Packet, sent). +user_send_packet(From, To, Packet) -> + check_and_forward(From, To, Packet, sent). -%% Only make carbon copies if the original destination was not a bare jid. -%% If the original destination was a bare jid, the message is going to be delivered to all -%% connected resources anyway. Avoid duplicate delivery. "XEP-0280 : 3.5 Receiving Messages" -user_receive_packet(JID, _From, #jid{resource=Resource} = _To, Packet) when Resource /= <<>> -> - check_and_forward(JID, Packet, received); -user_receive_packet(_JID, _From, _To, _Packet) -> - ok. +user_receive_packet(JID, _From, To, Packet) -> + check_and_forward(JID, To, Packet, received). % verifier si le trafic est local % Modified from original version: % - registered to the user_send_packet hook, to be called only once even for multicast % - do not support "private" message mode, and do not modify the original packet in any way % - we also replicate "read" notifications -check_and_forward(JID, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, Direction)-> +check_and_forward(JID, To, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, Direction)-> case xml:get_attr_s(<<"type">>, Attrs) of <<"chat">> -> case xml:get_subtag(Packet, <<"private">>) of @@ -155,11 +150,11 @@ check_and_forward(JID, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, Dir %% receiving message back to original sender. SubTag = xml:get_subtag(Packet,<<"sent">>), if SubTag == false -> - send_copies(JID, Packet, Direction); + send_copies(JID, To, Packet, Direction); true -> case xml:get_subtag(SubTag,<<"forwarded">>) of false-> - send_copies(JID, Packet, Direction); + send_copies(JID, To, Packet, Direction); _ -> stop end @@ -175,7 +170,7 @@ check_and_forward(JID, #xmlel{name = <<"message">>, attrs = Attrs} = Packet, Dir ok end; -check_and_forward(_JID, _Packet, _)-> ok. +check_and_forward(_JID, _To, _Packet, _)-> ok. remove_connection(User, Server, Resource, _Status)-> disable(Server, User, Resource), @@ -184,14 +179,26 @@ remove_connection(User, Server, Resource, _Status)-> %%% Internal %% Direction = received | sent -send_copies(JID, Packet, Direction)-> +send_copies(JID, To, Packet, Direction)-> {U, S, R} = jlib:jid_tolower(JID), %% list of JIDs that should receive a carbon copy of this message (excluding the - %% receiver of the original message - TargetJIDs = [ {jlib:make_jid({U, S, CCRes}), CC_Version} || {CCRes, CC_Version} <- list(U, S), CCRes /= R ], - %TargetJIDs = lists:delete(JID, [ jlib:make_jid({U, S, CCRes}) || CCRes <- list(U, S) ]), - + %% receiver(s) of the original message + TargetJIDs = case {Direction, To} of + {received, #jid{resource = <<>>}} -> + PrioRes = ejabberd_sm:get_user_present_resources(U, S), + MaxPrio = case catch lists:max(PrioRes) of + {Prio, _Res} -> Prio; + _ -> 0 + end, + OrigTo = fun(Res) -> lists:member({MaxPrio, Res}, PrioRes) end, + [ {jlib:make_jid({U, S, CCRes}), CC_Version} + || {CCRes, CC_Version} <- list(U, S), not OrigTo(CCRes) ]; + _ -> + [ {jlib:make_jid({U, S, CCRes}), CC_Version} + || {CCRes, CC_Version} <- list(U, S), CCRes /= R ] + %TargetJIDs = lists:delete(JID, [ jlib:make_jid({U, S, CCRes}) || CCRes <- list(U, S) ]), + end, lists:map(fun({Dest,Version}) -> {_, _, Resource} = jlib:jid_tolower(Dest), -- cgit v1.2.3 From fbf71f86f3f970c1c9d56c0c5d21b25a8c67d9ed Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Tue, 1 Apr 2014 21:57:33 +0200 Subject: Add option to specify openssl options --- src/ejabberd_c2s.erl | 17 +++++++++++++---- src/ejabberd_s2s_in.erl | 16 ++++++++++++++-- src/ejabberd_s2s_out.erl | 16 ++++++++++++++-- 3 files changed, 41 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 83dfd2f07..fa0eee8c5 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -245,11 +245,20 @@ init([{SockMod, Socket}, Opts]) -> (_) -> false end, Opts), - TLSOpts2 = case proplists:get_bool(tls_compression, Opts) of - false -> [compression_none | TLSOpts1]; - true -> TLSOpts1 + TLSOpts2 = case lists:keysearch(protocol_options, 1, Opts) of + {value, {_, O}} -> + [_|ProtocolOptions] = lists:foldl( + fun(X, Acc) -> X ++ Acc end, [], + [["|" | binary_to_list(Opt)] || Opt <- O, is_binary(Opt)] + ), + [{protocol_options, iolist_to_binary(ProtocolOptions)} | TLSOpts1]; + _ -> TLSOpts1 end, - TLSOpts = [verify_none | TLSOpts2], + TLSOpts3 = case proplists:get_bool(tls_compression, Opts) of + false -> [compression_none | TLSOpts2]; + true -> TLSOpts2 + end, + TLSOpts = [verify_none | TLSOpts3], IP = peerip(SockMod, Socket), %% Check if IP is blacklisted: case is_ip_blacklisted(IP) of diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 97c65af74..22a69b02c 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -182,9 +182,21 @@ init([{SockMod, Socket}, Opts]) -> undefined -> TLSOpts1; Ciphers -> [{ciphers, Ciphers} | TLSOpts1] end, + TLSOpts3 = case ejabberd_config:get_option( + s2s_protocol_options, + fun (Options) -> + [_|O] = lists:foldl( + fun(X, Acc) -> X ++ Acc end, [], + [["|" | binary_to_list(Opt)] || Opt <- Options, is_binary(Opt)] + ), + iolist_to_binary(O) + end) of + undefined -> TLSOpts2; + ProtocolOpts -> [{protocol_options, ProtocolOpts} | TLSOpts2] + end, TLSOpts = case proplists:get_bool(tls_compression, Opts) of - false -> [compression_none | TLSOpts2]; - true -> TLSOpts2 + false -> [compression_none | TLSOpts3]; + true -> TLSOpts3 end, Timer = erlang:start_timer(?S2STIMEOUT, self(), []), {ok, wait_for_stream, diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 7222e43b1..1f86cf68f 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -196,13 +196,25 @@ init([From, Server, Type]) -> undefined -> TLSOpts1; Ciphers -> [{ciphers, Ciphers} | TLSOpts1] end, + TLSOpts3 = case ejabberd_config:get_option( + s2s_protocol_options, + fun (Options) -> + [_|O] = lists:foldl( + fun(X, Acc) -> X ++ Acc end, [], + [["|" | binary_to_list(Opt)] || Opt <- Options, is_binary(Opt)] + ), + iolist_to_binary(O) + end) of + undefined -> TLSOpts2; + ProtocolOpts -> [{protocol_options, ProtocolOpts} | TLSOpts2] + end, TLSOpts = case ejabberd_config:get_option( {s2s_tls_compression, From}, fun(true) -> true; (false) -> false end, true) of - false -> [compression_none | TLSOpts2]; - true -> TLSOpts2 + false -> [compression_none | TLSOpts3]; + true -> TLSOpts3 end, {New, Verify} = case Type of {new, Key} -> {Key, false}; -- cgit v1.2.3 From b3b12effbca94f9b16c3317fa8fdd9b2f4c5554b Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 8 Apr 2014 23:32:30 +0200 Subject: Carbons: Handle unavailable resource like bare JID As the session manager handles messages sent to unavailable resources just like messages sent to bare JIDs, mod_carboncopy must do that, too. That is, forward them only to those carbon-copy-enabled resources that don't have a top priority, in order to avoid duplicates. --- src/mod_carboncopy.erl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index 6a5c88706..dbb942dd5 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -181,12 +181,21 @@ remove_connection(User, Server, Resource, _Status)-> %% Direction = received | sent send_copies(JID, To, Packet, Direction)-> {U, S, R} = jlib:jid_tolower(JID), + PrioRes = ejabberd_sm:get_user_present_resources(U, S), + IsBareTo = case {Direction, To} of + {received, #jid{lresource = <<>>}} -> true; + {received, #jid{lresource = LRes}} -> + %% unavailable resources are handled like bare JIDs + case lists:keyfind(LRes, 2, PrioRes) of + false -> true; + _ -> false + end; + _ -> false + end, %% list of JIDs that should receive a carbon copy of this message (excluding the %% receiver(s) of the original message - TargetJIDs = case {Direction, To} of - {received, #jid{resource = <<>>}} -> - PrioRes = ejabberd_sm:get_user_present_resources(U, S), + TargetJIDs = if IsBareTo -> MaxPrio = case catch lists:max(PrioRes) of {Prio, _Res} -> Prio; _ -> 0 @@ -194,7 +203,7 @@ send_copies(JID, To, Packet, Direction)-> OrigTo = fun(Res) -> lists:member({MaxPrio, Res}, PrioRes) end, [ {jlib:make_jid({U, S, CCRes}), CC_Version} || {CCRes, CC_Version} <- list(U, S), not OrigTo(CCRes) ]; - _ -> + true -> [ {jlib:make_jid({U, S, CCRes}), CC_Version} || {CCRes, CC_Version} <- list(U, S), CCRes /= R ] %TargetJIDs = lists:delete(JID, [ jlib:make_jid({U, S, CCRes}) || CCRes <- list(U, S) ]), -- cgit v1.2.3 From a21edc2f3a0f25dec8238732f23902e118d79913 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 9 Apr 2014 13:12:20 +0400 Subject: Pretty print accepted transport address --- src/ejabberd_listener.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index b0d261ccb..54563d73d 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -285,9 +285,10 @@ accept(ListenSocket, Module, Opts) -> case gen_tcp:accept(ListenSocket) of {ok, Socket} -> case {inet:sockname(Socket), inet:peername(Socket)} of - {{ok, Addr}, {ok, PAddr}} -> - ?INFO_MSG("(~w) Accepted connection ~w -> ~w", - [Socket, PAddr, Addr]); + {{ok, {Addr, Port}}, {ok, {PAddr, PPort}}} -> + ?INFO_MSG("(~w) Accepted connection ~s:~p -> ~s:~p", + [Socket, inet_parse:ntoa(PAddr), PPort, + inet_parse:ntoa(Addr), Port]); _ -> ok end, -- cgit v1.2.3 From d97b4fd9ca36858a12bc5e6841334cde4c8f0431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Tue, 15 Apr 2014 16:16:12 +0200 Subject: Fix loading translation files on R17 --- src/translate.erl | 75 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/translate.erl b/src/translate.erl index 10199f648..758784f18 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -76,33 +76,54 @@ load_dir(Dir) -> end. load_file(Lang, File) -> - case file:consult(File) of - {ok, Terms} -> - lists:foreach(fun ({Orig, Trans}) -> - Trans1 = case Trans of - <<"">> -> Orig; - _ -> Trans - end, - ets:insert(translations, - {{Lang, iolist_to_binary(Orig)}, - iolist_to_binary(Trans1)}) - end, - Terms); - %% Code copied from ejabberd_config.erl - {error, - {_LineNumber, erl_parse, _ParseMessage} = Reason} -> - ExitText = iolist_to_binary([File, - " approximately in the line ", - file:format_error(Reason)]), - ?ERROR_MSG("Problem loading translation file ~n~s", - [ExitText]), - exit(ExitText); - {error, Reason} -> - ExitText = iolist_to_binary([File, ": ", - file:format_error(Reason)]), - ?ERROR_MSG("Problem loading translation file ~n~s", - [ExitText]), - exit(ExitText) + case file:open(File, [read]) of + {ok, Fd} -> + epp:set_encoding(Fd, latin1), + load_file_loop(Fd, 1, File, Lang), + file:close(Fd); + Error -> + ExitText = iolist_to_binary([File, ": ", + file:format_error(Error)]), + ?ERROR_MSG("Problem loading translation file ~n~s", + [ExitText]), + exit(ExitText) + end. + +load_file_loop(Fd, Line, File, Lang) -> + case io:read(Fd, '', Line) of + {ok,{Orig, Trans}, NextLine} -> + Trans1 = case Trans of + <<"">> -> Orig; + _ -> Trans + end, + ets:insert(translations, + {{Lang, iolist_to_binary(Orig)}, + iolist_to_binary(Trans1)}), + + load_file_loop(Fd, NextLine, File, Lang); + {ok,_, _NextLine} -> + ExitText = iolist_to_binary([File, + " approximately in the line ", + Line]), + ?ERROR_MSG("Problem loading translation file ~n~s", + [ExitText]), + exit(ExitText); + {error, + {_LineNumber, erl_parse, _ParseMessage} = Reason} -> + ExitText = iolist_to_binary([File, + " approximately in the line ", + file:format_error(Reason)]), + ?ERROR_MSG("Problem loading translation file ~n~s", + [ExitText]), + exit(ExitText); + {error, Reason} -> + ExitText = iolist_to_binary([File, ": ", + file:format_error(Reason)]), + ?ERROR_MSG("Problem loading translation file ~n~s", + [ExitText]), + exit(ExitText); + {eof,_Line} -> + ok end. -spec translate(binary(), binary()) -> binary(). -- cgit v1.2.3 From 7af7b7d3f0c4bf399fb7db54c38090c8d1a25873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Tue, 15 Apr 2014 16:58:06 +0200 Subject: Fix compilation on pre-R17 --- src/translate.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/translate.erl b/src/translate.erl index 758784f18..846b33e06 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -78,7 +78,7 @@ load_dir(Dir) -> load_file(Lang, File) -> case file:open(File, [read]) of {ok, Fd} -> - epp:set_encoding(Fd, latin1), + io:setopts(Fd, [{encoding,latin1}]), load_file_loop(Fd, 1, File, Lang), file:close(Fd); Error -> -- cgit v1.2.3 From d350cc63619123744ee92e8cce709457b78e64f6 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Wed, 16 Apr 2014 14:15:14 +0200 Subject: Accept "extauth_cache: false" Don't log a "configuration problem" message if "extauth_cache: false" is explicitly specified, as that's a valid configuration setting as per the documentation. --- src/ejabberd_auth_external.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl index ecd8552b1..9ae6c9081 100644 --- a/src/ejabberd_auth_external.erl +++ b/src/ejabberd_auth_external.erl @@ -172,7 +172,9 @@ remove_user(User, Server, Password) -> get_cache_option(Host) -> case ejabberd_config:get_option( {extauth_cache, Host}, - fun(I) when is_integer(I), I > 0 -> I end) of + fun(false) -> undefined; + (I) when is_integer(I), I > 0 -> I + end) of undefined -> false; CacheTime -> {true, CacheTime} end. -- cgit v1.2.3 From 4bc8b6bc9f18e01d96944fe17f09ea702059c1c7 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 22 Apr 2014 22:12:04 +0200 Subject: Fix extraction of host names from certificates --- src/ejabberd_s2s_in.erl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index bd2f13a8a..6afd8d1f2 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -749,7 +749,7 @@ get_cert_domains(Cert) -> case 'OTP-PUB-KEY':decode('X520CommonName', Val) of {ok, {_, D1}} -> D = if is_binary(D1) -> D1; - is_binary(D1) -> (D1); + is_list(D1) -> list_to_binary(D1); true -> error end, if D /= error -> @@ -770,8 +770,7 @@ get_cert_domains(Cert) -> lists:flatmap(fun (#'Extension'{extnID = ?'id-ce-subjectAltName', extnValue = Val}) -> - BVal = if is_binary(Val) -> iolist_to_binary(Val); - is_binary(Val) -> Val; + BVal = if is_list(Val) -> list_to_binary(Val); true -> Val end, case 'OTP-PUB-KEY':decode('SubjectAltName', BVal) @@ -811,9 +810,9 @@ get_cert_domains(Cert) -> _ -> [] end; ({dNSName, D}) - when is_binary(D) -> + when is_list(D) -> case - jlib:string_to_jid(D) + jlib:string_to_jid(list_to_binary(D)) of #jid{luser = <<"">>, lserver = LD, -- cgit v1.2.3 From 86e17c379c22b79120d7c15e8b3366637a08dc84 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Wed, 23 Apr 2014 11:45:17 +0200 Subject: Verify host name before offering SASL EXTERNAL Prior to this commit, ejabberd handled certificate authentication for incoming s2s connections like this: 1. Verify the certificate without checking the host name. On failure, behave according to 's2s_use_starttls'. On success: 2. Offer SASL EXTERNAL. 3. If the remote server chooses SASL EXTERNAL, compare the authorization identity against the certificate host name(s). On failure, abort the connection unconditionally. ejabberd now does this instead: 1. Verify the certificate and compare the certificate host name(s) against the 'from' attribute of the stream header. On failure, behave according to 's2s_use_starttls'. On success: 2. Offer SASL EXTERNAL. 3. If the remote server chooses SASL EXTERNAL, ignore the authorization identity (if any) and consider the peer authenticated. The old behavior was suggested by previous versions of XEP-0178, the new behavior is suggested by the current version 1.1. --- src/ejabberd_s2s_in.erl | 140 +++++++++++++++++++++++++----------------------- 1 file changed, 74 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 6afd8d1f2..3eb0b71cc 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -224,34 +224,55 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, not StateData#state.authenticated -> send_text(StateData, ?STREAM_HEADER(<<" version='1.0'">>)), - SASL = if StateData#state.tls_enabled -> - case - (StateData#state.sockmod):get_peer_certificate(StateData#state.socket) - of - {ok, Cert} -> + Auth = if StateData#state.tls_enabled -> + case jlib:nameprep(xml:get_attr_s(<<"from">>, Attrs)) of + From when From /= <<"">>, From /= error -> case - (StateData#state.sockmod):get_verify_result(StateData#state.socket) + (StateData#state.sockmod):get_peer_certificate(StateData#state.socket) of - 0 -> - [#xmlel{name = <<"mechanisms">>, - attrs = [{<<"xmlns">>, ?NS_SASL}], - children = - [#xmlel{name = <<"mechanism">>, - attrs = [], - children = - [{xmlcdata, - <<"EXTERNAL">>}]}]}]; - CertVerifyRes -> - case StateData#state.tls_certverify of - true -> - {error_cert_verif, CertVerifyRes, - Cert}; - false -> [] - end + {ok, Cert} -> + case + (StateData#state.sockmod):get_verify_result(StateData#state.socket) + of + 0 -> + case + idna:domain_utf8_to_ascii(From) + of + false -> + {error, From, + <<"Cannot decode 'from' attribute">>}; + PCAuthDomain -> + case + lists:any(fun (D) -> + match_domain(PCAuthDomain, + D) + end, + get_cert_domains(Cert)) + of + true -> + {ok, From, + <<"Success">>}; + false -> + {error, From, + <<"Certificate host name mismatch">>} + end + end; + CertVerifyRes -> + {error, From, + p1_tls:get_cert_verify_string(CertVerifyRes, + Cert)} + end; + error -> + {error, From, + <<"Cannot get peer certificate">>} end; - error -> [] + _ -> + {error, <<"(unknown)">>, + <<"Got no valid 'from' attribute">>} end; - true -> [] + true -> + {no_verify, <<"(unknown)">>, + <<"TLS not (yet) enabled">>} end, StartTLS = if StateData#state.tls_enabled -> []; not StateData#state.tls_enabled and @@ -267,11 +288,9 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, [#xmlel{name = <<"required">>, attrs = [], children = []}]}] end, - case SASL of - {error_cert_verif, CertVerifyResult, Certificate} -> - CertError = p1_tls:get_cert_verify_string(CertVerifyResult, - Certificate), - RemoteServer = xml:get_attr_s(<<"from">>, Attrs), + case Auth of + {error, RemoteServer, CertError} + when StateData#state.tls_certverify -> ?INFO_MSG("Closing s2s connection: ~s <--> ~s (~s)", [StateData#state.server, RemoteServer, CertError]), send_text(StateData, @@ -285,8 +304,26 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, <<"">>)), ejabberd_s2s_out:stop_connection(Pid), {stop, normal, StateData}; - _ -> - send_element(StateData, + {VerifyResult, RemoteServer, Msg} -> + {SASL, NewStateData} = case VerifyResult of + ok -> + {[#xmlel{name = <<"mechanisms">>, + attrs = [{<<"xmlns">>, ?NS_SASL}], + children = + [#xmlel{name = <<"mechanism">>, + attrs = [], + children = + [{xmlcdata, + <<"EXTERNAL">>}]}]}], + StateData#state{auth_domain = RemoteServer}}; + error -> + ?DEBUG("Won't accept certificate of ~s: ~s", + [RemoteServer, Msg]), + {[], StateData}; + no_verify -> + {[], StateData} + end, + send_element(NewStateData, #xmlel{name = <<"stream:features">>, attrs = [], children = SASL ++ @@ -295,7 +332,7 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, Server, [], [Server])}), {next_state, wait_for_feature_request, - StateData#state{server = Server}} + NewStateData#state{server = Server}} end; {<<"jabber:server">>, _, Server, true} when StateData#state.authenticated -> @@ -330,7 +367,7 @@ wait_for_stream(closed, StateData) -> wait_for_feature_request({xmlstreamelement, El}, StateData) -> - #xmlel{name = Name, attrs = Attrs, children = Els} = El, + #xmlel{name = Name, attrs = Attrs} = El, TLS = StateData#state.tls, TLSEnabled = StateData#state.tls_enabled, SockMod = @@ -376,39 +413,11 @@ wait_for_feature_request({xmlstreamelement, El}, {?NS_SASL, <<"auth">>} when TLSEnabled -> Mech = xml:get_attr_s(<<"mechanism">>, Attrs), case Mech of - <<"EXTERNAL">> -> - Auth = jlib:decode_base64(xml:get_cdata(Els)), - AuthDomain = jlib:nameprep(Auth), - AuthRes = case - (StateData#state.sockmod):get_peer_certificate(StateData#state.socket) - of - {ok, Cert} -> - case - (StateData#state.sockmod):get_verify_result(StateData#state.socket) - of - 0 -> - case AuthDomain of - error -> false; - _ -> - case - idna:domain_utf8_to_ascii(AuthDomain) - of - false -> false; - PCAuthDomain -> - lists:any(fun (D) -> - match_domain(PCAuthDomain, - D) - end, - get_cert_domains(Cert)) - end - end; - _ -> false - end; - error -> false - end, + <<"EXTERNAL">> when StateData#state.auth_domain /= <<"">> -> + AuthDomain = StateData#state.auth_domain, AllowRemoteHost = ejabberd_s2s:allow_host(<<"">>, AuthDomain), - if AuthRes andalso AllowRemoteHost -> + if AllowRemoteHost -> (StateData#state.sockmod):reset_stream(StateData#state.socket), send_element(StateData, #xmlel{name = <<"success">>, @@ -420,8 +429,7 @@ wait_for_feature_request({xmlstreamelement, El}, jlib:make_jid(<<"">>, AuthDomain, <<"">>)), {next_state, wait_for_stream, StateData#state{streamid = new_id(), - authenticated = true, - auth_domain = AuthDomain}}; + authenticated = true}}; true -> send_element(StateData, #xmlel{name = <<"failure">>, -- cgit v1.2.3 From 9ec014c18448f28a3ab0e171ecf832e5b0729e5c Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Wed, 23 Apr 2014 23:35:34 +0900 Subject: added error handling in mod_pubsub_odbc. --- src/mod_pubsub_odbc.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 3d26ad0fa..00e619213 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -885,10 +885,10 @@ unsubscribe_user(Entity, Owner) -> Host = host(element(2, BJID)), spawn(fun () -> lists:foreach(fun (PType) -> - {result, Subscriptions} = - node_action(Host, PType, + case node_action(Host, PType, get_entity_subscriptions, - [Host, Entity]), + [Host, Entity]) of + {result, Subscriptions} -> lists:foreach(fun ({#pubsub_node{options = Options, @@ -922,7 +922,10 @@ unsubscribe_user(Entity, Owner) -> end; (_) -> ok end, - Subscriptions) + Subscriptions); + Error -> + ?DEBUG("Error at node_action: ~p", [Error]) + end end, plugins(Host)) end). -- cgit v1.2.3 From f988aad94073592ffe7461b3fa1f413a1ccd308d Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Wed, 23 Apr 2014 23:28:13 +0200 Subject: Log TLS status for outgoing s2s with SASL EXTERNAL --- src/ejabberd_s2s_out.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index a0a83631d..58aa34d66 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -570,8 +570,10 @@ wait_for_features({xmlstreamelement, El}, StateData) -> if not SASLEXT and not StartTLS and StateData#state.authenticated -> send_queue(StateData, StateData#state.queue), - ?INFO_MSG("Connection established: ~s -> ~s", - [StateData#state.myname, StateData#state.server]), + ?INFO_MSG("Connection established: ~s -> ~s with " + "SASL EXTERNAL and TLS=~p", + [StateData#state.myname, StateData#state.server, + StateData#state.tls_enabled]), ejabberd_hooks:run(s2s_connect_hook, [StateData#state.myname, StateData#state.server]), -- cgit v1.2.3 From 219f9276d1a315a5c171725393359569d3fb5a8d Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Thu, 24 Apr 2014 12:42:22 +0900 Subject: undefined ejabberd_socket:get_conn_type/1 --- src/ejabberd_c2s.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 33d76b07c..2cdf205cc 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -550,8 +550,7 @@ wait_for_auth({xmlstreamelement, El}, StateData) -> [StateData#state.socket, jlib:jid_to_string(JID), AuthModule]), SID = {now(), self()}, - Conn = (StateData#state.sockmod):get_conn_type( - StateData#state.socket), + Conn = get_conn_type(StateData), Info = [{ip, StateData#state.ip}, {conn, Conn}, {auth_module, AuthModule}], Res = jlib:make_result_iq_reply( -- cgit v1.2.3 From ffe9f3c192c03e1f04b23a74d83704a67b2ee73f Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Thu, 24 Apr 2014 15:34:41 +0900 Subject: added get_random_pid/1 error handling --- src/ejabberd_odbc.erl | 9 ++++++--- src/ejabberd_odbc_sup.erl | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ejabberd_odbc.erl b/src/ejabberd_odbc.erl index 6a7d9de6d..802e32ae2 100644 --- a/src/ejabberd_odbc.erl +++ b/src/ejabberd_odbc.erl @@ -140,9 +140,12 @@ sql_bloc(Host, F) -> sql_call(Host, {sql_bloc, F}). sql_call(Host, Msg) -> case get(?STATE_KEY) of undefined -> - (?GEN_FSM):sync_send_event(ejabberd_odbc_sup:get_random_pid(Host), - {sql_cmd, Msg, now()}, - ?TRANSACTION_TIMEOUT); + case ejabberd_odbc_sup:get_random_pid(Host) of + none -> ?WARNING_MSG("SQL calling unknown host: ~p~n", [Host]); + Pid -> + (?GEN_FSM):sync_send_event(Pid,{sql_cmd, Msg, now()}, + ?TRANSACTION_TIMEOUT) + end; _State -> nested_op(Msg) end. diff --git a/src/ejabberd_odbc_sup.erl b/src/ejabberd_odbc_sup.erl index bfad5428e..d05fd139e 100644 --- a/src/ejabberd_odbc_sup.erl +++ b/src/ejabberd_odbc_sup.erl @@ -82,8 +82,10 @@ get_pids(Host) -> [R#sql_pool.pid || R <- Rs]. get_random_pid(Host) -> - Pids = get_pids(Host), - lists:nth(erlang:phash(now(), length(Pids)), Pids). + case get_pids(Host) of + [] -> none; + Pids -> lists:nth(erlang:phash(now(), length(Pids)), Pids) + end. add_pid(Host, Pid) -> F = fun () -> -- cgit v1.2.3 From d805d198acae4284a0f8512305c9180c2ac9dd08 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 24 Apr 2014 11:04:10 +0200 Subject: Check TLS state before requesting SASL EXTERNAL Make sure a remote server can't circumvent "s2s_use_starttls: required" by offering SASL EXTERNAL authentication over a non-TLS connection. --- src/ejabberd_s2s_out.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index a0a83631d..e404207cd 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -578,7 +578,9 @@ wait_for_features({xmlstreamelement, El}, StateData) -> {next_state, stream_established, StateData#state{queue = queue:new()}}; SASLEXT and StateData#state.try_auth and - (StateData#state.new /= false) -> + (StateData#state.new /= false) and + (StateData#state.tls_enabled or + not StateData#state.tls_required) -> send_element(StateData, #xmlel{name = <<"auth">>, attrs = -- cgit v1.2.3 From 71dba663305340c9164c78a34a84fa79909d1d8d Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Thu, 24 Apr 2014 18:15:39 +0900 Subject: fix checking acl in mod_register_web --- src/mod_register_web.erl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index 0da53b26d..e98478349 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -487,12 +487,13 @@ register_account(Username, Host, Password) -> Access = gen_mod:get_module_opt(Host, mod_register, access, fun(A) when is_atom(A) -> A end, all), - JID = jlib:make_jid(Username, Host, <<"">>), - Match = acl:match_rule(Host, Access, JID), - case {JID, Match} of - {error, _} -> {error, invalid_jid}; - {_, deny} -> {error, not_allowed}; - {_, allow} -> register_account2(Username, Host, Password) + case jlib:make_jid(Username, Host, <<"">>) of + error -> {error, invalid_jid}; + JID -> + case acl:match_rule(Host, Access, JID) of + deny -> {error, not_allowed}; + allow -> register_account2(Username, Host, Password) + end end. register_account2(Username, Host, Password) -> -- cgit v1.2.3 From eabca827652ebf2d9cc99d49a1eb3292a74fb5e5 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 27 Apr 2014 00:28:42 +0200 Subject: Send stream trailer before closing s2s connection When aborting an incoming s2s connection due to certificate verification errors, send a stream trailer before closing the socket. --- src/ejabberd_s2s_in.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 3eb0b71cc..aa55c2e63 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -294,8 +294,9 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, ?INFO_MSG("Closing s2s connection: ~s <--> ~s (~s)", [StateData#state.server, RemoteServer, CertError]), send_text(StateData, - xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>, - CertError))), + <<(xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>, + CertError)))/binary, + (?STREAM_TRAILER)/binary>>), {atomic, Pid} = ejabberd_s2s:find_connection(jlib:make_jid(<<"">>, Server, <<"">>), -- cgit v1.2.3 From 1aa4ed3f35d07b62a5ccc0568a55ec464eb7d478 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 28 Apr 2014 00:17:05 +0200 Subject: Don't mess with s2s out when aborting s2s in Don't try to look up and close outgoing connections to a given server when aborting incoming connections from that server due to certificate verification errors. The ejabberd_s2s:find_connection/2 call actually created one or more *new* connections if less than 'max_s2s_connections' connections were found. Then, no more than one of those possibly new connections were stopped by the ejabberd_s2s_out:stop_connection/1 call. It's not really necessary to bother with outgoing connections at all, here. --- src/ejabberd_s2s_in.erl | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src') diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index aa55c2e63..a3e772dfc 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -297,13 +297,6 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, <<(xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>, CertError)))/binary, (?STREAM_TRAILER)/binary>>), - {atomic, Pid} = - ejabberd_s2s:find_connection(jlib:make_jid(<<"">>, - Server, <<"">>), - jlib:make_jid(<<"">>, - RemoteServer, - <<"">>)), - ejabberd_s2s_out:stop_connection(Pid), {stop, normal, StateData}; {VerifyResult, RemoteServer, Msg} -> {SASL, NewStateData} = case VerifyResult of -- cgit v1.2.3 From 49bdbf2895b9d966d402f6548851751a8780e369 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 28 Apr 2014 01:42:02 +0200 Subject: Support certificate verification for outgoing s2s Handle "s2s_use_starttls: required_trusted" the same way for outgoing s2s connections as for incoming connections. That is, check the remote server's certificate (including the host name) and abort the connection if verification fails. --- src/ejabberd_s2s.erl | 154 ++++++++++++++++++++++++++++++++++++++++- src/ejabberd_s2s_in.erl | 173 ++--------------------------------------------- src/ejabberd_s2s_out.erl | 96 ++++++++++++++++---------- 3 files changed, 218 insertions(+), 205 deletions(-) (limited to 'src') diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index 057c60a98..eb9894350 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -37,7 +37,8 @@ incoming_s2s_number/0, outgoing_s2s_number/0, clean_temporarily_blocked_table/0, list_temporarily_blocked_hosts/0, - external_host_overloaded/1, is_temporarly_blocked/1]). + external_host_overloaded/1, is_temporarly_blocked/1, + check_peer_certificate/3]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, @@ -53,6 +54,14 @@ -include("ejabberd_commands.hrl"). +-include_lib("public_key/include/public_key.hrl"). + +-define(PKIXEXPLICIT, 'OTP-PUB-KEY'). + +-define(PKIXIMPLICIT, 'OTP-PUB-KEY'). + +-include("XmppAddr.hrl"). + -define(DEFAULT_MAX_S2S_CONNECTIONS_NUMBER, 1). -define(DEFAULT_MAX_S2S_CONNECTIONS_NUMBER_PER_NODE, 1). @@ -207,6 +216,31 @@ try_register(FromTo) -> dirty_get_connections() -> mnesia:dirty_all_keys(s2s). +check_peer_certificate(SockMod, Sock, Peer) -> + case SockMod:get_peer_certificate(Sock) of + {ok, Cert} -> + case SockMod:get_verify_result(Sock) of + 0 -> + case idna:domain_utf8_to_ascii(Peer) of + false -> + {error, <<"Cannot decode remote server name">>}; + AsciiPeer -> + case + lists:any(fun(D) -> match_domain(AsciiPeer, D) end, + get_cert_domains(Cert)) of + true -> + {ok, <<"Verification successful">>}; + false -> + {error, <<"Certificate host name mismatch">>} + end + end; + VerifyRes -> + {error, p1_tls:get_cert_verify_string(VerifyRes, Cert)} + end; + error -> + {error, <<"Cannot get peer certificate">>} + end. + %%==================================================================== %% gen_server callbacks %%==================================================================== @@ -619,3 +653,121 @@ get_s2s_state(S2sPid) -> {badrpc, _} -> [{status, error}] end, [{s2s_pid, S2sPid} | Infos]. + +get_cert_domains(Cert) -> + {rdnSequence, Subject} = + (Cert#'Certificate'.tbsCertificate)#'TBSCertificate'.subject, + Extensions = + (Cert#'Certificate'.tbsCertificate)#'TBSCertificate'.extensions, + lists:flatmap(fun (#'AttributeTypeAndValue'{type = + ?'id-at-commonName', + value = Val}) -> + case 'OTP-PUB-KEY':decode('X520CommonName', Val) of + {ok, {_, D1}} -> + D = if is_binary(D1) -> D1; + is_list(D1) -> list_to_binary(D1); + true -> error + end, + if D /= error -> + case jlib:string_to_jid(D) of + #jid{luser = <<"">>, lserver = LD, + lresource = <<"">>} -> + [LD]; + _ -> [] + end; + true -> [] + end; + _ -> [] + end; + (_) -> [] + end, + lists:flatten(Subject)) + ++ + lists:flatmap(fun (#'Extension'{extnID = + ?'id-ce-subjectAltName', + extnValue = Val}) -> + BVal = if is_list(Val) -> list_to_binary(Val); + true -> Val + end, + case 'OTP-PUB-KEY':decode('SubjectAltName', BVal) + of + {ok, SANs} -> + lists:flatmap(fun ({otherName, + #'AnotherName'{'type-id' = + ?'id-on-xmppAddr', + value = + XmppAddr}}) -> + case + 'XmppAddr':decode('XmppAddr', + XmppAddr) + of + {ok, D} + when + is_binary(D) -> + case + jlib:string_to_jid((D)) + of + #jid{luser = + <<"">>, + lserver = + LD, + lresource = + <<"">>} -> + case + idna:domain_utf8_to_ascii(LD) + of + false -> + []; + PCLD -> + [PCLD] + end; + _ -> [] + end; + _ -> [] + end; + ({dNSName, D}) + when is_list(D) -> + case + jlib:string_to_jid(list_to_binary(D)) + of + #jid{luser = <<"">>, + lserver = LD, + lresource = + <<"">>} -> + [LD]; + _ -> [] + end; + (_) -> [] + end, + SANs); + _ -> [] + end; + (_) -> [] + end, + Extensions). + +match_domain(Domain, Domain) -> true; +match_domain(Domain, Pattern) -> + DLabels = str:tokens(Domain, <<".">>), + PLabels = str:tokens(Pattern, <<".">>), + match_labels(DLabels, PLabels). + +match_labels([], []) -> true; +match_labels([], [_ | _]) -> false; +match_labels([_ | _], []) -> false; +match_labels([DL | DLabels], [PL | PLabels]) -> + case lists:all(fun (C) -> + $a =< C andalso C =< $z orelse + $0 =< C andalso C =< $9 orelse + C == $- orelse C == $* + end, + binary_to_list(PL)) + of + true -> + Regexp = ejabberd_regexp:sh_to_awk(PL), + case ejabberd_regexp:run(DL, Regexp) of + match -> match_labels(DLabels, PLabels); + nomatch -> false + end; + false -> false + end. diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 3eb0b71cc..c490704d8 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -30,8 +30,7 @@ -behaviour(p1_fsm). %% External exports --export([start/2, start_link/2, match_domain/2, - socket_type/0]). +-export([start/2, start_link/2, socket_type/0]). %% gen_fsm callbacks -export([init/1, wait_for_stream/2, @@ -44,14 +43,6 @@ -include("jlib.hrl"). --include_lib("public_key/include/public_key.hrl"). - --define(PKIXEXPLICIT, 'OTP-PUB-KEY'). - --define(PKIXIMPLICIT, 'OTP-PUB-KEY'). - --include("XmppAddr.hrl"). - -define(DICT, dict). -record(state, @@ -227,45 +218,11 @@ wait_for_stream({xmlstreamstart, _Name, Attrs}, Auth = if StateData#state.tls_enabled -> case jlib:nameprep(xml:get_attr_s(<<"from">>, Attrs)) of From when From /= <<"">>, From /= error -> - case - (StateData#state.sockmod):get_peer_certificate(StateData#state.socket) - of - {ok, Cert} -> - case - (StateData#state.sockmod):get_verify_result(StateData#state.socket) - of - 0 -> - case - idna:domain_utf8_to_ascii(From) - of - false -> - {error, From, - <<"Cannot decode 'from' attribute">>}; - PCAuthDomain -> - case - lists:any(fun (D) -> - match_domain(PCAuthDomain, - D) - end, - get_cert_domains(Cert)) - of - true -> - {ok, From, - <<"Success">>}; - false -> - {error, From, - <<"Certificate host name mismatch">>} - end - end; - CertVerifyRes -> - {error, From, - p1_tls:get_cert_verify_string(CertVerifyRes, - Cert)} - end; - error -> - {error, From, - <<"Cannot get peer certificate">>} - end; + {Result, Message} = + ejabberd_s2s:check_peer_certificate(StateData#state.sockmod, + StateData#state.socket, + From), + {Result, From, Message}; _ -> {error, <<"(unknown)">>, <<"Got no valid 'from' attribute">>} @@ -746,124 +703,6 @@ is_key_packet(#xmlel{name = Name, attrs = Attrs, xml:get_attr_s(<<"id">>, Attrs), xml:get_cdata(Els)}; is_key_packet(_) -> false. -get_cert_domains(Cert) -> - {rdnSequence, Subject} = - (Cert#'Certificate'.tbsCertificate)#'TBSCertificate'.subject, - Extensions = - (Cert#'Certificate'.tbsCertificate)#'TBSCertificate'.extensions, - lists:flatmap(fun (#'AttributeTypeAndValue'{type = - ?'id-at-commonName', - value = Val}) -> - case 'OTP-PUB-KEY':decode('X520CommonName', Val) of - {ok, {_, D1}} -> - D = if is_binary(D1) -> D1; - is_list(D1) -> list_to_binary(D1); - true -> error - end, - if D /= error -> - case jlib:string_to_jid(D) of - #jid{luser = <<"">>, lserver = LD, - lresource = <<"">>} -> - [LD]; - _ -> [] - end; - true -> [] - end; - _ -> [] - end; - (_) -> [] - end, - lists:flatten(Subject)) - ++ - lists:flatmap(fun (#'Extension'{extnID = - ?'id-ce-subjectAltName', - extnValue = Val}) -> - BVal = if is_list(Val) -> list_to_binary(Val); - true -> Val - end, - case 'OTP-PUB-KEY':decode('SubjectAltName', BVal) - of - {ok, SANs} -> - lists:flatmap(fun ({otherName, - #'AnotherName'{'type-id' = - ?'id-on-xmppAddr', - value = - XmppAddr}}) -> - case - 'XmppAddr':decode('XmppAddr', - XmppAddr) - of - {ok, D} - when - is_binary(D) -> - case - jlib:string_to_jid((D)) - of - #jid{luser = - <<"">>, - lserver = - LD, - lresource = - <<"">>} -> - case - idna:domain_utf8_to_ascii(LD) - of - false -> - []; - PCLD -> - [PCLD] - end; - _ -> [] - end; - _ -> [] - end; - ({dNSName, D}) - when is_list(D) -> - case - jlib:string_to_jid(list_to_binary(D)) - of - #jid{luser = <<"">>, - lserver = LD, - lresource = - <<"">>} -> - [LD]; - _ -> [] - end; - (_) -> [] - end, - SANs); - _ -> [] - end; - (_) -> [] - end, - Extensions). - -match_domain(Domain, Domain) -> true; -match_domain(Domain, Pattern) -> - DLabels = str:tokens(Domain, <<".">>), - PLabels = str:tokens(Pattern, <<".">>), - match_labels(DLabels, PLabels). - -match_labels([], []) -> true; -match_labels([], [_ | _]) -> false; -match_labels([_ | _], []) -> false; -match_labels([DL | DLabels], [PL | PLabels]) -> - case lists:all(fun (C) -> - $a =< C andalso C =< $z orelse - $0 =< C andalso C =< $9 orelse - C == $- orelse C == $* - end, - binary_to_list(PL)) - of - true -> - Regexp = ejabberd_regexp:sh_to_awk(PL), - case ejabberd_regexp:run(DL, Regexp) of - match -> match_labels(DLabels, PLabels); - nomatch -> false - end; - false -> false - end. - fsm_limit_opts(Opts) -> case lists:keysearch(max_fsm_queue, 1, Opts) of {value, {_, N}} when is_integer(N) -> [{max_queue, N}]; diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index a0a83631d..9977fcd7e 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -69,6 +69,7 @@ use_v10 = true :: boolean(), tls = false :: boolean(), tls_required = false :: boolean(), + tls_certverify = false :: boolean(), tls_enabled = false :: boolean(), tls_options = [connect] :: list(), authenticated = false :: boolean(), @@ -160,28 +161,27 @@ stop_connection(Pid) -> p1_fsm:send_event(Pid, closed). init([From, Server, Type]) -> process_flag(trap_exit, true), ?DEBUG("started: ~p", [{From, Server, Type}]), - {TLS, TLSRequired} = case - ejabberd_config:get_option( - s2s_use_starttls, - fun(true) -> true; - (false) -> false; - (optional) -> optional; - (required) -> required; - (required_trusted) -> required_trusted - end) - of - UseTls - when (UseTls == undefined) or - (UseTls == false) -> - {false, false}; - UseTls - when (UseTls == true) or (UseTls == optional) -> - {true, false}; - UseTls - when (UseTls == required) or - (UseTls == required_trusted) -> - {true, true} - end, + {TLS, TLSRequired, TLSCertverify} = + case ejabberd_config:get_option( + s2s_use_starttls, + fun(true) -> true; + (false) -> false; + (optional) -> optional; + (required) -> required; + (required_trusted) -> required_trusted + end) + of + UseTls + when (UseTls == undefined) or (UseTls == false) -> + {false, false, false}; + UseTls + when (UseTls == true) or (UseTls == optional) -> + {true, false, false}; + required -> + {true, true, false}; + required_trusted -> + {true, true, true} + end, UseV10 = TLS, TLSOpts1 = case ejabberd_config:get_option( @@ -223,9 +223,9 @@ init([From, Server, Type]) -> Timer = erlang:start_timer(?S2STIMEOUT, self(), []), {ok, open_socket, #state{use_v10 = UseV10, tls = TLS, - tls_required = TLSRequired, tls_options = TLSOpts, - queue = queue:new(), myname = From, server = Server, - new = New, verify = Verify, timer = Timer}}. + tls_required = TLSRequired, tls_certverify = TLSCertverify, + tls_options = TLSOpts, queue = queue:new(), myname = From, + server = Server, new = New, verify = Verify, timer = Timer}}. %%---------------------------------------------------------------------- %% Func: StateName/2 @@ -345,35 +345,57 @@ open_socket2(Type, Addr, Port) -> wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) -> + {CertCheckRes, CertCheckMsg, NewStateData} = + if StateData#state.tls_certverify, StateData#state.tls_enabled -> + {Res, Msg} = + ejabberd_s2s:check_peer_certificate(ejabberd_socket, + StateData#state.socket, + StateData#state.server), + ?DEBUG("Certificate verification result for ~s: ~s", + [StateData#state.server, Msg]), + {Res, Msg, StateData#state{tls_certverify = false}}; + true -> + {no_verify, <<"Not verified">>, StateData} + end, case {xml:get_attr_s(<<"xmlns">>, Attrs), xml:get_attr_s(<<"xmlns:db">>, Attrs), xml:get_attr_s(<<"version">>, Attrs) == <<"1.0">>} of + _ when CertCheckRes == error -> + send_text(NewStateData, + <<(xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>, + CertCheckMsg)))/binary, + (?STREAM_TRAILER)/binary>>), + ?INFO_MSG("Closing s2s connection: ~s -> ~s (~s)", + [NewStateData#state.myname, + NewStateData#state.server, + CertCheckMsg]), + {stop, normal, NewStateData}; {<<"jabber:server">>, <<"jabber:server:dialback">>, false} -> - send_db_request(StateData); + send_db_request(NewStateData); {<<"jabber:server">>, <<"jabber:server:dialback">>, true} - when StateData#state.use_v10 -> - {next_state, wait_for_features, StateData, ?FSMTIMEOUT}; + when NewStateData#state.use_v10 -> + {next_state, wait_for_features, NewStateData, ?FSMTIMEOUT}; %% Clause added to handle Tigase's workaround for an old ejabberd bug: {<<"jabber:server">>, <<"jabber:server:dialback">>, true} - when not StateData#state.use_v10 -> - send_db_request(StateData); + when not NewStateData#state.use_v10 -> + send_db_request(NewStateData); {<<"jabber:server">>, <<"">>, true} - when StateData#state.use_v10 -> + when NewStateData#state.use_v10 -> {next_state, wait_for_features, - StateData#state{db_enabled = false}, ?FSMTIMEOUT}; + NewStateData#state{db_enabled = false}, ?FSMTIMEOUT}; {NSProvided, DB, _} -> - send_text(StateData, ?INVALID_NAMESPACE_ERR), + send_text(NewStateData, ?INVALID_NAMESPACE_ERR), ?INFO_MSG("Closing s2s connection: ~s -> ~s (invalid " "namespace).~nNamespace provided: ~p~nNamespac" "e expected: \"jabber:server\"~nxmlns:db " "provided: ~p~nAll attributes: ~p", - [StateData#state.myname, StateData#state.server, + [NewStateData#state.myname, NewStateData#state.server, NSProvided, DB, Attrs]), - {stop, normal, StateData} + {stop, normal, NewStateData} end; wait_for_stream({xmlstreamerror, _}, StateData) -> send_text(StateData, @@ -736,8 +758,8 @@ wait_for_starttls_proceed({xmlstreamelement, El}, tls_options = TLSOpts}, send_text(NewStateData, io_lib:format(?STREAM_HEADER, - [StateData#state.myname, - StateData#state.server, + [NewStateData#state.myname, + NewStateData#state.server, <<" version='1.0'">>])), {next_state, wait_for_stream, NewStateData, ?FSMTIMEOUT}; -- cgit v1.2.3 From 6d1055abecf64d184bc0c1253e8672d66749650d Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 29 Apr 2014 00:50:43 +0200 Subject: New ejabberd command: disconnect_user/2 --- src/ejabberd_sm.erl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index b1673d4b9..060643af0 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -52,6 +52,7 @@ connected_users/0, connected_users_number/0, user_resources/2, + disconnect_user/2, get_session_pid/3, get_user_info/3, get_user_ip/3, @@ -801,7 +802,13 @@ commands() -> desc = "List user's connected resources", module = ?MODULE, function = user_resources, args = [{user, binary}, {host, binary}], - result = {resources, {list, {resource, string}}}}]. + result = {resources, {list, {resource, string}}}}, + #ejabberd_commands{name = disconnect_user, + tags = [session], + desc = "Disconnect user's active sessions", + module = ?MODULE, function = disconnect_user, + args = [{user, binary}, {host, binary}], + result = {num_resources, integer}}]. -spec connected_users() -> [binary()]. @@ -818,6 +825,15 @@ user_resources(User, Server) -> Resources = get_user_resources(User, Server), lists:sort(Resources). +disconnect_user(User, Server) -> + Xmlelement = ?SERRT_POLICY_VIOLATION(<<"en">>, <<"has been kicked">>), + Resources = get_user_resources(User, Server), + lists:foreach( + fun(Resource) -> + PID = get_session_pid(User, Server, Resource), + PID ! {kick, kicked_by_admin, Xmlelement} + end, Resources), + length(Resources). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Update Mnesia tables -- cgit v1.2.3 From d09c268b2097e5b8177a642c07b020a155ceb125 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 29 Apr 2014 01:11:08 +0200 Subject: Let ejabberdctl accept binary string arguments Don't print the following message if an ejabberd command expects binary string arguments: "This command cannot be executed using ejabberdctl. Try ejabberd_xmlrpc." --- src/ejabberd_ctl.erl | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index d8d067640..eda1c4970 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -418,6 +418,7 @@ is_supported_args(Args) -> fun({_Name, Format}) -> (Format == integer) or (Format == string) + or (Format == binary) end, Args). -- cgit v1.2.3 From bb2c8b59f805063e167c0ece406963a416bc50f9 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 29 Apr 2014 11:41:24 +0200 Subject: Avoid #state.lang type errors in corner cases If #state.lang is used before being initialized to some binary string, the translation code would crash. --- src/ejabberd_c2s.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 33d76b07c..5d8a7bb07 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -107,7 +107,7 @@ auth_module = unknown, ip, aux_fields = [], - lang}). + lang = <<"">>}). %-define(DBGFSM, true). -- cgit v1.2.3 From ebbceab93fb3f3ceb35c6e01b2e93d1d7aa6ecf4 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 29 Apr 2014 11:56:28 +0200 Subject: Translate disconnect_user/2 string sent to client --- src/ejabberd_c2s.erl | 4 ++++ src/ejabberd_sm.erl | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 5d8a7bb07..87b32c43c 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -1229,6 +1229,10 @@ handle_info(replaced, StateName, StateData) -> Lang = StateData#state.lang, Xmlelement = ?SERRT_CONFLICT(Lang, <<"Replaced by new connection">>), handle_info({kick, replaced, Xmlelement}, StateName, StateData); +handle_info(disconnect, StateName, StateData) -> + Lang = StateData#state.lang, + Xmlelement = ?SERRT_POLICY_VIOLATION(Lang, <<"has been kicked">>), + handle_info({kick, kicked_by_admin, Xmlelement}, StateName, StateData); handle_info({kick, Reason, Xmlelement}, _StateName, StateData) -> send_element(StateData, Xmlelement), send_trailer(StateData), diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 060643af0..58debf0c1 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -826,12 +826,11 @@ user_resources(User, Server) -> lists:sort(Resources). disconnect_user(User, Server) -> - Xmlelement = ?SERRT_POLICY_VIOLATION(<<"en">>, <<"has been kicked">>), Resources = get_user_resources(User, Server), lists:foreach( fun(Resource) -> PID = get_session_pid(User, Server, Resource), - PID ! {kick, kicked_by_admin, Xmlelement} + PID ! disconnect end, Resources), length(Resources). -- cgit v1.2.3 From 0e0bd3329d74f27614a8763c0aadf5c26b5a1b7f Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Wed, 30 Apr 2014 13:39:17 +0900 Subject: mod_register_web should response 404 instead of process crash. --- src/mod_register_web.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mod_register_web.erl b/src/mod_register_web.erl index e98478349..ee3ff0069 100644 --- a/src/mod_register_web.erl +++ b/src/mod_register_web.erl @@ -140,7 +140,10 @@ process([<<"change_password">>], list_to_binary([?T(<<"There was an error changing the password: ">>), ?T(get_error_text(Error))]), {404, [], ErrorText} - end. + end; + +process(Path, _Request) -> + {404, [], "Not Found"}. %%%---------------------------------------------------------------------- %%% CSS -- cgit v1.2.3 From a6408e92818a52f92c47a70ffd4eecb127ebc7cc Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Wed, 30 Apr 2014 15:32:07 +0900 Subject: fix error handling when sql calling with unknown host. --- src/ejabberd_auth_odbc.erl | 1 + src/ejabberd_odbc.erl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_auth_odbc.erl b/src/ejabberd_auth_odbc.erl index 57cef930a..27e89aa2b 100644 --- a/src/ejabberd_auth_odbc.erl +++ b/src/ejabberd_auth_odbc.erl @@ -212,6 +212,7 @@ is_user_exists(User, Server) -> true; %% Account exists {selected, [<<"password">>], []} -> false; %% Account does not exist + {error, unknownhost} -> false; {error, Error} -> {error, Error} catch _:B -> {error, B} diff --git a/src/ejabberd_odbc.erl b/src/ejabberd_odbc.erl index 802e32ae2..df9a4c398 100644 --- a/src/ejabberd_odbc.erl +++ b/src/ejabberd_odbc.erl @@ -141,7 +141,7 @@ sql_call(Host, Msg) -> case get(?STATE_KEY) of undefined -> case ejabberd_odbc_sup:get_random_pid(Host) of - none -> ?WARNING_MSG("SQL calling unknown host: ~p~n", [Host]); + none -> {error, unknownhost}; Pid -> (?GEN_FSM):sync_send_event(Pid,{sql_cmd, Msg, now()}, ?TRANSACTION_TIMEOUT) -- cgit v1.2.3 From b3714a1b2ecbc31e6ea45bdb18fe39e4a7d236c6 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 30 Apr 2014 15:59:44 +0200 Subject: Fix formatting string argument (thanks to Locojay)(github #129) --- src/ejabberd_xmlrpc.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_xmlrpc.erl b/src/ejabberd_xmlrpc.erl index 76610af8e..da9b12606 100644 --- a/src/ejabberd_xmlrpc.erl +++ b/src/ejabberd_xmlrpc.erl @@ -428,7 +428,11 @@ format_arg({array, Elements}, {list, ElementsDef}) format_arg(Arg, integer) when is_integer(Arg) -> Arg; format_arg(Arg, binary) when is_list(Arg) -> list_to_binary(Arg); format_arg(Arg, binary) when is_binary(Arg) -> Arg; -format_arg(Arg, string) when is_binary(Arg) -> Arg. +format_arg(Arg, string) when is_list(Arg) -> list_to_binary(Arg); +format_arg(Arg, string) when is_binary(Arg) -> Arg; +format_arg(Arg, Format) -> + ?ERROR_MSG("don't know how to format Arg ~p for format ~p , [Arg, Format]") + error. %% ----------------------------- %% Result -- cgit v1.2.3 From ec6c58a21c6922a0049c8f2f9ee36dbc00f50f1f Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 30 Apr 2014 16:02:20 +0200 Subject: Fix error reporting in previous commit --- src/ejabberd_xmlrpc.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ejabberd_xmlrpc.erl b/src/ejabberd_xmlrpc.erl index da9b12606..ff89d2858 100644 --- a/src/ejabberd_xmlrpc.erl +++ b/src/ejabberd_xmlrpc.erl @@ -431,8 +431,8 @@ format_arg(Arg, binary) when is_binary(Arg) -> Arg; format_arg(Arg, string) when is_list(Arg) -> list_to_binary(Arg); format_arg(Arg, string) when is_binary(Arg) -> Arg; format_arg(Arg, Format) -> - ?ERROR_MSG("don't know how to format Arg ~p for format ~p , [Arg, Format]") - error. + ?ERROR_MSG("don't know how to format Arg ~p for format ~p", [Arg, Format]), + throw({error_formatting_argument, Arg, Format}). %% ----------------------------- %% Result -- cgit v1.2.3 From 02e0649d18e5afcc463ddbe3e2c49ccfef3a1eb9 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 30 Apr 2014 19:20:38 +0400 Subject: SIP support Conflicts: configure configure.ac doc/guide.tex --- src/ejabberd_listener.erl | 36 +++++ src/mod_sip.erl | 404 ++++++++++++++++++++++++++++++++++++++++++++++ src/mod_sip_proxy.erl | 152 +++++++++++++++++ src/mod_sip_registrar.erl | 196 ++++++++++++++++++++++ 4 files changed, 788 insertions(+) create mode 100644 src/mod_sip.erl create mode 100644 src/mod_sip_proxy.erl create mode 100644 src/mod_sip_registrar.erl (limited to 'src') diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 2051afdb2..71f744077 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -151,6 +151,19 @@ init_udp(PortIP, Module, Opts, SockOpts, Port, IPS) -> {ok, Socket} -> %% Inform my parent that this port was opened succesfully proc_lib:init_ack({ok, self()}), + case erlang:function_exported(Module, udp_init, 2) of + true -> + case catch Module:udp_init(Socket, Opts) of + {'EXIT', _} = Err -> + ?ERROR_MSG("failed to process callback function " + "~p:~s(~p, ~p): ~p", + [Module, udp_init, Socket, Opts, Err]); + _ -> + ok + end; + false -> + ok + end, udp_recv(Socket, Module, Opts); {error, Reason} -> socket_error(Reason, PortIP, Module, SockOpts, Port, IPS) @@ -160,6 +173,19 @@ init_tcp(PortIP, Module, Opts, SockOpts, Port, IPS) -> ListenSocket = listen_tcp(PortIP, Module, SockOpts, Port, IPS), %% Inform my parent that this port was opened succesfully proc_lib:init_ack({ok, self()}), + case erlang:function_exported(Module, tcp_init, 2) of + true -> + case catch Module:tcp_init(ListenSocket, Opts) of + {'EXIT', _} = Err -> + ?ERROR_MSG("failed to process callback function " + "~p:~s(~p, ~p): ~p", + [Module, tcp_init, ListenSocket, Opts, Err]); + _ -> + ok + end; + false -> + ok + end, %% And now start accepting connection attempts accept(ListenSocket, Module, Opts). @@ -342,6 +368,7 @@ start_listener2(Port, Module, Opts) -> %% But it doesn't hurt to attempt to start it for any listener. %% So, it's normal (and harmless) that in most cases this call returns: {error, {already_started, pid()}} maybe_start_stun(Module), + maybe_start_sip(Module), start_module_sup(Port, Module), start_listener_sup(Port, Module, Opts). @@ -463,6 +490,11 @@ maybe_start_stun(ejabberd_stun) -> maybe_start_stun(_) -> ok. +maybe_start_sip(esip_socket) -> + ejabberd:start_app(esip); +maybe_start_sip(_) -> + ok. + %%% %%% Check options %%% @@ -642,7 +674,11 @@ prepare_ip(IP) when is_binary(IP) -> prepare_mod(ejabberd_stun) -> prepare_mod(stun); +prepare_mod(ejabberd_sip) -> + prepare_mod(sip); prepare_mod(stun) -> stun; +prepare_mod(sip) -> + esip_socket; prepare_mod(Mod) when is_atom(Mod) -> Mod. diff --git a/src/mod_sip.erl b/src/mod_sip.erl new file mode 100644 index 000000000..cca91a33d --- /dev/null +++ b/src/mod_sip.erl @@ -0,0 +1,404 @@ +%%%------------------------------------------------------------------- +%%% @author Evgeny Khramtsov +%%% @copyright (C) 2014, Evgeny Khramtsov +%%% @doc +%%% +%%% @end +%%% Created : 21 Apr 2014 by Evgeny Khramtsov +%%%------------------------------------------------------------------- +-module(mod_sip). + +-behaviour(gen_mod). +-behaviour(esip). + +%% API +-export([start/2, stop/1, prepare_request/1, make_response/2, + add_certfile/2, add_via/3]). + +%% esip_callbacks +-export([data_in/2, data_out/2, message_in/2, message_out/2, + request/2, request/3, response/2, locate/1]). + +-include("ejabberd.hrl"). +-include("logger.hrl"). +-include("esip.hrl"). + +-record(sip_session, {us = {<<"">>, <<"">>} :: {binary(), binary()}, + socket = #sip_socket{}, + timestamp = now() :: erlang:timestamp(), + tref = make_ref() :: reference(), + expires = 0 :: non_neg_integer()}). + +%%%=================================================================== +%%% API +%%%=================================================================== +start(_Host, _Opts) -> + ejabberd:start_app(esip), + esip:set_config_value(max_server_transactions, 10000), + esip:set_config_value(max_client_transactions, 10000), + esip:set_config_value(software, <<"ejabberd ", (?VERSION)/binary>>), + esip:set_config_value(module, ?MODULE), + Spec = {mod_sip_registrar, {mod_sip_registrar, start_link, []}, + transient, 2000, worker, [mod_sip_registrar]}, + TmpSupSpec = {mod_sip_proxy_sup, + {ejabberd_tmp_sup, start_link, + [mod_sip_proxy_sup, mod_sip_proxy]}, + permanent, infinity, supervisor, [ejabberd_tmp_sup]}, + supervisor:start_child(ejabberd_sup, Spec), + supervisor:start_child(ejabberd_sup, TmpSupSpec), + ok. + +stop(_Host) -> + ok. + +data_in(Data, #sip_socket{type = Transport, + addr = {MyIP, MyPort}, + peer = {PeerIP, PeerPort}}) -> + ?DEBUG( + "SIP [~p/in] ~s:~p -> ~s:~p:~n~s", + [Transport, inet_parse:ntoa(PeerIP), PeerPort, + inet_parse:ntoa(MyIP), MyPort, Data]). + +data_out(Data, #sip_socket{type = Transport, + addr = {MyIP, MyPort}, + peer = {PeerIP, PeerPort}}) -> + ?DEBUG( + "SIP [~p/out] ~s:~p -> ~s:~p:~n~s", + [Transport, inet_parse:ntoa(MyIP), MyPort, + inet_parse:ntoa(PeerIP), PeerPort, Data]). + +message_in(#sip{type = request, method = M} = Req, SIPSock) + when M /= <<"ACK">>, M /= <<"CANCEL">> -> + case action(Req, SIPSock) of + {relay, _LServer, _Opts} -> + ok; + Action -> + request(Req, SIPSock, undefined, Action) + end; +message_in(_, _) -> + ok. + +message_out(_, _) -> + ok. + +response(Resp, SIPSock) -> + case action(Resp, SIPSock) of + {relay, LServer, Opts} -> + case esip:split_hdrs('via', Resp#sip.hdrs) of + {[_], _} -> + ok; + {[_MyVia|Vias], TailHdrs} -> + %% TODO: check if MyVia is really my Via + NewResp = Resp#sip{hdrs = [{'via', Vias}|TailHdrs]}, + case proplists:get_value(socket, Opts) of + undefined -> + case esip:connect(NewResp, + add_certfile(LServer, Opts)) of + {ok, SIPSockOut} -> + esip:send(SIPSockOut, NewResp); + {error, _} -> + ok + end; + SIPSockOut -> + esip:send(SIPSockOut, NewResp) + end + end; + _ -> + ok + end. + +request(#sip{method = <<"ACK">>} = Req, SIPSock) -> + case action(Req, SIPSock) of + {relay, LServer, Opts} -> + Req1 = prepare_request(Req), + case esip:connect(Req1, add_certfile(LServer, Opts)) of + {ok, SIPSockOut} -> + Req2 = add_via(SIPSockOut, LServer, Req1), + esip:send(SIPSockOut, Req2); + {error, _} = Err -> + Err + end; + _ -> + pass + end; +request(#sip{method = <<"CANCEL">>} = Req, SIPSock) -> + case action(Req, SIPSock) of + loop -> + make_response(Req, #sip{status = 483, type = response}); + {unsupported, Require} -> + make_response(Req, #sip{status = 420, + type = response, + hdrs = [{'unsupported', + Require}]}); + {relay, LServer, Opts} -> + Req1 = prepare_request(Req), + case esip:connect(Req1, add_certfile(LServer, Opts)) of + {ok, SIPSockOut} -> + Req2 = add_via(SIPSockOut, LServer, Req1), + esip:send(SIPSockOut, Req2); + {error, _} = Err -> + Err + end, + pass; + _ -> + pass + end. + +request(Req, SIPSock, TrID) -> + request(Req, SIPSock, TrID, action(Req, SIPSock)). + +request(Req, SIPSock, TrID, Action) -> + case Action of + to_me -> + process(Req, SIPSock); + register -> + mod_sip_registrar:request(Req, SIPSock); + loop -> + make_response(Req, #sip{status = 483, type = response}); + {unsupported, Require} -> + make_response(Req, #sip{status = 420, + type = response, + hdrs = [{'unsupported', + Require}]}); + {relay, LServer, Opts} -> + case mod_sip_proxy:start(LServer, Opts) of + {ok, Pid} -> + mod_sip_proxy:route(Req, SIPSock, TrID, Pid), + {mod_sip_proxy, route, [Pid]}; + Err -> + ?INFO_MSG("failed to proxy request ~p: ~p", [Req, Err]), + Err + end; + {proxy_auth, Host} -> + make_response( + Req, + #sip{status = 407, + type = response, + hdrs = [{'proxy-authenticate', + make_auth_hdr(Host)}]}); + {auth, Host} -> + make_response( + Req, + #sip{status = 401, + type = response, + hdrs = [{'www-authenticate', + make_auth_hdr(Host)}]}); + deny -> + make_response(Req, #sip{status = 403, + type = response}); + not_found -> + make_response(Req, #sip{status = 480, + type = response}) + end. + +locate(_SIPMsg) -> + ok. + +find(#uri{user = User, host = Host}) -> + LUser = jlib:nodeprep(User), + LServer = jlib:nameprep(Host), + case mod_sip_registrar:find_session( + LUser, LServer) of + {ok, #sip_session{socket = Sock}} -> + {relay, LServer, [{socket, Sock}]}; + error -> + not_found + end. + +%%%=================================================================== +%%% Internal functions +%%%=================================================================== +action(#sip{type = response, hdrs = Hdrs}, _SIPSock) -> + {_, ToURI, _} = esip:get_hdr('to', Hdrs), + {_, FromURI, _} = esip:get_hdr('from', Hdrs), + case at_my_host(FromURI) of + true -> + case at_my_host(ToURI) of + true -> + find(ToURI); + false -> + LServer = jlib:nameprep(FromURI#uri.host), + {relay, LServer, []} + end; + false -> + case at_my_host(ToURI) of + true -> + find(ToURI); + false -> + pass + end + end; +action(#sip{method = <<"REGISTER">>, type = request, hdrs = Hdrs, + uri = #uri{user = <<"">>} = URI} = Req, SIPSock) -> + case at_my_host(URI) of + true -> + case esip:get_hdrs('require', Hdrs) of + [_|_] = Require -> + {unsupported, Require}; + _ -> + {_, ToURI, _} = esip:get_hdr('to', Hdrs), + case at_my_host(ToURI) of + true -> + case check_auth(Req, 'authorization', SIPSock) of + true -> + register; + false -> + {auth, ToURI#uri.host} + end; + false -> + deny + end + end; + false -> + deny + end; +action(#sip{method = Method, hdrs = Hdrs, type = request} = Req, SIPSock) -> + case esip:get_hdr('max-forwards', Hdrs) of + 0 when Method == <<"OPTIONS">> -> + to_me; + 0 -> + loop; + _ -> + case esip:get_hdrs('proxy-require', Hdrs) of + [_|_] = Require -> + {unsupported, Require}; + _ -> + {_, ToURI, _} = esip:get_hdr('to', Hdrs), + {_, FromURI, _} = esip:get_hdr('from', Hdrs), + case at_my_host(FromURI) of + true -> + case check_auth(Req, 'proxy-authorization', SIPSock) of + true -> + case at_my_host(ToURI) of + true -> + find(ToURI); + false -> + LServer = jlib:nameprep(FromURI#uri.host), + {relay, LServer, []} + end; + false -> + {proxy_auth, FromURI#uri.host} + end; + false -> + case at_my_host(ToURI) of + true -> + find(ToURI); + false -> + deny + end + end + end + end. + +check_auth(#sip{method = <<"CANCEL">>}, _, _SIPSock) -> + true; +check_auth(#sip{method = Method, hdrs = Hdrs, body = Body}, AuthHdr, _SIPSock) -> + + Issuer = case AuthHdr of + 'authorization' -> + to; + 'proxy-authorization' -> + from + end, + {_, #uri{user = User, host = Host}, _} = esip:get_hdr(Issuer, Hdrs), + LUser = jlib:nodeprep(User), + LServer = jlib:nameprep(Host), + case lists:filter( + fun({_, Params}) -> + Username = esip:get_param(<<"username">>, Params), + Realm = esip:get_param(<<"realm">>, Params), + (LUser == esip:unquote(Username)) + and (LServer == esip:unquote(Realm)) + end, esip:get_hdrs(AuthHdr, Hdrs)) of + [Auth|_] -> + case ejabberd_auth:get_password_s(LUser, LServer) of + <<"">> -> + false; + Password -> + esip:check_auth(Auth, Method, Body, Password) + end; + [] -> + false + end. + +allow() -> + [<<"OPTIONS">>, <<"REGISTER">>]. + +process(#sip{method = <<"OPTIONS">>} = Req, _) -> + make_response(Req, #sip{type = response, status = 200, + hdrs = [{'allow', allow()}]}); +process(#sip{method = <<"REGISTER">>} = Req, _) -> + make_response(Req, #sip{type = response, status = 400}); +process(Req, _) -> + make_response(Req, #sip{type = response, status = 405, + hdrs = [{'allow', allow()}]}). + +prepare_request(#sip{hdrs = Hdrs1} = Req) -> + MF = esip:get_hdr('max-forwards', Hdrs1), + Hdrs2 = esip:set_hdr('max-forwards', MF-1, Hdrs1), + Hdrs3 = lists:filter( + fun({'proxy-authorization', {_, Params}}) -> + Realm = esip:unquote(esip:get_param(<<"realm">>, Params)), + not is_my_host(jlib:nameprep(Realm)); + (_) -> + true + end, Hdrs2), + Req#sip{hdrs = Hdrs3}. + +make_auth_hdr(LServer) -> + Realm = jlib:nameprep(LServer), + {<<"Digest">>, [{<<"realm">>, esip:quote(Realm)}, + {<<"qop">>, esip:quote(<<"auth">>)}, + {<<"nonce">>, esip:quote(esip:make_hexstr(20))}]}. + +make_response(Req, Resp) -> + esip:make_response(Req, Resp, esip:make_tag()). + +at_my_host(#uri{host = Host}) -> + is_my_host(jlib:nameprep(Host)). + +is_my_host(LServer) -> + gen_mod:is_loaded(LServer, ?MODULE). + +add_certfile(LServer, Opts) -> + case ejabberd_config:get_option({domain_certfile, LServer}, + fun iolist_to_binary/1) of + CertFile when is_binary(CertFile), CertFile /= <<"">> -> + [{certfile, CertFile}|Opts]; + _ -> + Opts + end. + +add_via(#sip_socket{type = Transport}, LServer, #sip{hdrs = Hdrs} = Req) -> + ConfiguredVias = get_configured_vias(LServer), + {ViaHost, ViaPort} = proplists:get_value( + Transport, ConfiguredVias, {LServer, undefined}), + ViaTransport = case Transport of + tls -> <<"TLS">>; + tcp -> <<"TCP">>; + udp -> <<"UDP">> + end, + Via = #via{transport = ViaTransport, + host = ViaHost, + port = ViaPort, + params = [{<<"branch">>, esip:make_branch()}, + {<<"rport">>, <<"">>}]}, + Req#sip{hdrs = [{'via', [Via]}|Hdrs]}. + +get_configured_vias(LServer) -> + gen_mod:get_module_opt( + LServer, ?MODULE, via, + fun(L) -> + lists:map( + fun(Opts) -> + Type = proplists:get_value(type, Opts), + Host = proplists:get_value(host, Opts), + Port = proplists:get_value(port, Opts), + true = (Type == tcp) or (Type == tls) or (Type == udp), + true = is_binary(Host) and (Host /= <<"">>), + true = (is_integer(Port) + and (Port > 0) and (Port < 65536)) + or (Port == undefined), + {Type, {Host, Port}} + end, L) + end, []). diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl new file mode 100644 index 000000000..aa749ccf7 --- /dev/null +++ b/src/mod_sip_proxy.erl @@ -0,0 +1,152 @@ +%%%------------------------------------------------------------------- +%%% @author Evgeny Khramtsov +%%% @copyright (C) 2014, Evgeny Khramtsov +%%% @doc +%%% +%%% @end +%%% Created : 21 Apr 2014 by Evgeny Khramtsov +%%%------------------------------------------------------------------- +-module(mod_sip_proxy). + +-define(GEN_FSM, p1_fsm). +-behaviour(?GEN_FSM). + +%% API +-export([start/2, start_link/2, route/4, route/5]). + +%% gen_fsm callbacks +-export([init/1, wait_for_request/2, wait_for_response/2, + handle_event/3, handle_sync_event/4, + handle_info/3, terminate/3, code_change/4]). + +-include("ejabberd.hrl"). +-include("logger.hrl"). +-include("esip.hrl"). + +-define(MAX_REDIRECTS, 5). + +-record(state, {host = <<"">> :: binary(), + opts = [] :: [{certfile, binary()}], + orig_trid, + orig_req :: #sip{}, + client_trid}). + +%%%=================================================================== +%%% API +%%%=================================================================== +start(LServer, Opts) -> + supervisor:start_child(mod_sip_proxy_sup, [LServer, Opts]). + +start_link(LServer, Opts) -> + ?GEN_FSM:start_link(?MODULE, [LServer, Opts], []). + +route(Resp, Req, _SIPSock, TrID, Pid) -> + ?GEN_FSM:send_event(Pid, {Resp, Req, TrID}). + +route(SIPMsg, _SIPSock, TrID, Pid) -> + ?GEN_FSM:send_event(Pid, {SIPMsg, TrID}), + wait. + +%%%=================================================================== +%%% gen_fsm callbacks +%%%=================================================================== +init([Host, Opts]) -> + {ok, wait_for_request, #state{opts = Opts, host = Host}}. + +wait_for_request({#sip{type = request} = Req, TrID}, State) -> + Opts = mod_sip:add_certfile(State#state.host, State#state.opts), + Req1 = mod_sip:prepare_request(Req), + case connect(Req1, Opts) of + {ok, SIPSocket} -> + Req2 = mod_sip:add_via(SIPSocket, State#state.host, Req1), + case esip:request(SIPSocket, Req2, {?MODULE, route, [self()]}) of + {ok, ClientTrID} -> + {next_state, wait_for_response, + State#state{orig_trid = TrID, + orig_req = Req, + client_trid = ClientTrID}}; + Err -> + {Status, Reason} = esip:error_status(Err), + esip:reply(TrID, mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason})), + {stop, normal, State} + end; + Err -> + {Status, Reason} = esip:error_status(Err), + esip:reply(TrID, mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason})), + {stop, normal, State} + end; +wait_for_request(_Event, State) -> + {next_state, wait_for_request, State}. + +wait_for_response({#sip{method = <<"CANCEL">>, type = request}, _TrID}, State) -> + esip:cancel(State#state.client_trid), + {next_state, wait_for_response, State}; +wait_for_response({Resp, _TrID}, State) -> + case Resp of + {error, _} -> + Req = State#state.orig_req, + {Status, Reason} = esip:error_status(Resp), + case Status of + 408 when Req#sip.method /= <<"INVITE">> -> + %% Absorb useless 408. See RFC4320 + esip:stop_transaction(State#state.orig_trid); + _ -> + ErrResp = mod_sip:make_response( + Req, + #sip{type = response, + status = Status, + reason = Reason}), + esip:reply(State#state.orig_trid, ErrResp) + end, + {stop, normal, State}; + #sip{status = 100} -> + {next_state, wait_for_response, State}; + #sip{status = Status} -> + case esip:split_hdrs('via', Resp#sip.hdrs) of + {[_], _} -> + {stop, normal, State}; + {[_|Vias], NewHdrs} -> + esip:reply(State#state.orig_trid, + Resp#sip{hdrs = [{'via', Vias}|NewHdrs]}), + if Status < 200 -> + {next_state, wait_for_response, State}; + true -> + {stop, normal, State} + end + end + end; +wait_for_response(_Event, State) -> + {next_state, wait_for_response, State}. + +handle_event(_Event, StateName, State) -> + {next_state, StateName, State}. + +handle_sync_event(_Event, _From, StateName, State) -> + Reply = ok, + {reply, Reply, StateName, State}. + +handle_info(_Info, StateName, State) -> + {next_state, StateName, State}. + +terminate(_Reason, _StateName, _State) -> + ok. + +code_change(_OldVsn, StateName, State, _Extra) -> + {ok, StateName, State}. + +%%%=================================================================== +%%% Internal functions +%%%=================================================================== +connect(Req, Opts) -> + case proplists:get_value(socket, Opts) of + undefined -> + esip:connect(Req, Opts); + #sip_socket{} = SIPSock -> + {ok, SIPSock} + end. diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl new file mode 100644 index 000000000..d8f485fef --- /dev/null +++ b/src/mod_sip_registrar.erl @@ -0,0 +1,196 @@ +%%%------------------------------------------------------------------- +%%% @author Evgeny Khramtsov +%%% @copyright (C) 2014, Evgeny Khramtsov +%%% @doc +%%% +%%% @end +%%% Created : 23 Apr 2014 by Evgeny Khramtsov +%%%------------------------------------------------------------------- +-module(mod_sip_registrar). + +-define(GEN_SERVER, p1_server). +-behaviour(?GEN_SERVER). + +%% API +-export([start_link/0, request/2, find_session/2]). + +%% gen_server callbacks +-export([init/1, handle_call/3, handle_cast/2, handle_info/2, + terminate/2, code_change/3]). + +-include("ejabberd.hrl"). +-include("logger.hrl"). +-include("esip.hrl"). + +-record(sip_session, {us = {<<"">>, <<"">>} :: {binary(), binary()}, + socket = #sip_socket{}, + timestamp = now() :: erlang:timestamp(), + tref = make_ref() :: reference(), + expires = 0 :: non_neg_integer()}). + +-record(state, {}). + +%%%=================================================================== +%%% API +%%%=================================================================== +start_link() -> + ?GEN_SERVER:start_link({local, ?MODULE}, ?MODULE, [], []). + +request(#sip{hdrs = Hdrs} = Req, SIPSock) -> + {_, #uri{user = U, host = S}, _} = esip:get_hdr('to', Hdrs), + LUser = jlib:nodeprep(U), + LServer = jlib:nameprep(S), + {PeerIP, _} = SIPSock#sip_socket.peer, + US = {LUser, LServer}, + Expires = esip:get_hdr('expires', Hdrs, 0), + case esip:get_hdrs('contact', Hdrs) of + [<<"*">>] when Expires == 0 -> + ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", + [LUser, LServer, inet_parse:ntoa(PeerIP)]), + unregister_session(US), + mod_sip:make_response(Req, #sip{type = response, status = 200}); + [{_, _URI, _Params}|_] = Contacts -> + ContactsWithExpires = + lists:map( + fun({Name, URI, Params}) -> + Exp = case to_integer( + esip:get_param( + <<"expires">>, Params), + 0, (1 bsl 32)-1) of + {ok, E} -> E; + _ -> Expires + end, + NewParams = esip:set_param( + <<"expires">>, + erlang:integer_to_binary(Exp), + Params), + {Exp, {Name, URI, NewParams}} + end, Contacts), + [{Expires1, _}|_] = lists:keysort(1, ContactsWithExpires), + MinExpires = min_expires(), + if Expires1 >= MinExpires -> + ?INFO_MSG("register SIP session for user ~s@~s from ~s", + [LUser, LServer, inet_parse:ntoa(PeerIP)]), + register_session(US, SIPSock, Expires1), + mod_sip:make_response( + Req, + #sip{type = response, + status = 200, + hdrs = [{'contact', + [C || {_, C} <- ContactsWithExpires]}]}); + Expires1 > 0, Expires1 < MinExpires -> + mod_sip:make_response( + Req, #sip{type = response, + status = 423, + hdrs = [{'min-expires', MinExpires}]}); + true -> + ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", + [LUser, LServer, inet_parse:ntoa(PeerIP)]), + unregister_session(US), + mod_sip:make_response( + Req, + #sip{type = response, status = 200, + hdrs = [{'contact', + [C || {_, C} <- ContactsWithExpires]}]}) + end; + _ -> + mod_sip:make_response(Req, #sip{type = response, status = 400}) + end. + +find_session(U, S) -> + case mnesia:dirty_read(sip_session, {U, S}) of + [Session] -> + {ok, Session}; + [] -> + error + end. + +%%%=================================================================== +%%% gen_server callbacks +%%%=================================================================== +init([]) -> + mnesia:create_table(sip_session, + [{ram_copies, [node()]}, + {attributes, record_info(fields, sip_session)}]), + mnesia:add_table_copy(sip_session, node(), ram_copies), + {ok, #state{}}. + +handle_call({write, Session}, _From, State) -> + Res = write_session(Session), + {reply, Res, State}; +handle_call({delete, US}, _From, State) -> + Res = delete_session(US), + {reply, Res, State}; +handle_call(_Request, _From, State) -> + Reply = ok, + {reply, Reply, State}. + +handle_cast(_Msg, State) -> + {noreply, State}. + +handle_info({write, Session}, State) -> + write_session(Session), + {noreply, State}; +handle_info({delete, US}, State) -> + delete_session(US), + {noreply, State}; +handle_info({timeout, TRef, US}, State) -> + case mnesia:dirty_read(sip_session, US) of + [#sip_session{tref = TRef}] -> + mnesia:dirty_delete(sip_session, US); + [] -> + ok + end, + {noreply, State}; +handle_info(_Info, State) -> + ?ERROR_MSG("got unexpected info: ~p", [_Info]), + {noreply, State}. + +terminate(_Reason, _State) -> + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%%%=================================================================== +%%% Internal functions +%%%=================================================================== +register_session(US, SIPSocket, Expires) -> + Session = #sip_session{us = US, + socket = SIPSocket, + timestamp = now(), + expires = Expires}, + gen_server:call(?MODULE, {write, Session}). + +unregister_session(US) -> + gen_server:call(?MODULE, {delete, US}). + +write_session(#sip_session{us = US, expires = Expires} = Session) -> + case mnesia:dirty_read(sip_session, US) of + [#sip_session{tref = TRef}] -> + erlang:cancel_timer(TRef); + [] -> + ok + end, + NewTRef = erlang:start_timer(Expires * 1000, self(), US), + mnesia:dirty_write(Session#sip_session{tref = NewTRef}). + +delete_session(US) -> + case mnesia:dirty_read(sip_session, US) of + [#sip_session{tref = TRef}] -> + erlang:cancel_timer(TRef), + mnesia:dirty_delete(sip_session, US); + [] -> + ok + end. + +min_expires() -> + 60. + +to_integer(Bin, Min, Max) -> + case catch list_to_integer(binary_to_list(Bin)) of + N when N >= Min, N =< Max -> + {ok, N}; + _ -> + error + end. -- cgit v1.2.3 From d83368d73d06e2c214d2beefb9f43acc605973d0 Mon Sep 17 00:00:00 2001 From: HAMANO Tsukasa Date: Thu, 1 May 2014 15:12:04 +0900 Subject: fix ejabberd_system_monitor:s2s_out_info/1 error --- src/ejabberd_system_monitor.erl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ejabberd_system_monitor.erl b/src/ejabberd_system_monitor.erl index 011c02c40..368c5a0ff 100644 --- a/src/ejabberd_system_monitor.erl +++ b/src/ejabberd_system_monitor.erl @@ -244,9 +244,8 @@ s2s_out_info(Pid) -> [<<"Process type: s2s_out">>, case FromTo of [{From, To}] -> - <<"\n", - (io_lib:format("S2S connection: from ~s to ~s", - [From, To]))/binary>>; + list_to_binary(io_lib:format("\nS2S connection: from ~s to ~s", + [From, To])); _ -> <<"">> end, check_send_queue(Pid), <<"\n">>, -- cgit v1.2.3 From 35faffe7dac60c098a0eb0f7b9365e9a05141614 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 13:27:35 +0400 Subject: Locate sessions by proxy processes directly --- src/mod_sip.erl | 116 ++++++++++++++++------------------------------ src/mod_sip_proxy.erl | 30 ++++++++---- src/mod_sip_registrar.erl | 8 ++-- 3 files changed, 65 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/mod_sip.erl b/src/mod_sip.erl index cca91a33d..87608d18e 100644 --- a/src/mod_sip.erl +++ b/src/mod_sip.erl @@ -13,7 +13,7 @@ %% API -export([start/2, stop/1, prepare_request/1, make_response/2, - add_certfile/2, add_via/3]). + add_via/3, at_my_host/1]). %% esip_callbacks -export([data_in/2, data_out/2, message_in/2, message_out/2, @@ -23,12 +23,6 @@ -include("logger.hrl"). -include("esip.hrl"). --record(sip_session, {us = {<<"">>, <<"">>} :: {binary(), binary()}, - socket = #sip_socket{}, - timestamp = now() :: erlang:timestamp(), - tref = make_ref() :: reference(), - expires = 0 :: non_neg_integer()}). - %%%=================================================================== %%% API %%%=================================================================== @@ -70,7 +64,7 @@ data_out(Data, #sip_socket{type = Transport, message_in(#sip{type = request, method = M} = Req, SIPSock) when M /= <<"ACK">>, M /= <<"CANCEL">> -> case action(Req, SIPSock) of - {relay, _LServer, _Opts} -> + {relay, _LServer} -> ok; Action -> request(Req, SIPSock, undefined, Action) @@ -83,66 +77,26 @@ message_out(_, _) -> response(Resp, SIPSock) -> case action(Resp, SIPSock) of - {relay, LServer, Opts} -> + {relay, LServer} -> case esip:split_hdrs('via', Resp#sip.hdrs) of {[_], _} -> ok; {[_MyVia|Vias], TailHdrs} -> %% TODO: check if MyVia is really my Via NewResp = Resp#sip{hdrs = [{'via', Vias}|TailHdrs]}, - case proplists:get_value(socket, Opts) of - undefined -> - case esip:connect(NewResp, - add_certfile(LServer, Opts)) of - {ok, SIPSockOut} -> - esip:send(SIPSockOut, NewResp); - {error, _} -> - ok - end; - SIPSockOut -> - esip:send(SIPSockOut, NewResp) + case esip:connect(NewResp, add_certfile(LServer, [])) of + {ok, SIPSockOut} -> + esip:send(SIPSockOut, NewResp); + {error, _} -> + ok end end; _ -> ok end. -request(#sip{method = <<"ACK">>} = Req, SIPSock) -> - case action(Req, SIPSock) of - {relay, LServer, Opts} -> - Req1 = prepare_request(Req), - case esip:connect(Req1, add_certfile(LServer, Opts)) of - {ok, SIPSockOut} -> - Req2 = add_via(SIPSockOut, LServer, Req1), - esip:send(SIPSockOut, Req2); - {error, _} = Err -> - Err - end; - _ -> - pass - end; -request(#sip{method = <<"CANCEL">>} = Req, SIPSock) -> - case action(Req, SIPSock) of - loop -> - make_response(Req, #sip{status = 483, type = response}); - {unsupported, Require} -> - make_response(Req, #sip{status = 420, - type = response, - hdrs = [{'unsupported', - Require}]}); - {relay, LServer, Opts} -> - Req1 = prepare_request(Req), - case esip:connect(Req1, add_certfile(LServer, Opts)) of - {ok, SIPSockOut} -> - Req2 = add_via(SIPSockOut, LServer, Req1), - esip:send(SIPSockOut, Req2); - {error, _} = Err -> - Err - end, - pass; - _ -> - pass - end. +request(_Req, _SIPSock) -> + error. request(Req, SIPSock, TrID) -> request(Req, SIPSock, TrID, action(Req, SIPSock)). @@ -160,8 +114,8 @@ request(Req, SIPSock, TrID, Action) -> type = response, hdrs = [{'unsupported', Require}]}); - {relay, LServer, Opts} -> - case mod_sip_proxy:start(LServer, Opts) of + {relay, LServer} -> + case mod_sip_proxy:start(LServer, add_certfile(LServer, [])) of {ok, Pid} -> mod_sip_proxy:route(Req, SIPSock, TrID, Pid), {mod_sip_proxy, route, [Pid]}; @@ -194,17 +148,6 @@ request(Req, SIPSock, TrID, Action) -> locate(_SIPMsg) -> ok. -find(#uri{user = User, host = Host}) -> - LUser = jlib:nodeprep(User), - LServer = jlib:nameprep(Host), - case mod_sip_registrar:find_session( - LUser, LServer) of - {ok, #sip_session{socket = Sock}} -> - {relay, LServer, [{socket, Sock}]}; - error -> - not_found - end. - %%%=================================================================== %%% Internal functions %%%=================================================================== @@ -215,15 +158,24 @@ action(#sip{type = response, hdrs = Hdrs}, _SIPSock) -> true -> case at_my_host(ToURI) of true -> - find(ToURI); + case ToURI#uri.user of + <<"">> -> + to_me; + _ -> + {relay, jlib:nameprep(ToURI#uri.host)} + end; false -> - LServer = jlib:nameprep(FromURI#uri.host), - {relay, LServer, []} + {relay, jlib:nameprep(FromURI#uri.host)} end; false -> case at_my_host(ToURI) of true -> - find(ToURI); + case ToURI#uri.user of + <<"">> -> + to_me; + _ -> + {relay, jlib:nameprep(ToURI#uri.host)} + end; false -> pass end @@ -271,10 +223,16 @@ action(#sip{method = Method, hdrs = Hdrs, type = request} = Req, SIPSock) -> true -> case at_my_host(ToURI) of true -> - find(ToURI); + case ToURI#uri.user of + <<"">> -> + to_me; + _ -> + LServer = jlib:nameprep(ToURI#uri.host), + {relay, LServer} + end; false -> LServer = jlib:nameprep(FromURI#uri.host), - {relay, LServer, []} + {relay, LServer} end; false -> {proxy_auth, FromURI#uri.host} @@ -282,7 +240,13 @@ action(#sip{method = Method, hdrs = Hdrs, type = request} = Req, SIPSock) -> false -> case at_my_host(ToURI) of true -> - find(ToURI); + case ToURI#uri.user of + <<"">> -> + to_me; + _ -> + LServer = jlib:nameprep(ToURI#uri.host), + {relay, LServer} + end; false -> deny end diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl index aa749ccf7..ef2192a20 100644 --- a/src/mod_sip_proxy.erl +++ b/src/mod_sip_proxy.erl @@ -23,8 +23,6 @@ -include("logger.hrl"). -include("esip.hrl"). --define(MAX_REDIRECTS, 5). - -record(state, {host = <<"">> :: binary(), opts = [] :: [{certfile, binary()}], orig_trid, @@ -54,7 +52,7 @@ init([Host, Opts]) -> {ok, wait_for_request, #state{opts = Opts, host = Host}}. wait_for_request({#sip{type = request} = Req, TrID}, State) -> - Opts = mod_sip:add_certfile(State#state.host, State#state.opts), + Opts = State#state.opts, Req1 = mod_sip:prepare_request(Req), case connect(Req1, Opts) of {ok, SIPSocket} -> @@ -73,6 +71,12 @@ wait_for_request({#sip{type = request} = Req, TrID}, State) -> reason = Reason})), {stop, normal, State} end; + {error, notfound} -> + esip:reply(TrID, mod_sip:make_response( + Req, #sip{type = response, + status = 480, + reason = esip:reason(480)})), + {stop, normal, State}; Err -> {Status, Reason} = esip:error_status(Err), esip:reply(TrID, mod_sip:make_response( @@ -143,10 +147,18 @@ code_change(_OldVsn, StateName, State, _Extra) -> %%%=================================================================== %%% Internal functions %%%=================================================================== -connect(Req, Opts) -> - case proplists:get_value(socket, Opts) of - undefined -> - esip:connect(Req, Opts); - #sip_socket{} = SIPSock -> - {ok, SIPSock} +connect(#sip{hdrs = Hdrs} = Req, Opts) -> + {_, ToURI, _} = esip:get_hdr('to', Hdrs), + case mod_sip:at_my_host(ToURI) of + true -> + LUser = jlib:nodeprep(ToURI#uri.user), + LServer = jlib:nameprep(ToURI#uri.host), + case mod_sip_registrar:find_socket(LUser, LServer) of + {ok, SIPSock} -> + {ok, SIPSock}; + error -> + {error, notfound} + end; + false -> + esip:connect(Req, Opts) end. diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index d8f485fef..6c945e5ec 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -12,7 +12,7 @@ -behaviour(?GEN_SERVER). %% API --export([start_link/0, request/2, find_session/2]). +-export([start_link/0, request/2, find_socket/2]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, @@ -97,10 +97,10 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> mod_sip:make_response(Req, #sip{type = response, status = 400}) end. -find_session(U, S) -> +find_socket(U, S) -> case mnesia:dirty_read(sip_session, {U, S}) of - [Session] -> - {ok, Session}; + [#sip_session{socket = SIPSocket}] -> + {ok, SIPSocket}; [] -> error end. -- cgit v1.2.3 From 6a95422af8537a09259fbfc59d27f01eccc5c4a2 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 15:51:58 +0400 Subject: Multiple REGISTER bindings support --- src/mod_sip_proxy.erl | 6 +- src/mod_sip_registrar.erl | 206 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 155 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl index ef2192a20..211597256 100644 --- a/src/mod_sip_proxy.erl +++ b/src/mod_sip_proxy.erl @@ -153,10 +153,10 @@ connect(#sip{hdrs = Hdrs} = Req, Opts) -> true -> LUser = jlib:nodeprep(ToURI#uri.user), LServer = jlib:nameprep(ToURI#uri.host), - case mod_sip_registrar:find_socket(LUser, LServer) of - {ok, SIPSock} -> + case mod_sip_registrar:find_sockets(LUser, LServer) of + [SIPSock|_] -> {ok, SIPSock}; - error -> + [] -> {error, notfound} end; false -> diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 6c945e5ec..48740d0ed 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -12,7 +12,7 @@ -behaviour(?GEN_SERVER). %% API --export([start_link/0, request/2, find_socket/2]). +-export([start_link/0, request/2, find_sockets/2]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, @@ -22,11 +22,15 @@ -include("logger.hrl"). -include("esip.hrl"). +-record(binding, {socket = #sip_socket{}, + call_id = <<"">> :: binary(), + cseq = 0 :: non_neg_integer(), + timestamp = now() :: erlang:timestamp(), + tref = make_ref() :: reference(), + expires = 0 :: non_neg_integer()}). + -record(sip_session, {us = {<<"">>, <<"">>} :: {binary(), binary()}, - socket = #sip_socket{}, - timestamp = now() :: erlang:timestamp(), - tref = make_ref() :: reference(), - expires = 0 :: non_neg_integer()}). + bindings = [] :: [#binding{}]}). -record(state, {}). @@ -42,13 +46,24 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> LServer = jlib:nameprep(S), {PeerIP, _} = SIPSock#sip_socket.peer, US = {LUser, LServer}, + CallID = esip:get_hdr('call-id', Hdrs), + CSeq = esip:get_hdr('cseq', Hdrs), Expires = esip:get_hdr('expires', Hdrs, 0), case esip:get_hdrs('contact', Hdrs) of [<<"*">>] when Expires == 0 -> - ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", - [LUser, LServer, inet_parse:ntoa(PeerIP)]), - unregister_session(US), - mod_sip:make_response(Req, #sip{type = response, status = 200}); + case unregister_session(US, SIPSock, CallID, CSeq) of + ok -> + ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", + [LUser, LServer, inet_parse:ntoa(PeerIP)]), + mod_sip:make_response( + Req, #sip{type = response, status = 200}); + {error, Why} -> + {Status, Reason} = make_status(Why), + mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason}) + end; [{_, _URI, _Params}|_] = Contacts -> ContactsWithExpires = lists:map( @@ -69,40 +84,58 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> [{Expires1, _}|_] = lists:keysort(1, ContactsWithExpires), MinExpires = min_expires(), if Expires1 >= MinExpires -> - ?INFO_MSG("register SIP session for user ~s@~s from ~s", - [LUser, LServer, inet_parse:ntoa(PeerIP)]), - register_session(US, SIPSock, Expires1), - mod_sip:make_response( - Req, - #sip{type = response, - status = 200, - hdrs = [{'contact', - [C || {_, C} <- ContactsWithExpires]}]}); + case register_session(US, SIPSock, CallID, CSeq, Expires1) of + ok -> + ?INFO_MSG("register SIP session for user ~s@~s from ~s", + [LUser, LServer, inet_parse:ntoa(PeerIP)]), + mod_sip:make_response( + Req, + #sip{type = response, + status = 200, + hdrs = [{'contact', + [C || {_, C} <- ContactsWithExpires]}]}); + {error, Why} -> + {Status, Reason} = make_status(Why), + mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason}) + end; Expires1 > 0, Expires1 < MinExpires -> mod_sip:make_response( Req, #sip{type = response, status = 423, hdrs = [{'min-expires', MinExpires}]}); true -> - ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", - [LUser, LServer, inet_parse:ntoa(PeerIP)]), - unregister_session(US), - mod_sip:make_response( - Req, - #sip{type = response, status = 200, - hdrs = [{'contact', - [C || {_, C} <- ContactsWithExpires]}]}) + case unregister_session(US, SIPSock, CallID, CSeq) of + ok -> + ?INFO_MSG("unregister SIP session for user ~s@~s from ~s", + [LUser, LServer, inet_parse:ntoa(PeerIP)]), + mod_sip:make_response( + Req, + #sip{type = response, status = 200, + hdrs = [{'contact', + [C || {_, C} <- ContactsWithExpires]}]}); + {error, Why} -> + {Status, Reason} = make_status(Why), + mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason}) + end end; + [] -> + mod_sip:make_response(Req, #sip{type = response, status = 200}); _ -> mod_sip:make_response(Req, #sip{type = response, status = 400}) end. -find_socket(U, S) -> +find_sockets(U, S) -> case mnesia:dirty_read(sip_session, {U, S}) of - [#sip_session{socket = SIPSocket}] -> - {ok, SIPSocket}; + [#sip_session{bindings = Bindings}] -> + [Binding#binding.socket || Binding <- Bindings]; [] -> - error + [] end. %%%=================================================================== @@ -118,8 +151,8 @@ init([]) -> handle_call({write, Session}, _From, State) -> Res = write_session(Session), {reply, Res, State}; -handle_call({delete, US}, _From, State) -> - Res = delete_session(US), +handle_call({delete, US, SIPSocket, CallID, CSeq}, _From, State) -> + Res = delete_session(US, SIPSocket, CallID, CSeq), {reply, Res, State}; handle_call(_Request, _From, State) -> Reply = ok, @@ -131,13 +164,25 @@ handle_cast(_Msg, State) -> handle_info({write, Session}, State) -> write_session(Session), {noreply, State}; -handle_info({delete, US}, State) -> - delete_session(US), +handle_info({delete, US, SIPSocket, CallID, CSeq}, State) -> + delete_session(US, SIPSocket, CallID, CSeq), {noreply, State}; handle_info({timeout, TRef, US}, State) -> case mnesia:dirty_read(sip_session, US) of - [#sip_session{tref = TRef}] -> - mnesia:dirty_delete(sip_session, US); + [#sip_session{bindings = Bindings}] -> + case lists:filter( + fun(#binding{tref = TRef1}) when TRef1 == TRef -> + false; + (_) -> + true + end, Bindings) of + [] -> + mnesia:dirty_delete(sip_session, US); + NewBindings -> + mnesia:dirty_write(sip_session, + #sip_session{us = US, + bindings = NewBindings}) + end; [] -> ok end, @@ -155,33 +200,68 @@ code_change(_OldVsn, State, _Extra) -> %%%=================================================================== %%% Internal functions %%%=================================================================== -register_session(US, SIPSocket, Expires) -> +register_session(US, SIPSocket, CallID, CSeq, Expires) -> Session = #sip_session{us = US, - socket = SIPSocket, - timestamp = now(), - expires = Expires}, + bindings = [#binding{socket = SIPSocket, + call_id = CallID, + cseq = CSeq, + timestamp = now(), + expires = Expires}]}, gen_server:call(?MODULE, {write, Session}). -unregister_session(US) -> - gen_server:call(?MODULE, {delete, US}). +unregister_session(US, SIPSocket, CallID, CSeq) -> + Msg = {delete, US, SIPSocket, CallID, CSeq}, + gen_server:call(?MODULE, Msg). -write_session(#sip_session{us = US, expires = Expires} = Session) -> +write_session(#sip_session{us = US, + bindings = [#binding{socket = SIPSocket, + call_id = CallID, + expires = Expires, + cseq = CSeq} = Binding]}) -> case mnesia:dirty_read(sip_session, US) of - [#sip_session{tref = TRef}] -> - erlang:cancel_timer(TRef); + [#sip_session{bindings = Bindings}] -> + case pop_previous_binding(SIPSocket, Bindings) of + {ok, #binding{call_id = CallID, cseq = PrevCSeq}, _} + when PrevCSeq >= CSeq -> + {error, cseq_out_of_order}; + {ok, #binding{tref = Tref}, Bindings1} -> + erlang:cancel_timer(Tref), + NewTRef = erlang:start_timer(Expires * 1000, self(), US), + NewBindings = [Binding#binding{tref = NewTRef}|Bindings1], + mnesia:dirty_write( + #sip_session{us = US, bindings = NewBindings}); + {error, notfound} -> + NewTRef = erlang:start_timer(Expires * 1000, self(), US), + NewBindings = [Binding#binding{tref = NewTRef}|Bindings], + mnesia:dirty_write( + #sip_session{us = US, bindings = NewBindings}) + end; [] -> - ok - end, - NewTRef = erlang:start_timer(Expires * 1000, self(), US), - mnesia:dirty_write(Session#sip_session{tref = NewTRef}). + NewTRef = erlang:start_timer(Expires * 1000, self(), US), + NewBindings = [Binding#binding{tref = NewTRef}], + mnesia:dirty_write(#sip_session{us = US, bindings = NewBindings}) + end. -delete_session(US) -> +delete_session(US, SIPSocket, CallID, CSeq) -> case mnesia:dirty_read(sip_session, US) of - [#sip_session{tref = TRef}] -> - erlang:cancel_timer(TRef), - mnesia:dirty_delete(sip_session, US); + [#sip_session{bindings = Bindings}] -> + case pop_previous_binding(SIPSocket, Bindings) of + {ok, #binding{call_id = CallID, cseq = PrevCSeq}, _} + when PrevCSeq >= CSeq -> + {error, cseq_out_of_order}; + {ok, #binding{tref = TRef}, []} -> + erlang:cancel_timer(TRef), + mnesia:dirty_delete(sip_session, US); + {ok, #binding{tref = TRef}, NewBindings} -> + erlang:cancel_timer(TRef), + mnesia:dirty_write(sip_session, + #sip_session{us = US, + bindings = NewBindings}); + {error, notfound} -> + {error, notfound} + end; [] -> - ok + {error, notfound} end. min_expires() -> @@ -194,3 +274,21 @@ to_integer(Bin, Min, Max) -> _ -> error end. + +pop_previous_binding(#sip_socket{peer = Peer}, Bindings) -> + case lists:partition( + fun(#binding{socket = #sip_socket{peer = Peer1}}) -> + Peer1 == Peer + end, Bindings) of + {[Binding], RestBindings} -> + {ok, Binding, RestBindings}; + _ -> + {error, notfound} + end. + +make_status(notfound) -> + {404, esip:reason(404)}; +make_status(cseq_out_of_order) -> + {500, <<"CSeq is Out of Order">>}; +make_status(_) -> + {500, esip:reason(500)}. -- cgit v1.2.3 From 16e5d66572d73839bf4ec290a5af05a25ad3a73d Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 16:31:03 +0400 Subject: Move some code in a separate function --- src/mod_sip_registrar.erl | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 48740d0ed..3e65564c1 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -168,24 +168,7 @@ handle_info({delete, US, SIPSocket, CallID, CSeq}, State) -> delete_session(US, SIPSocket, CallID, CSeq), {noreply, State}; handle_info({timeout, TRef, US}, State) -> - case mnesia:dirty_read(sip_session, US) of - [#sip_session{bindings = Bindings}] -> - case lists:filter( - fun(#binding{tref = TRef1}) when TRef1 == TRef -> - false; - (_) -> - true - end, Bindings) of - [] -> - mnesia:dirty_delete(sip_session, US); - NewBindings -> - mnesia:dirty_write(sip_session, - #sip_session{us = US, - bindings = NewBindings}) - end; - [] -> - ok - end, + delete_expired_session(US, TRef), {noreply, State}; handle_info(_Info, State) -> ?ERROR_MSG("got unexpected info: ~p", [_Info]), @@ -264,6 +247,26 @@ delete_session(US, SIPSocket, CallID, CSeq) -> {error, notfound} end. +delete_expired_session(US, TRef) -> + case mnesia:dirty_read(sip_session, US) of + [#sip_session{bindings = Bindings}] -> + case lists:filter( + fun(#binding{tref = TRef1}) when TRef1 == TRef -> + false; + (_) -> + true + end, Bindings) of + [] -> + mnesia:dirty_delete(sip_session, US); + NewBindings -> + mnesia:dirty_write(sip_session, + #sip_session{us = US, + bindings = NewBindings}) + end; + [] -> + ok + end. + min_expires() -> 60. -- cgit v1.2.3 From 011778731731bbc3e9c0a4064cbe99a75667c727 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 20:43:51 +0400 Subject: Process gen_server timeouts correctly --- src/mod_sip_registrar.erl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 3e65564c1..386391327 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -22,6 +22,8 @@ -include("logger.hrl"). -include("esip.hrl"). +-define(CALL_TIMEOUT, timer:seconds(30)). + -record(binding, {socket = #sip_socket{}, call_id = <<"">> :: binary(), cseq = 0 :: non_neg_integer(), @@ -190,11 +192,11 @@ register_session(US, SIPSocket, CallID, CSeq, Expires) -> cseq = CSeq, timestamp = now(), expires = Expires}]}, - gen_server:call(?MODULE, {write, Session}). + call({write, Session}). unregister_session(US, SIPSocket, CallID, CSeq) -> Msg = {delete, US, SIPSocket, CallID, CSeq}, - gen_server:call(?MODULE, Msg). + call(Msg). write_session(#sip_session{us = US, bindings = [#binding{socket = SIPSocket, @@ -289,9 +291,21 @@ pop_previous_binding(#sip_socket{peer = Peer}, Bindings) -> {error, notfound} end. +call(Msg) -> + case catch ?GEN_SERVER:call(?MODULE, Msg, ?CALL_TIMEOUT) of + {'EXIT', {timeout, _}} -> + {error, timeout}; + {'EXIT', Why} -> + {error, Why}; + Reply -> + Reply + end. + make_status(notfound) -> {404, esip:reason(404)}; make_status(cseq_out_of_order) -> {500, <<"CSeq is Out of Order">>}; +make_status(timeout) -> + {408, esip:reason(408)}; make_status(_) -> {500, esip:reason(500)}. -- cgit v1.2.3 From 8e2bc8d19ea279d661f3944a9a7f91af7d648a93 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 20:58:14 +0400 Subject: Check for 'max_user_sessions' option --- src/ejabberd_sm.erl | 1 + src/mod_sip_registrar.erl | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 58debf0c1..3ef21ade4 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -56,6 +56,7 @@ get_session_pid/3, get_user_info/3, get_user_ip/3, + get_max_user_sessions/2, is_existing_resource/3 ]). diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 386391327..602ef5bb3 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -198,7 +198,7 @@ unregister_session(US, SIPSocket, CallID, CSeq) -> Msg = {delete, US, SIPSocket, CallID, CSeq}, call(Msg). -write_session(#sip_session{us = US, +write_session(#sip_session{us = {U, S} = US, bindings = [#binding{socket = SIPSocket, call_id = CallID, expires = Expires, @@ -216,10 +216,15 @@ write_session(#sip_session{us = US, mnesia:dirty_write( #sip_session{us = US, bindings = NewBindings}); {error, notfound} -> - NewTRef = erlang:start_timer(Expires * 1000, self(), US), - NewBindings = [Binding#binding{tref = NewTRef}|Bindings], - mnesia:dirty_write( - #sip_session{us = US, bindings = NewBindings}) + MaxSessions = ejabberd_sm:get_max_user_sessions(U, S), + if length(Bindings) < MaxSessions -> + NewTRef = erlang:start_timer(Expires * 1000, self(), US), + NewBindings = [Binding#binding{tref = NewTRef}|Bindings], + mnesia:dirty_write( + #sip_session{us = US, bindings = NewBindings}); + true -> + {error, too_many_sessions} + end end; [] -> NewTRef = erlang:start_timer(Expires * 1000, self(), US), @@ -307,5 +312,7 @@ make_status(cseq_out_of_order) -> {500, <<"CSeq is Out of Order">>}; make_status(timeout) -> {408, esip:reason(408)}; +make_status(too_many_sessions) -> + {503, <<"Too Many Registered Sessions">>}; make_status(_) -> {500, esip:reason(500)}. -- cgit v1.2.3 From 1d771fe646f22bd9e62eecb1d88a75457e7f5bef Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 21:52:47 +0400 Subject: Rewrite 'Contact' headers in REGISTER requests --- src/mod_sip_registrar.erl | 62 ++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 602ef5bb3..6109826c9 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -67,23 +67,19 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> reason = Reason}) end; [{_, _URI, _Params}|_] = Contacts -> - ContactsWithExpires = - lists:map( - fun({Name, URI, Params}) -> - Exp = case to_integer( - esip:get_param( - <<"expires">>, Params), - 0, (1 bsl 32)-1) of - {ok, E} -> E; - _ -> Expires - end, - NewParams = esip:set_param( - <<"expires">>, - erlang:integer_to_binary(Exp), - Params), - {Exp, {Name, URI, NewParams}} - end, Contacts), - [{Expires1, _}|_] = lists:keysort(1, ContactsWithExpires), + ExpiresList = lists:map( + fun({_, _, Params}) -> + case to_integer( + esip:get_param( + <<"expires">>, Params), + 0, (1 bsl 32)-1) of + {ok, E} -> E; + _ -> Expires + end + end, Contacts), + Expires1 = lists:max(ExpiresList), + Contact = {<<"">>, #uri{user = LUser, host = LServer}, + [{<<"expires">>, erlang:integer_to_binary(Expires1)}]}, MinExpires = min_expires(), if Expires1 >= MinExpires -> case register_session(US, SIPSock, CallID, CSeq, Expires1) of @@ -94,8 +90,7 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> Req, #sip{type = response, status = 200, - hdrs = [{'contact', - [C || {_, C} <- ContactsWithExpires]}]}); + hdrs = [{'contact', [Contact]}]}); {error, Why} -> {Status, Reason} = make_status(Why), mod_sip:make_response( @@ -116,8 +111,7 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> mod_sip:make_response( Req, #sip{type = response, status = 200, - hdrs = [{'contact', - [C || {_, C} <- ContactsWithExpires]}]}); + hdrs = [{'contact', [Contact]}]}); {error, Why} -> {Status, Reason} = make_status(Why), mod_sip:make_response( @@ -127,7 +121,31 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> end end; [] -> - mod_sip:make_response(Req, #sip{type = response, status = 200}); + case mnesia:dirty_read(sip_session, US) of + [#sip_session{bindings = Bindings}] -> + case pop_previous_binding(SIPSock, Bindings) of + {ok, #binding{expires = Expires1}, _} -> + Contact = {<<"">>, + #uri{user = LUser, host = LServer}, + [{<<"expires">>, + erlang:integer_to_binary(Expires1)}]}, + mod_sip:make_response( + Req, #sip{type = response, status = 200, + hdrs = [{'contact', [Contact]}]}); + {error, notfound} -> + {Status, Reason} = make_status(notfound), + mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason}) + end; + [] -> + {Status, Reason} = make_status(notfound), + mod_sip:make_response( + Req, #sip{type = response, + status = Status, + reason = Reason}) + end; _ -> mod_sip:make_response(Req, #sip{type = response, status = 400}) end. -- cgit v1.2.3 From e7e4055cbbec3101cac1aceac9fd6d8930c0f960 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 21:58:11 +0400 Subject: Don't use erlang:integer_to_binary/1 --- src/mod_sip_registrar.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 6109826c9..9325a1330 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -79,7 +79,7 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> end, Contacts), Expires1 = lists:max(ExpiresList), Contact = {<<"">>, #uri{user = LUser, host = LServer}, - [{<<"expires">>, erlang:integer_to_binary(Expires1)}]}, + [{<<"expires">>, jlib:integer_to_binary(Expires1)}]}, MinExpires = min_expires(), if Expires1 >= MinExpires -> case register_session(US, SIPSock, CallID, CSeq, Expires1) of @@ -128,7 +128,7 @@ request(#sip{hdrs = Hdrs} = Req, SIPSock) -> Contact = {<<"">>, #uri{user = LUser, host = LServer}, [{<<"expires">>, - erlang:integer_to_binary(Expires1)}]}, + jlib:integer_to_binary(Expires1)}]}, mod_sip:make_response( Req, #sip{type = response, status = 200, hdrs = [{'contact', [Contact]}]}); -- cgit v1.2.3 From a1337cb73f1b365b8ebd84c02edc44ac82d750e9 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 23:35:36 +0400 Subject: Do not proxy stray responses statelessly (as per RFC 6026) --- src/mod_sip.erl | 50 ++------------------------------------------------ 1 file changed, 2 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/mod_sip.erl b/src/mod_sip.erl index 87608d18e..c018924fc 100644 --- a/src/mod_sip.erl +++ b/src/mod_sip.erl @@ -75,25 +75,8 @@ message_in(_, _) -> message_out(_, _) -> ok. -response(Resp, SIPSock) -> - case action(Resp, SIPSock) of - {relay, LServer} -> - case esip:split_hdrs('via', Resp#sip.hdrs) of - {[_], _} -> - ok; - {[_MyVia|Vias], TailHdrs} -> - %% TODO: check if MyVia is really my Via - NewResp = Resp#sip{hdrs = [{'via', Vias}|TailHdrs]}, - case esip:connect(NewResp, add_certfile(LServer, [])) of - {ok, SIPSockOut} -> - esip:send(SIPSockOut, NewResp); - {error, _} -> - ok - end - end; - _ -> - ok - end. +response(_Resp, _SIPSock) -> + ok. request(_Req, _SIPSock) -> error. @@ -151,35 +134,6 @@ locate(_SIPMsg) -> %%%=================================================================== %%% Internal functions %%%=================================================================== -action(#sip{type = response, hdrs = Hdrs}, _SIPSock) -> - {_, ToURI, _} = esip:get_hdr('to', Hdrs), - {_, FromURI, _} = esip:get_hdr('from', Hdrs), - case at_my_host(FromURI) of - true -> - case at_my_host(ToURI) of - true -> - case ToURI#uri.user of - <<"">> -> - to_me; - _ -> - {relay, jlib:nameprep(ToURI#uri.host)} - end; - false -> - {relay, jlib:nameprep(FromURI#uri.host)} - end; - false -> - case at_my_host(ToURI) of - true -> - case ToURI#uri.user of - <<"">> -> - to_me; - _ -> - {relay, jlib:nameprep(ToURI#uri.host)} - end; - false -> - pass - end - end; action(#sip{method = <<"REGISTER">>, type = request, hdrs = Hdrs, uri = #uri{user = <<"">>} = URI} = Req, SIPSock) -> case at_my_host(URI) of -- cgit v1.2.3 From 58aa20029784f2b4fa01a82b47f72793789acddb Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Thu, 1 May 2014 23:58:05 +0400 Subject: Optimize request processing --- src/mod_sip.erl | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mod_sip.erl b/src/mod_sip.erl index c018924fc..1572975e9 100644 --- a/src/mod_sip.erl +++ b/src/mod_sip.erl @@ -131,6 +131,20 @@ request(Req, SIPSock, TrID, Action) -> locate(_SIPMsg) -> ok. +find(#uri{user = User, host = Host}) -> + LUser = jlib:nodeprep(User), + LServer = jlib:nameprep(Host), + if LUser == <<"">> -> + to_me; + true -> + case mod_sip_registrar:find_sockets(LUser, LServer) of + [] -> + not_found; + [_|_] -> + {relay, LServer} + end + end. + %%%=================================================================== %%% Internal functions %%%=================================================================== @@ -177,13 +191,7 @@ action(#sip{method = Method, hdrs = Hdrs, type = request} = Req, SIPSock) -> true -> case at_my_host(ToURI) of true -> - case ToURI#uri.user of - <<"">> -> - to_me; - _ -> - LServer = jlib:nameprep(ToURI#uri.host), - {relay, LServer} - end; + find(ToURI); false -> LServer = jlib:nameprep(FromURI#uri.host), {relay, LServer} @@ -194,13 +202,7 @@ action(#sip{method = Method, hdrs = Hdrs, type = request} = Req, SIPSock) -> false -> case at_my_host(ToURI) of true -> - case ToURI#uri.user of - <<"">> -> - to_me; - _ -> - LServer = jlib:nameprep(ToURI#uri.host), - {relay, LServer} - end; + find(ToURI); false -> deny end -- cgit v1.2.3 From ab6774d93d44290814e367ae556ff07ac0dc0879 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 2 May 2014 00:42:09 +0400 Subject: Fix CSeq comparison --- src/mod_sip_registrar.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 9325a1330..57c55be08 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -225,7 +225,7 @@ write_session(#sip_session{us = {U, S} = US, [#sip_session{bindings = Bindings}] -> case pop_previous_binding(SIPSocket, Bindings) of {ok, #binding{call_id = CallID, cseq = PrevCSeq}, _} - when PrevCSeq >= CSeq -> + when PrevCSeq > CSeq -> {error, cseq_out_of_order}; {ok, #binding{tref = Tref}, Bindings1} -> erlang:cancel_timer(Tref), @@ -255,7 +255,7 @@ delete_session(US, SIPSocket, CallID, CSeq) -> [#sip_session{bindings = Bindings}] -> case pop_previous_binding(SIPSocket, Bindings) of {ok, #binding{call_id = CallID, cseq = PrevCSeq}, _} - when PrevCSeq >= CSeq -> + when PrevCSeq > CSeq -> {error, cseq_out_of_order}; {ok, #binding{tref = TRef}, []} -> erlang:cancel_timer(TRef), -- cgit v1.2.3 From 3c98de69dc0bd7c9647698d1d8c54a893ba9d515 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 2 May 2014 10:51:08 +0400 Subject: Some cleanup --- src/mod_sip.erl | 48 ++---------------------------------------------- src/mod_sip_proxy.erl | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/mod_sip.erl b/src/mod_sip.erl index 1572975e9..3a5249887 100644 --- a/src/mod_sip.erl +++ b/src/mod_sip.erl @@ -12,8 +12,7 @@ -behaviour(esip). %% API --export([start/2, stop/1, prepare_request/1, make_response/2, - add_via/3, at_my_host/1]). +-export([start/2, stop/1, prepare_request/1, make_response/2, at_my_host/1]). %% esip_callbacks -export([data_in/2, data_out/2, message_in/2, message_out/2, @@ -98,7 +97,7 @@ request(Req, SIPSock, TrID, Action) -> hdrs = [{'unsupported', Require}]}); {relay, LServer} -> - case mod_sip_proxy:start(LServer, add_certfile(LServer, [])) of + case mod_sip_proxy:start(LServer, []) of {ok, Pid} -> mod_sip_proxy:route(Req, SIPSock, TrID, Pid), {mod_sip_proxy, route, [Pid]}; @@ -279,46 +278,3 @@ at_my_host(#uri{host = Host}) -> is_my_host(LServer) -> gen_mod:is_loaded(LServer, ?MODULE). - -add_certfile(LServer, Opts) -> - case ejabberd_config:get_option({domain_certfile, LServer}, - fun iolist_to_binary/1) of - CertFile when is_binary(CertFile), CertFile /= <<"">> -> - [{certfile, CertFile}|Opts]; - _ -> - Opts - end. - -add_via(#sip_socket{type = Transport}, LServer, #sip{hdrs = Hdrs} = Req) -> - ConfiguredVias = get_configured_vias(LServer), - {ViaHost, ViaPort} = proplists:get_value( - Transport, ConfiguredVias, {LServer, undefined}), - ViaTransport = case Transport of - tls -> <<"TLS">>; - tcp -> <<"TCP">>; - udp -> <<"UDP">> - end, - Via = #via{transport = ViaTransport, - host = ViaHost, - port = ViaPort, - params = [{<<"branch">>, esip:make_branch()}, - {<<"rport">>, <<"">>}]}, - Req#sip{hdrs = [{'via', [Via]}|Hdrs]}. - -get_configured_vias(LServer) -> - gen_mod:get_module_opt( - LServer, ?MODULE, via, - fun(L) -> - lists:map( - fun(Opts) -> - Type = proplists:get_value(type, Opts), - Host = proplists:get_value(host, Opts), - Port = proplists:get_value(port, Opts), - true = (Type == tcp) or (Type == tls) or (Type == udp), - true = is_binary(Host) and (Host /= <<"">>), - true = (is_integer(Port) - and (Port > 0) and (Port < 65536)) - or (Port == undefined), - {Type, {Host, Port}} - end, L) - end, []). diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl index 211597256..4bcd6973e 100644 --- a/src/mod_sip_proxy.erl +++ b/src/mod_sip_proxy.erl @@ -49,14 +49,15 @@ route(SIPMsg, _SIPSock, TrID, Pid) -> %%% gen_fsm callbacks %%%=================================================================== init([Host, Opts]) -> - {ok, wait_for_request, #state{opts = Opts, host = Host}}. + Opts1 = add_certfile(Host, Opts), + {ok, wait_for_request, #state{opts = Opts1, host = Host}}. wait_for_request({#sip{type = request} = Req, TrID}, State) -> Opts = State#state.opts, Req1 = mod_sip:prepare_request(Req), case connect(Req1, Opts) of {ok, SIPSocket} -> - Req2 = mod_sip:add_via(SIPSocket, State#state.host, Req1), + Req2 = add_via(SIPSocket, State#state.host, Req1), case esip:request(SIPSocket, Req2, {?MODULE, route, [self()]}) of {ok, ClientTrID} -> {next_state, wait_for_response, @@ -162,3 +163,46 @@ connect(#sip{hdrs = Hdrs} = Req, Opts) -> false -> esip:connect(Req, Opts) end. + +add_certfile(LServer, Opts) -> + case ejabberd_config:get_option({domain_certfile, LServer}, + fun iolist_to_binary/1) of + CertFile when is_binary(CertFile), CertFile /= <<"">> -> + [{certfile, CertFile}|Opts]; + _ -> + Opts + end. + +add_via(#sip_socket{type = Transport}, LServer, #sip{hdrs = Hdrs} = Req) -> + ConfiguredVias = get_configured_vias(LServer), + {ViaHost, ViaPort} = proplists:get_value( + Transport, ConfiguredVias, {LServer, undefined}), + ViaTransport = case Transport of + tls -> <<"TLS">>; + tcp -> <<"TCP">>; + udp -> <<"UDP">> + end, + Via = #via{transport = ViaTransport, + host = ViaHost, + port = ViaPort, + params = [{<<"branch">>, esip:make_branch()}, + {<<"rport">>, <<"">>}]}, + Req#sip{hdrs = [{'via', [Via]}|Hdrs]}. + +get_configured_vias(LServer) -> + gen_mod:get_module_opt( + LServer, ?MODULE, via, + fun(L) -> + lists:map( + fun(Opts) -> + Type = proplists:get_value(type, Opts), + Host = proplists:get_value(host, Opts), + Port = proplists:get_value(port, Opts), + true = (Type == tcp) or (Type == tls) or (Type == udp), + true = is_binary(Host) and (Host /= <<"">>), + true = (is_integer(Port) + and (Port > 0) and (Port < 65536)) + or (Port == undefined), + {Type, {Host, Port}} + end, L) + end, []). -- cgit v1.2.3 From f8417f7c1fb2ad4288e5556e595b2fe1eeeef227 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 2 May 2014 13:09:25 +0400 Subject: Remove empty line --- src/mod_sip.erl | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mod_sip.erl b/src/mod_sip.erl index 3a5249887..8ed4ed8cf 100644 --- a/src/mod_sip.erl +++ b/src/mod_sip.erl @@ -212,7 +212,6 @@ action(#sip{method = Method, hdrs = Hdrs, type = request} = Req, SIPSock) -> check_auth(#sip{method = <<"CANCEL">>}, _, _SIPSock) -> true; check_auth(#sip{method = Method, hdrs = Hdrs, body = Body}, AuthHdr, _SIPSock) -> - Issuer = case AuthHdr of 'authorization' -> to; -- cgit v1.2.3 From ebd760b7c9f6044976d0ba947d930d017b09f113 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 2 May 2014 15:18:57 +0400 Subject: Forking support --- src/mod_sip_proxy.erl | 167 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 120 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl index 4bcd6973e..f6e7e0f3c 100644 --- a/src/mod_sip_proxy.erl +++ b/src/mod_sip_proxy.erl @@ -23,11 +23,12 @@ -include("logger.hrl"). -include("esip.hrl"). --record(state, {host = <<"">> :: binary(), - opts = [] :: [{certfile, binary()}], +-record(state, {host = <<"">> :: binary(), + opts = [] :: [{certfile, binary()}], orig_trid, - orig_req :: #sip{}, - client_trid}). + responses = [] :: [#sip{}], + tr_ids = [] :: list(), + orig_req :: #sip{}}). %%%=================================================================== %%% API @@ -56,21 +57,34 @@ wait_for_request({#sip{type = request} = Req, TrID}, State) -> Opts = State#state.opts, Req1 = mod_sip:prepare_request(Req), case connect(Req1, Opts) of - {ok, SIPSocket} -> - Req2 = add_via(SIPSocket, State#state.host, Req1), - case esip:request(SIPSocket, Req2, {?MODULE, route, [self()]}) of - {ok, ClientTrID} -> - {next_state, wait_for_response, - State#state{orig_trid = TrID, - orig_req = Req, - client_trid = ClientTrID}}; - Err -> + {ok, SIPSockets} -> + NewState = + lists:foldl( + fun(_SIPSocket, {error, _} = Err) -> + Err; + (SIPSocket, #state{tr_ids = TrIDs} = AccState) -> + Req2 = add_via(SIPSocket, State#state.host, Req1), + case esip:request(SIPSocket, Req2, + {?MODULE, route, [self()]}) of + {ok, ClientTrID} -> + NewTrIDs = [ClientTrID|TrIDs], + AccState#state{tr_ids = NewTrIDs}; + Err -> + cancel_pending_transactions(AccState), + Err + end + end, State, SIPSockets), + case NewState of + {error, _} = Err -> {Status, Reason} = esip:error_status(Err), esip:reply(TrID, mod_sip:make_response( Req, #sip{type = response, status = Status, reason = Reason})), - {stop, normal, State} + {stop, normal, State}; + _ -> + {next_state, wait_for_response, + NewState#state{orig_req = Req, orig_trid = TrID}} end; {error, notfound} -> esip:reply(TrID, mod_sip:make_response( @@ -90,41 +104,68 @@ wait_for_request(_Event, State) -> {next_state, wait_for_request, State}. wait_for_response({#sip{method = <<"CANCEL">>, type = request}, _TrID}, State) -> - esip:cancel(State#state.client_trid), + cancel_pending_transactions(State), {next_state, wait_for_response, State}; -wait_for_response({Resp, _TrID}, State) -> +wait_for_response({Resp, TrID}, + #state{orig_req = #sip{method = Method} = Req} = State) -> case Resp of - {error, _} -> - Req = State#state.orig_req, - {Status, Reason} = esip:error_status(Resp), - case Status of - 408 when Req#sip.method /= <<"INVITE">> -> - %% Absorb useless 408. See RFC4320 - esip:stop_transaction(State#state.orig_trid); - _ -> - ErrResp = mod_sip:make_response( - Req, - #sip{type = response, - status = Status, - reason = Reason}), - esip:reply(State#state.orig_trid, ErrResp) - end, - {stop, normal, State}; + {error, timeout} when Method /= <<"INVITE">> -> + %% Absorb useless 408. See RFC4320 + choose_best_response(State), + esip:stop_transaction(State#state.orig_trid), + {stop, normal, State}; + {error, _} -> + {Status, Reason} = esip:error_status(Resp), + State1 = mark_transaction_as_complete(TrID, State), + SIPResp = mod_sip:make_response(Req, + #sip{type = response, + status = Status, + reason = Reason}), + State2 = collect_response(SIPResp, State1), + case State2#state.tr_ids of + [] -> + choose_best_response(State2), + {stop, normal, State2}; + _ -> + {next_state, wait_for_response, State2} + end; #sip{status = 100} -> {next_state, wait_for_response, State}; #sip{status = Status} -> - case esip:split_hdrs('via', Resp#sip.hdrs) of - {[_], _} -> - {stop, normal, State}; - {[_|Vias], NewHdrs} -> - esip:reply(State#state.orig_trid, - Resp#sip{hdrs = [{'via', Vias}|NewHdrs]}), - if Status < 200 -> - {next_state, wait_for_response, State}; - true -> - {stop, normal, State} - end - end + {[_|Vias], NewHdrs} = esip:split_hdrs('via', Resp#sip.hdrs), + NewResp = case Vias of + [] -> + Resp#sip{hdrs = NewHdrs}; + _ -> + Resp#sip{hdrs = [{'via', Vias}|NewHdrs]} + end, + if Status < 300 -> + esip:reply(State#state.orig_trid, NewResp); + true -> + ok + end, + State1 = if Status >= 200 -> + mark_transaction_as_complete(TrID, State); + true -> + State + end, + State2 = if Status >= 300 -> + collect_response(NewResp, State1); + true -> + State1 + end, + if Status >= 600 -> + cancel_pending_transactions(State2); + true -> + ok + end, + case State2#state.tr_ids of + [] -> + choose_best_response(State2), + {stop, normal, State2}; + _ -> + {next_state, wait_for_response, State2} + end end; wait_for_response(_Event, State) -> {next_state, wait_for_response, State}. @@ -155,15 +196,23 @@ connect(#sip{hdrs = Hdrs} = Req, Opts) -> LUser = jlib:nodeprep(ToURI#uri.user), LServer = jlib:nameprep(ToURI#uri.host), case mod_sip_registrar:find_sockets(LUser, LServer) of - [SIPSock|_] -> - {ok, SIPSock}; + [_|_] = SIPSocks -> + {ok, SIPSocks}; [] -> {error, notfound} end; false -> - esip:connect(Req, Opts) + case esip:connect(Req, Opts) of + {ok, SIPSock} -> + {ok, [SIPSock]}; + {error, _} = Err -> + Err + end end. +cancel_pending_transactions(State) -> + lists:foreach(fun esip:cancel/1, State#state.tr_ids). + add_certfile(LServer, Opts) -> case ejabberd_config:get_option({domain_certfile, LServer}, fun iolist_to_binary/1) of @@ -206,3 +255,27 @@ get_configured_vias(LServer) -> {Type, {Host, Port}} end, L) end, []). + +mark_transaction_as_complete(TrID, State) -> + NewTrIDs = lists:delete(TrID, State#state.tr_ids), + State#state{tr_ids = NewTrIDs}. + +collect_response(Resp, #state{responses = Resps} = State) -> + State#state{responses = [Resp|Resps]}. + +choose_best_response(#state{responses = Responses} = State) -> + SortedResponses = lists:keysort(#sip.status, Responses), + case lists:filter( + fun(#sip{status = Status}) -> + Status >= 600 + end, SortedResponses) of + [Resp|_] -> + esip:reply(State#state.orig_trid, Resp); + [] -> + case SortedResponses of + [Resp|_] -> + esip:reply(State#state.orig_trid, Resp); + [] -> + ok + end + end. -- cgit v1.2.3 From 47a39ce7383b0bb7e4731add2e4ecfef9960aab4 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 2 May 2014 15:20:27 +0400 Subject: Remove unused function --- src/mod_sip_proxy.erl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl index f6e7e0f3c..cae75bff8 100644 --- a/src/mod_sip_proxy.erl +++ b/src/mod_sip_proxy.erl @@ -12,7 +12,7 @@ -behaviour(?GEN_FSM). %% API --export([start/2, start_link/2, route/4, route/5]). +-export([start/2, start_link/2, route/4]). %% gen_fsm callbacks -export([init/1, wait_for_request/2, wait_for_response/2, @@ -39,12 +39,8 @@ start(LServer, Opts) -> start_link(LServer, Opts) -> ?GEN_FSM:start_link(?MODULE, [LServer, Opts], []). -route(Resp, Req, _SIPSock, TrID, Pid) -> - ?GEN_FSM:send_event(Pid, {Resp, Req, TrID}). - route(SIPMsg, _SIPSock, TrID, Pid) -> - ?GEN_FSM:send_event(Pid, {SIPMsg, TrID}), - wait. + ?GEN_FSM:send_event(Pid, {SIPMsg, TrID}). %%%=================================================================== %%% gen_fsm callbacks -- cgit v1.2.3 From 955487391d6c1be6cf7bd3ae449ef11e3b277c3f Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sat, 3 May 2014 14:11:58 +0400 Subject: Assume tcp_init/2 and udp_init/2 now return new options --- src/ejabberd_listener.erl | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 71f744077..d3e594971 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -152,19 +152,19 @@ init_udp(PortIP, Module, Opts, SockOpts, Port, IPS) -> %% Inform my parent that this port was opened succesfully proc_lib:init_ack({ok, self()}), case erlang:function_exported(Module, udp_init, 2) of + false -> + udp_recv(Socket, Module, Opts); true -> case catch Module:udp_init(Socket, Opts) of {'EXIT', _} = Err -> ?ERROR_MSG("failed to process callback function " "~p:~s(~p, ~p): ~p", - [Module, udp_init, Socket, Opts, Err]); - _ -> - ok - end; - false -> - ok - end, - udp_recv(Socket, Module, Opts); + [Module, udp_init, Socket, Opts, Err]), + udp_recv(Socket, Module, Opts); + NewOpts -> + udp_recv(Socket, Module, NewOpts) + end + end; {error, Reason} -> socket_error(Reason, PortIP, Module, SockOpts, Port, IPS) end. @@ -174,20 +174,19 @@ init_tcp(PortIP, Module, Opts, SockOpts, Port, IPS) -> %% Inform my parent that this port was opened succesfully proc_lib:init_ack({ok, self()}), case erlang:function_exported(Module, tcp_init, 2) of + false -> + accept(ListenSocket, Module, Opts); true -> case catch Module:tcp_init(ListenSocket, Opts) of {'EXIT', _} = Err -> ?ERROR_MSG("failed to process callback function " "~p:~s(~p, ~p): ~p", - [Module, tcp_init, ListenSocket, Opts, Err]); - _ -> - ok - end; - false -> - ok - end, - %% And now start accepting connection attempts - accept(ListenSocket, Module, Opts). + [Module, tcp_init, ListenSocket, Opts, Err]), + accept(ListenSocket, Module, Opts); + NewOpts -> + accept(ListenSocket, Module, NewOpts) + end + end. listen_tcp(PortIP, Module, SockOpts, Port, IPS) -> case ets:lookup(listen_sockets, PortIP) of -- cgit v1.2.3 From d0ffcb7fd4f572b7c7b6fa0b72178d53ad2f774e Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sat, 3 May 2014 17:36:47 +0400 Subject: Assume udp_recv/5 now returns new options --- src/ejabberd_listener.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index d3e594971..844080a04 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -336,11 +336,11 @@ udp_recv(Socket, Module, Opts) -> ?ERROR_MSG("failed to process UDP packet:~n" "** Source: {~p, ~p}~n" "** Reason: ~p~n** Packet: ~p", - [Addr, Port, Reason, Packet]); - _ -> - ok - end, - udp_recv(Socket, Module, Opts); + [Addr, Port, Reason, Packet]), + udp_recv(Socket, Module, Opts); + NewOpts -> + udp_recv(Socket, Module, NewOpts) + end; {error, Reason} -> ?ERROR_MSG("unexpected UDP error: ~s", [format_error(Reason)]), throw({error, Reason}) -- cgit v1.2.3 From 806c0e56e1618c5f2882ef5dc3d80c74eeb87138 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sat, 3 May 2014 17:55:03 +0400 Subject: Do not crash on version downgrade --- src/ejabberd_router.erl | 1 + src/ejabberd_sm.erl | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index caf444fba..70a01ee4e 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -396,6 +396,7 @@ update_tables() -> [domain, node, pid] -> mnesia:delete_table(route); [domain, pid] -> mnesia:delete_table(route); [domain, pid, local_hint] -> ok; + [domain, pid, local_hint|_] -> mnesia:delete_table(route); {'EXIT', _} -> ok end, case lists:member(local_route, diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 3ef21ade4..2a06fd2f8 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -843,6 +843,7 @@ update_tables() -> [ur, user, node] -> mnesia:delete_table(session); [ur, user, pid] -> mnesia:delete_table(session); [usr, us, pid] -> mnesia:delete_table(session); + [usr, us, sid, priority, info] -> mnesia:delete_table(session); [sid, usr, us, priority] -> mnesia:delete_table(session); [sid, usr, us, priority, info] -> ok; -- cgit v1.2.3 From fafec77e56f0e94c2243a4a15b449438d907bbc7 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sun, 4 May 2014 23:11:05 +0400 Subject: Make it possible to get/set vCards for MUC rooms --- src/mod_muc_room.erl | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 461ab1da2..8126012cb 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -418,12 +418,13 @@ normal_state({route, From, <<"">>, StateData) -> case jlib:iq_query_info(Packet) of #iq{type = Type, xmlns = XMLNS, lang = Lang, - sub_el = SubEl} = + sub_el = #xmlel{name = SubElName} = SubEl} = IQ when (XMLNS == (?NS_MUC_ADMIN)) or (XMLNS == (?NS_MUC_OWNER)) or (XMLNS == (?NS_DISCO_INFO)) or (XMLNS == (?NS_DISCO_ITEMS)) + or (XMLNS == (?NS_VCARD)) or (XMLNS == (?NS_CAPTCHA)) -> Res1 = case XMLNS of ?NS_MUC_ADMIN -> @@ -434,6 +435,8 @@ normal_state({route, From, <<"">>, process_iq_disco_info(From, Type, Lang, StateData); ?NS_DISCO_ITEMS -> process_iq_disco_items(From, Type, Lang, StateData); + ?NS_VCARD -> + process_iq_vcard(From, Type, Lang, SubEl, StateData); ?NS_CAPTCHA -> process_iq_captcha(From, Type, Lang, SubEl, StateData) end, @@ -441,7 +444,7 @@ normal_state({route, From, <<"">>, {result, Res, SD} -> {IQ#iq{type = result, sub_el = - [#xmlel{name = <<"query">>, + [#xmlel{name = SubElName, attrs = [{<<"xmlns">>, XMLNS}], @@ -3894,6 +3897,10 @@ set_opts([{Opt, Val} | Opts], StateData) -> StateData#state{config = (StateData#state.config)#config{max_users = MaxUsers}}; + vcard -> + StateData#state{config = + (StateData#state.config)#config{vcard = + Val}}; affiliations -> StateData#state{affiliations = (?DICT):from_list(Val)}; subject -> StateData#state{subject = Val}; @@ -3926,6 +3933,7 @@ make_opts(StateData) -> ?MAKE_CONFIG_OPT(logging), ?MAKE_CONFIG_OPT(max_users), ?MAKE_CONFIG_OPT(allow_voice_requests), ?MAKE_CONFIG_OPT(voice_request_min_interval), + ?MAKE_CONFIG_OPT(vcard), {captcha_whitelist, (?SETS):to_list((StateData#state.config)#config.captcha_whitelist)}, {affiliations, @@ -3991,6 +3999,8 @@ process_iq_disco_info(_From, get, Lang, StateData) -> {<<"type">>, <<"text">>}, {<<"name">>, get_title(StateData)}], children = []}, + #xmlel{name = <<"feature">>, + attrs = [{<<"var">>, ?NS_VCARD}], children = []}, #xmlel{name = <<"feature">>, attrs = [{<<"var">>, ?NS_MUC}], children = []}, ?CONFIG_OPT_TO_FEATURE((Config#config.public), @@ -4064,6 +4074,26 @@ process_iq_captcha(_From, set, _Lang, SubEl, _ -> {error, ?ERR_NOT_ACCEPTABLE} end. +process_iq_vcard(_From, get, _Lang, _SubEl, StateData) -> + #state{config = #config{vcard = VCardRaw}} = StateData, + case xml_stream:parse_element(VCardRaw) of + #xmlel{children = VCardEls} -> + {result, VCardEls, StateData}; + {error, _} -> + {result, [], StateData} + end; +process_iq_vcard(From, set, Lang, SubEl, StateData) -> + case get_affiliation(From, StateData) of + owner -> + VCardRaw = xml:element_to_binary(SubEl), + Config = StateData#state.config, + NewConfig = Config#config{vcard = VCardRaw}, + change_config(NewConfig, StateData); + _ -> + ErrText = <<"Owner privileges required">>, + {error, ?ERRT_FORBIDDEN(Lang, ErrText)} + end. + get_title(StateData) -> case (StateData#state.config)#config.title of <<"">> -> StateData#state.room; -- cgit v1.2.3 From 70f00a1b1feafef6d7416fd536bc6fa26732743d Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 5 May 2014 13:13:35 +0200 Subject: extauth_cache can have value 0 --- src/ejabberd_auth_external.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl index 9ae6c9081..17944b650 100644 --- a/src/ejabberd_auth_external.erl +++ b/src/ejabberd_auth_external.erl @@ -173,7 +173,7 @@ get_cache_option(Host) -> case ejabberd_config:get_option( {extauth_cache, Host}, fun(false) -> undefined; - (I) when is_integer(I), I > 0 -> I + (I) when is_integer(I), I >= 0 -> I end) of undefined -> false; CacheTime -> {true, CacheTime} -- cgit v1.2.3 From 872cc12dd8b318f761667b3e878d54db79bbb46f Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 5 May 2014 13:50:52 +0200 Subject: Temporary room not destroyed when the last participant is expulsed (EJAB-520) --- src/mod_muc_room.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 8126012cb..3842fde40 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -245,7 +245,7 @@ normal_state({route, From, <<"">>, NewState = expulse_participant(Packet, From, StateData, translate:translate(Lang, ErrorText)), - {next_state, normal_state, NewState}; + close_room_if_temporary_and_empty(NewState); _ -> {next_state, normal_state, StateData} end; <<"chat">> -> @@ -1126,14 +1126,17 @@ process_presence(From, Nick, end; _ -> StateData end, + close_room_if_temporary_and_empty(StateData1). + +close_room_if_temporary_and_empty(StateData1) -> case not (StateData1#state.config)#config.persistent andalso (?DICT):to_list(StateData1#state.users) == [] of true -> ?INFO_MSG("Destroyed MUC room ~s because it's temporary " "and empty", - [jlib:jid_to_string(StateData#state.jid)]), - add_to_log(room_existence, destroyed, StateData), + [jlib:jid_to_string(StateData1#state.jid)]), + add_to_log(room_existence, destroyed, StateData1), {stop, normal, StateData1}; _ -> {next_state, normal_state, StateData1} end. -- cgit v1.2.3 From f3aa74a0431fa9b70a4c4188d4179d0c7e7c22e2 Mon Sep 17 00:00:00 2001 From: Nathan Bruning Date: Mon, 5 May 2014 14:14:03 +0200 Subject: Fix small bug in presence_based_delivery implementation --- src/mod_pubsub.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 87d49cb54..0b81265f8 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -4156,7 +4156,7 @@ presence_can_deliver({User, Server, Resource}, true) -> ({session, _, _ , _, undefined, _}, _Acc) -> false; ({session, _, {_, _, R}, _, _Priority, _}, _Acc) -> case Resource of - [] -> true; + <<>> -> true; R -> true; _ -> false end -- cgit v1.2.3 From 530ac437586a45b0d251547f03da9933e4d35888 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Mon, 5 May 2014 13:49:02 +0200 Subject: store item when persist_item=false and cache_last_item=false but need last_item --- src/mod_pubsub.erl | 5 +---- src/mod_pubsub_odbc.erl | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 0b81265f8..8cbd994e0 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -2952,10 +2952,7 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload, Access) -> PublishModel = get_option(Options, publish_model), DeliverPayloads = get_option(Options, deliver_payloads), PersistItems = get_option(Options, persist_items), - MaxItems = case PersistItems of - false -> 0; - true -> max_items(Host, Options) - end, + MaxItems = max_items(Host, Options), PayloadCount = payload_xmlelements(Payload), PayloadSize = byte_size(term_to_binary(Payload)) - 2, PayloadMaxSize = get_option(Options, max_payload_size), diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 00e619213..8236447d0 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -2618,9 +2618,9 @@ publish_item(Host, ServerHost, Node, Publisher, ItemId, Payload, Access) -> Features = features(Type), PublishFeature = lists:member(<<"publish">>, Features), PublishModel = get_option(Options, publish_model), - MaxItems = max_items(Host, Options), DeliverPayloads = get_option(Options, deliver_payloads), PersistItems = get_option(Options, persist_items), + MaxItems = max_items(Host, Options), PayloadCount = payload_xmlelements(Payload), PayloadSize = byte_size(term_to_binary(Payload)) - 2, PayloadMaxSize = get_option(Options, max_payload_size), -- cgit v1.2.3 From faa6ad26a0d1a0968b008642f64a3a5766f9a40e Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Mon, 5 May 2014 13:51:02 +0200 Subject: avoid sending empty events --- src/mod_pubsub.erl | 10 +++++++--- src/mod_pubsub_odbc.erl | 21 +++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 8cbd994e0..1d8bd143c 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -3356,6 +3356,8 @@ send_items(Host, Node, NodeId, Type, {U, S, R} = LJID, _ -> [] end, Stanza = case ToSend of + [] -> + undefined; [LastItem] -> {ModifNow, ModifUSR} = LastItem#pubsub_item.modification, @@ -3369,11 +3371,13 @@ send_items(Host, Node, NodeId, Type, {U, S, R} = LJID, attrs = nodeAttr(Node), children = itemsEls(ToSend)}]) end, - case is_tuple(Host) of - false -> + case {is_tuple(Host), Stanza} of + {_, undefined} -> + ok; + {false, _} -> ejabberd_router:route(service_jid(Host), jlib:make_jid(LJID), Stanza); - true -> + {true, _} -> case ejabberd_sm:get_session_pid(U, S, R) of C2SPid when is_pid(C2SPid) -> ejabberd_c2s:broadcast(C2SPid, diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 8236447d0..498c81bd3 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -3013,7 +3013,7 @@ send_items(Host, Node, NodeId, Type, LJID, last) -> ModifNow, ModifUSR) end, ejabberd_router:route(service_jid(Host), jlib:make_jid(LJID), Stanza); -send_items(Host, Node, NodeId, Type, LJID, Number) -> +send_items(Host, Node, NodeId, Type, {U, S, R} = LJID, Number) -> ToSend = case node_action(Host, Type, get_items, [NodeId, LJID]) of @@ -3026,6 +3026,8 @@ send_items(Host, Node, NodeId, Type, LJID, Number) -> _ -> [] end, Stanza = case ToSend of + [] -> + undefined; [LastItem] -> {ModifNow, ModifUSR} = LastItem#pubsub_item.modification, @@ -3039,7 +3041,22 @@ send_items(Host, Node, NodeId, Type, LJID, Number) -> attrs = nodeAttr(Node), children = itemsEls(ToSend)}]) end, - ejabberd_router:route(service_jid(Host), jlib:make_jid(LJID), Stanza). + case {is_tuple(Host), Stanza} of + {_, undefined} -> + ok; + {false, _} -> + ejabberd_router:route(service_jid(Host), + jlib:make_jid(LJID), Stanza); + {true, _} -> + case ejabberd_sm:get_session_pid(U, S, R) of + C2SPid when is_pid(C2SPid) -> + ejabberd_c2s:broadcast(C2SPid, + {pep_message, + <<((Node))/binary, "+notify">>}, + _Sender = service_jid(Host), Stanza); + _ -> ok + end + end. %% @spec (Host, JID, Plugins) -> {error, Reason} | {result, Response} %% Host = host() -- cgit v1.2.3 From 4bdf1bc7a6dc57d862883637aaca88f278c66c26 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Mon, 5 May 2014 17:35:38 +0200 Subject: avoid sending duplicated events --- src/mod_pubsub.erl | 31 +++++++++++++++---------------- src/mod_pubsub_odbc.erl | 31 +++++++++++++++---------------- 2 files changed, 30 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 1d8bd143c..d1d75de8f 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -827,7 +827,7 @@ send_loop(State) -> end; (_) -> ok end, - Subscriptions) + lists:usort(Subscriptions)) end, State#state.plugins), if not State#state.ignore_pep_from_offline -> @@ -1166,22 +1166,21 @@ disco_items(Host, Node, From) -> %% presence hooks handling functions %% -caps_update(#jid{luser = U, lserver = S, lresource = R} = From, To, _Features) -> - Pid = ejabberd_sm:get_session_pid(U, S, R), - presence_probe(From, To, Pid). - -presence_probe(#jid{luser = User, lserver = Server, lresource = Resource} = JID, - JID, Pid) -> - presence(Server, {presence, JID, Pid}), - presence(Server, {presence, User, Server, [Resource], JID}); -presence_probe(#jid{luser = User, lserver = Server}, - #jid{luser = User, lserver = Server}, _Pid) -> - %% ignore presence_probe from other ressources for the current user - %% this way, we do not send duplicated last items if user already connected with other clients +caps_update(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} = JID, _Features) + when Host =/= S -> + presence(Host, {presence, U, S, [R], JID}); +caps_update(From, To, _Feature) -> + ok. + +presence_probe(#jid{luser = U, lserver = S, lresource = R} = JID, JID, Pid) -> + presence(S, {presence, JID, Pid}), + presence(S, {presence, U, S, [R], JID}); +presence_probe(#jid{luser = U, lserver = S}, #jid{luser = U, lserver = S}, _Pid) -> + %% ignore presence_probe from my other ressources + %% to not get duplicated last items ok; -presence_probe(#jid{luser = User, lserver = Server, lresource = Resource}, - #jid{lserver = Host} = JID, _Pid) -> - presence(Host, {presence, User, Server, [Resource], JID}). +presence_probe(#jid{luser = U, lserver = S, lresource = R} = From, #jid{lserver = Host} = JID, _Pid) -> + presence(Host, {presence, U, S, [R], JID}). presence(ServerHost, Presence) -> SendLoop = case diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 498c81bd3..9e98e740d 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -475,7 +475,7 @@ send_loop(State) -> end; (_) -> ok end, - Subscriptions) + lists:usort(Subscriptions)) end, State#state.plugins), if not State#state.ignore_pep_from_offline -> @@ -817,22 +817,21 @@ disco_items(Host, Node, From) -> %% presence hooks handling functions %% -caps_update(#jid{luser = U, lserver = S, lresource = R} = From, To, _Features) -> - Pid = ejabberd_sm:get_session_pid(U, S, R), - presence_probe(From, To, Pid). - -presence_probe(#jid{luser = User, lserver = Server, lresource = Resource} = JID, - JID, Pid) -> - presence(Server, {presence, JID, Pid}), - presence(Server, {presence, User, Server, [Resource], JID}); -presence_probe(#jid{luser = User, lserver = Server}, - #jid{luser = User, lserver = Server}, _Pid) -> - %% ignore presence_probe from other ressources for the current user - %% this way, we do not send duplicated last items if user already connected with other clients +caps_update(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} = JID, _Features) + when Host =/= S -> + presence(Host, {presence, U, S, [R], JID}); +caps_update(From, To, _Feature) -> + ok. + +presence_probe(#jid{luser = U, lserver = S, lresource = R} = JID, JID, Pid) -> + presence(S, {presence, JID, Pid}), + presence(S, {presence, U, S, [R], JID}); +presence_probe(#jid{luser = U, lserver = S}, #jid{luser = U, lserver = S}, _Pid) -> + %% ignore presence_probe from my other ressources + %% to not get duplicated last items ok; -presence_probe(#jid{luser = User, lserver = Server, lresource = Resource}, - #jid{lserver = Host} = JID, _Pid) -> - presence(Host, {presence, User, Server, [Resource], JID}). +presence_probe(#jid{luser = U, lserver = S, lresource = R} = From, #jid{lserver = Host} = JID, _Pid) -> + presence(Host, {presence, U, S, [R], JID}). presence(ServerHost, Presence) -> SendLoop = case -- cgit v1.2.3 From a6244275b74365d2503b84e6f4754918cd6bf8f4 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Mon, 5 May 2014 18:16:48 +0200 Subject: remove compilation warnings --- src/mod_pubsub.erl | 6 +++--- src/mod_pubsub_odbc.erl | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index d1d75de8f..515f22790 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -1169,7 +1169,7 @@ disco_items(Host, Node, From) -> caps_update(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} = JID, _Features) when Host =/= S -> presence(Host, {presence, U, S, [R], JID}); -caps_update(From, To, _Feature) -> +caps_update(_From, _To, _Feature) -> ok. presence_probe(#jid{luser = U, lserver = S, lresource = R} = JID, JID, Pid) -> @@ -1179,7 +1179,7 @@ presence_probe(#jid{luser = U, lserver = S}, #jid{luser = U, lserver = S}, _Pid) %% ignore presence_probe from my other ressources %% to not get duplicated last items ok; -presence_probe(#jid{luser = U, lserver = S, lresource = R} = From, #jid{lserver = Host} = JID, _Pid) -> +presence_probe(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} = JID, _Pid) -> presence(Host, {presence, U, S, [R], JID}). presence(ServerHost, Presence) -> @@ -1620,7 +1620,7 @@ command_disco_info(_Host, ?NS_PUBSUB_GET_PENDING, node_disco_info(Host, Node, From) -> node_disco_info(Host, Node, From, true, true). -node_disco_info(Host, Node, From, Identity, Features) -> +node_disco_info(Host, Node, From, _Identity, _Features) -> % Action = % fun(#pubsub_node{type = Type, id = NodeId}) -> % I = case Identity of diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 9e98e740d..dad839fd3 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -820,7 +820,7 @@ disco_items(Host, Node, From) -> caps_update(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} = JID, _Features) when Host =/= S -> presence(Host, {presence, U, S, [R], JID}); -caps_update(From, To, _Feature) -> +caps_update(_From, _To, _Feature) -> ok. presence_probe(#jid{luser = U, lserver = S, lresource = R} = JID, JID, Pid) -> @@ -830,7 +830,7 @@ presence_probe(#jid{luser = U, lserver = S}, #jid{luser = U, lserver = S}, _Pid) %% ignore presence_probe from my other ressources %% to not get duplicated last items ok; -presence_probe(#jid{luser = U, lserver = S, lresource = R} = From, #jid{lserver = Host} = JID, _Pid) -> +presence_probe(#jid{luser = U, lserver = S, lresource = R}, #jid{lserver = Host} = JID, _Pid) -> presence(Host, {presence, U, S, [R], JID}). presence(ServerHost, Presence) -> @@ -1272,7 +1272,7 @@ command_disco_info(_Host, ?NS_PUBSUB_GET_PENDING, node_disco_info(Host, Node, From) -> node_disco_info(Host, Node, From, true, true). -node_disco_info(Host, Node, From, Identity, Features) -> +node_disco_info(Host, Node, From, _Identity, _Features) -> % Action = % fun(#pubsub_node{type = Type, id = NodeId}) -> % I = case Identity of @@ -3251,8 +3251,7 @@ set_affiliations(Host, Node, From, EntitiesEls) -> error -> {error, ?ERR_BAD_REQUEST}; _ -> Action = fun (#pubsub_node{type = Type, - id = NodeId} = - N) -> + id = NodeId}) -> Owners = node_owners_call(Type, NodeId), case lists:member(Owner, Owners) of true -> -- cgit v1.2.3 From 58717923eb6d211cd5de96c5c59b0625eb5c6c3b Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 6 May 2014 12:37:44 +0200 Subject: Fix PEP broadcasting issue (EJAB-1680) --- src/mod_pubsub.erl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 515f22790..168169a95 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -4442,15 +4442,7 @@ broadcast_stanza(Host, _Node, _NodeId, _Type, NodeOptions, SubsByDepth, NotifyTy broadcast_stanza({LUser, LServer, LResource}, Publisher, Node, NodeId, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM) -> broadcast_stanza({LUser, LServer, LResource}, Node, NodeId, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM), %% Handles implicit presence subscriptions - SenderResource = case LResource of - [] -> - case user_resources(LUser, LServer) of - [Resource|_] -> Resource; - _ -> <<>> - end; - _ -> - LResource - end, + SenderResource = user_resource(LUser, LServer, LResource), case ejabberd_sm:get_session_pid(LUser, LServer, SenderResource) of C2SPid when is_pid(C2SPid) -> Stanza = case get_option(NodeOptions, notification_type, headline) of @@ -4461,8 +4453,8 @@ broadcast_stanza({LUser, LServer, LResource}, Publisher, Node, NodeId, Type, Nod %% Also, add "replyto" if entity has presence subscription to the account owner %% See XEP-0163 1.1 section 4.3.1 ejabberd_c2s:broadcast(C2SPid, - {pep_message, binary_to_list(Node)++"+notify"}, - _Sender = jlib:make_jid(LUser, LServer, ""), + {pep_message, <<((Node))/binary, "+notify">>}, + _Sender = jlib:make_jid(LUser, LServer, <<"">>), _StanzaToSend = add_extended_headers(Stanza, _ReplyTo = extended_headers([jlib:jid_to_string(Publisher)]))); _ -> @@ -4527,6 +4519,13 @@ subscribed_nodes_by_jid(NotifyType, SubsByDepth) -> user_resources(User, Server) -> ejabberd_sm:get_user_resources(User, Server). +user_resource(User, Server, <<>>) -> + case user_resources(User, Server) of + [R | _] -> R; + _ -> <<>> + end; +user_resource(_, _, Resource) -> Resource. + %%%%%%% Configuration handling %%

There are several reasons why the default node configuration options request might fail:

-- cgit v1.2.3 From cc1f93d7a0f261841ee937f1084fea92fdb2d185 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 6 May 2014 13:29:35 +0200 Subject: Fix PEP broadcasting issue on ODBC (EJAB-1680) --- src/mod_pubsub_odbc.erl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index dad839fd3..45c30a11b 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -4077,15 +4077,7 @@ broadcast_stanza(Host, _Node, _NodeId, _Type, NodeOptions, SubsByDepth, NotifyTy broadcast_stanza({LUser, LServer, LResource}, Publisher, Node, NodeId, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM) -> broadcast_stanza({LUser, LServer, LResource}, Node, NodeId, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM), %% Handles implicit presence subscriptions - SenderResource = case LResource of - [] -> - case user_resources(LUser, LServer) of - [Resource|_] -> Resource; - _ -> <<>> - end; - _ -> - LResource - end, + SenderResource = user_resource(LUser, LServer, LResource), case ejabberd_sm:get_session_pid(LUser, LServer, SenderResource) of C2SPid when is_pid(C2SPid) -> Stanza = case get_option(NodeOptions, notification_type, headline) of @@ -4096,8 +4088,8 @@ broadcast_stanza({LUser, LServer, LResource}, Publisher, Node, NodeId, Type, Nod %% Also, add "replyto" if entity has presence subscription to the account owner %% See XEP-0163 1.1 section 4.3.1 ejabberd_c2s:broadcast(C2SPid, - {pep_message, binary_to_list(Node)++"+notify"}, - _Sender = jlib:make_jid(LUser, LServer, ""), + {pep_message, <<((Node))/binary, "+notify">>}, + _Sender = jlib:make_jid(LUser, LServer, <<"">>), _StanzaToSend = add_extended_headers(Stanza, _ReplyTo = extended_headers([jlib:jid_to_string(Publisher)]))); _ -> @@ -4162,6 +4154,13 @@ subscribed_nodes_by_jid(NotifyType, SubsByDepth) -> user_resources(User, Server) -> ejabberd_sm:get_user_resources(User, Server). +user_resource(User, Server, <<>>) -> + case user_resources(User, Server) of + [R | _] -> R; + _ -> <<>> + end; +user_resource(_, _, Resource) -> Resource. + %%%%%%% Configuration handling %%

There are several reasons why the default node configuration options request might fail:

-- cgit v1.2.3