Giter Club home page Giter Club logo

jabberd2's Introduction

jabberd2

Jabber Open Source Server (2.x)

Build Status Coverity Scan Build Status Join the chat at Gitter Flattr this

Thanks for downloading jabberd2. Below are some basic instructions to get you started. Complete documentation is available at http://jabberd2.org/

-- the jabberd team

Required packages:

Optional packages:

Build:

% ./configure
% make
% make install

Options to ./configure:

% ./configure --help
[...]

Configure:

Edit $prefix/etc/(router|sm|c2s|s2s).xml to taste. In particular, make sure you setup for your choice of data storage correctly. If you're using the Berkeley DB backend, you'll need to create /var/run/jabberd and sets its permissions so that the server processes can find it.

If you're using a SQL backend, you'll need to create an account for the server to use, and create the tables. Load db-setup.mysql or db-setup.pgsql from the tools/ directory into your database to do this.

If you plan to use the jabberd wrapper script, make sure you look at the paths in the $prefix/etc/jabber/jabberd.cfg.

Run:

You can either run all of the pieces separately:

% $prefix/bin/router &
% $prefix/bin/s2s &
% $prefix/bin/sm &
% $prefix/bin/c2s &

Or you can run them all from the jabberd wrapper script:

% $prefix/jabberd &

All the processes can take the following switches:

-c use an alternate config file
-D output lots of debugging info (if compiled with --enable-debug)

Upgrade:

Please see NEWS file.

Support:

When requesting assistance, please note that the following things can provide useful information which may assist with finding your problem:

  • debug logs (compile with --enable-debug and run with -D)
  • running components seperately (ie without the wrapper script)
  • config.log

Please try to provide as much relevant information as possible when reporting problems - it will make helping you much easier.

Copyright & License:

jabberd - Jabber Open Source Server
Copyright (c) 2002-2012 Jeremie Miller, Thomas Muldowney,
                        Ryan Eatmon, Robert Norris, Tomasz Sterna.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA

As a special exception, the authors give permission to link this
program with the OpenSSL library and distribute the resulting binary.

subst/snprintf.c and util/base64.c were originally taken from the Apache web server project. Originally copyright (c) 1995-2003 Apache Software Foundation.

util/md5.c was taken from Ghostscript. Originally copyright (c) 1999-2002 Aladdin Enterprises.

util/sha1.c was taken from Mozilla. Originally copyright (c) 1995-1999 Cryptography Research, Inc.

subst/getopt.[ch] was taken from GNU Libc. Originally copyright (c) 1987-1993 Free Software Foundation, Inc.

subst/gettimeofday.c was taken from PostgreSQL. Originally copyright (c) 2003 SRA, Inc. & SKC, Inc.

subst/syslog.[ch] was taken from Bind. Originally copyright (c) 2001 Internet Software Consortium.

subst/inet_aton.c Originally copyright (c) 1995-1997 Kungliga Teniska Hogskolan

subst/ip6_misc.h Originally copyright (c) 1993,1994,1997 The Regents of the University of California.

subst/dirent.[ch] Originally copyright (c) 1997,2003 Kevlin Henney.

jabberd2's People

Contributors

adrianreber avatar alteholz avatar crosser avatar dab18 avatar dreamsxin avatar eagafonov avatar ericliang avatar fanyunfeng avatar gitter-badger avatar jaredmauch avatar jas4711 avatar lifeofguenter avatar manuelm avatar mid1221213 avatar mlandres avatar moio avatar monsterkane avatar nanoant avatar omula avatar osalvadorvilardaga avatar ramo-j avatar sdebnath avatar smokku avatar speachy avatar wvdakker avatar ymrdtnju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jabberd2's Issues

Bogus values for last-login and last-logout being generated

Postgresql 9.2.5, jabberd 2.3.1, x86_64. This happens when trying to upgrade a working 2.2.17 installation:

(jabberd2 log)

Dec 2 13:53:27 stuffed jabberd/sm[16886]: pgsql: sql insert failed: ERROR: val
ue "140116104107814" is out of range for type integer

(Database log)

ERROR: value "140116104107814" is out of range for type integer at character 191
STATEMENT: INSERT INTO "status" ( "collection-owner", "object-sequence", "status", "show", "last-login", "xml", "last-logout" ) VALUES ( '[email protected]', nextval('object-sequence'), 'online', '', '140116104107814', 'NAD<route xmlns=''http://jabberd.jabberstudio.org/ns/component/1.0''><presence xmlns=''jabber:client'' xmlns:sm=''http://jabberd.jabberstudio.org/ns/session/1.0'' type=''unavailable''/>', '1' );

Both '140116104107814' and '140116104107539' are completely bogus values. In comparison, the values stored in the database for that user are ' 1386008295' and '1386010131', respectively.

I'm downgrading back to 2.2.17 now.

s2s does not rate limit outgoing connections

On my jabber server I observed bots that came in via c2s to cause well over 10,000 outgoing s2s attempts per minute to a single nearby jabber server that was refusing connections at the time. At three log lines per attempt, this caused massive log file bloat.

Similarly, attempts to establish connections to a more distant server that immediately ended in a stream error repeated at rates up to about 2500 per minute.

I think the number of outgoing connections attempts per remote server should be rate limited like it is the case for connections from other services to the router.

can not provide alternative openssl path

Hi,

even with:

# export CPPFLAGS="-I/opt/libressl/include"
# export LDFLAGS="-L/opt/libressl/lib"
# ./configure \
--prefix=/usr \
--sysconfdir=/etc/jabberd2 \
--enable-ssl \
--enable-mysql \
--enable-mio=epoll \
--with-extra-include-path=/opt/libressl/include \
--with-extra-library-path=/opt/libressl/lib

It will always search first in the default path (/usr/lib + /usr/include) and therefor ignore my given path.

NEWS file out of date, refers to nonexistent URL

The NEWS file is out of date, the last entry being from 2005. It reads:

2005-03-31 jabberd 2.0s7
    * I have been using ChangeLog to record this info - justin
    * See the wiki at http://j2.openaether.org/mediawiki for real news

But that URL doesn't work either (the hostname does not resolve).

maximum allowed optimization level is -O2

Configuring jabberd 2.2.17 with -Os in CFLAGS fails with:

checking CFLAGS optimization level... configure: error: maximum allowed optimization level is -O2

Why?

This was check was added to the configure script in 618c204 6 years ago. Is it really still a problem today?

The commit message says it fixed "#100" but there are not that many issues in this issue tracker so I presume it refers to an older issue tracker.

FreeBSD removes this check and I am considering doing so for MacPorts as well, since MacPorts 2.2's default optimization flags are -Os.

Asterisk 1.8.* jabber client res_jabber.so can't authenticate

Asterisk jabber.conf: usetls=yes, usesasl=yes.
Jabberd 2.2.17 with sqlite and ldap backend.

Asterisk log:

JABBER: asterisk INCOMING: .... mpp-streams'>stanza sent before session start</text></stream:error>

Workaround:

--- jabberd-2.2.14/c2s/c2s.c.original   2013-09-03 14:00:41.000000000 +0400
+++ jabberd-2.2.14/c2s/c2s.c    2013-09-03 13:52:57.000000000 +0400
@@ -474,6 +474,7 @@
             else {
                 log_write(sess->c2s->log, LOG_NOTICE, "[%d] SASL authentication succeeded: mechanism=%s; authzid=%s%s%s", sess->s->tag, &sess->s->auth_method[5], sess->s->auth_id, sess->s->ssf ? ", TLS negotiated" : "", sess->s->compressed ? ", ZLIB compression enabled" : "");
                 sess->sasl_authd = 1;
+                sess->active = 1;
             }

             break;

File transfers

Sorry, I'm not that familiar with internals, and I can't find any information on that.

Do jabberd2 provides file transfers out of a box? If it's so, is there any documentation how it should be configured?

If it doesn't, are there any known working "pugins" that bring that functionality?

Thanks!

Invalid INTEGER values are saved to database storages in x86_64

In 64-bit architectures (seen with x86_64), where sizeof(void _) is larger than sizeof(int), the recovery of os_type_BOOLEAN and os_type_INTEGER types through os_object_iter_get() assign sizeof(int) bytes pointed to by the parameter void *_val. However, since the pointed to variable is sizeof(void *), this results in the high bytes of the variable not being set and therefore left with garbage values. In the database storage drivers, the values are then inspected as a void * cast to long int, or plain long, which access the bogus upper bytes of the value. The final effect is that the database driver randomly stores a very large integer value to the database (if saving an os_type_INTEGER), or else end up storing a TRUE value when the higher code meant a FALSE value (if saving an os_type_BOOLEAN).

Issue #48 is an instance of this bug, but the fix was committed only for the postgresql driver, and only for the os_type_INTEGER type. The mysql and sqlite drivers are still affected, as well as os_type_BOOLEAN for postgresql.

jabberd2 do not accept RosterPush reply, which is defined by RFC 6121.

Here is my protocol log, There is an error for feature not implemented. It seems that I do not reply the previous iq: . What stanza that I've to reply to stop the server's complain? Which RFC defines the feature required by server?

The full log is here:
190208: testClient([email protected]/testim.5027) on example.com:5222
190208: Connecting to example.com:5222...
190208: connected.
190208: Send(testClient): <iq xmlns="jabber:client" type="get" id="example.0"><query xmlns="jabber:iq:roster" /></iq>
190208: Send(testClient): <presence xmlns="jabber:client" id="example.1" />
190208: Recv(testClient): <iq xmlns="jabber:client" type="result" id="example.0"><query xmlns="jabber:iq:roster"><item jid="[email protected]" subscription="from" /></query></iq>
190221: Send(testClient): <iq xmlns="jabber:client" type="set" id="example.2"><query xmlns="jabber:iq:roster"><item jid="[email protected]" /></query></iq>
190221: Recv(testClient): <iq xmlns="jabber:client" to="[email protected]/testim.5027" type="set" id="wygwyuoi"><query xmlns="jabber:iq:roster"><item jid="[email protected]" subscription="none" /></query></iq>
190221: Send(testClient): <iq xmlns="jabber:client" type="result" id="wygwyuoi" />
190221: Recv(testClient): <iq xmlns="jabber:client" type="result" id="example.2" />
190221: Recv(testClient): <iq xmlns="jabber:client" to="[email protected]/testim.5027" from="[email protected]/testim.5027" id="wygwyuoi" type="result" />
190221: Recv(testClient): <iq xmlns="jabber:client" type="error" from="[email protected]/testim.5027" id="wygwyuoi" to="[email protected]/testim.5027"><query xmlns="jabber:iq:roster"><item jid="[email protected]" subscription="none" /></query><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">The feature requested is not implemented by the recipient or server and therefore cannot be processed.</text></error></iq>
190633: Send(testClient): <presence xmlns="jabber:client" type="unavailable" id="example.3" />

OBS build warnings

when I build this on the openSUSE Build Service, I get these reports
from the automagic that checks for serious compiler warnings at the
end of the build:

I: A function uses a 'return;' statement, but has actually a value
to return, like an integer ('return 42;') or similar.
W: jabberd voidreturn out.c:635

I: Statement might be overflowing a buffer in strncat. Common mistake:
BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the
left over size as 3rd argument
GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
E: jabberd bufferoverflowstrncat main.c:776:24

I: Program returns random data in a function
E: jabberd no-return-in-nonvoid-function log.c:258

I: Program returns random data in a function
E: jabberd no-return-in-nonvoid-function log.c:258

jabberd/c2s[5422]: [8] [192.168.1.39, port=2817] error: XML parse error (syntax error)

Hi, I have installed jabberd on my centos amchine and started the service.

/etc/init.d/jabberd status

router (pid 5408) is running...
sm (pid 5415) is running...
c2s (pid 5422) is running...
s2s (pid 5429) is running...

And when i try to access this using the IP, http://192.168.1.254:5222/
I am getting the following XML parse error.

<stream:stream xmlns:stream='http://etherx.jabber.org/streams' version='1.0'><stream:error xmlns:stream='http://etherx.jabber.org/streams'>syntax error/stream:error/stream:stream

And in the log it shows, Sep 12 18:32:05 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2815] error: XML parse error (syntax error)
Sep 12 18:32:05 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2815] disconnect jid=unbound, packets: 0
Sep 12 18:32:06 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2816] connect
Sep 12 18:32:06 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2816] error: XML parse error (syntax error)
Sep 12 18:32:06 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2816] disconnect jid=unbound, packets: 0
Sep 12 18:32:06 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2817] connect
Sep 12 18:32:06 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2817] error: XML parse error (syntax error)
Sep 12 18:32:06 station254 jabberd/c2s[5422]: [8] [192.168.1.39, port=2817] disconnect jid=unbound, packets: 0

Any idea what needs to be done on this ?

Thanks.

Can't connect to jabberd2 using Trillian

When trying to connect to jabberd2 using Trillian I get the message: "The Jabber password you entered is incorrect. Please try again."

The password works fine using Pidgin. Using the debug switch to jabberd script I see an error that says no password was supplied.

Trillian 5.4.15
Jabberd2 2.3.2

s2s cannot connect to ipv6 servers, "Address family not supported by protocol"

On the kernels newer than about 3.0, connecting to other hosts that have ipv6 address does not work. This is because the server tries to bind a socket to "source IP" which is at least in my case ipv4, but the socket was created in the address family of the destination IP address. New Linux kernels forbid this.

See also my comment on a commit in mio/mio_impl.h

service doesn't autostart

Every single time my server reboots I have to login and do

sudo service jabberd2 start

All the other services that I installed register themselves properly to autostart with the system, except for jabberd2. I just installed it via apt-get, and made the proper configuration. How can I make it autostart? It'll be the last obstacle until it's running absolutely smooth.

I did notice there's a jabberd2 script in /etc/init.d but I don't know how to make that into an autostart thing, since I've never had to do such a thing (and IMO shouldn't be neccesary).

So, bug? Or should autostart just work and have I missed something?...

Running Ubuntu 14.04 LTS, jabberd2 2.2.17 (latest from apt-get as of the time of writing).

pgsql (and potentially others) incorrectly set os_type_BOOLEAN

Ran into this issue when setting boolean values via object_set. In the driver for pgsql, in _guts(), after a boolean value is retrieved from os_object_iter_get() and the value is os_type_BOOLEAN, the val variable is incorrectly interpreted and results in true being set even if false was desired. The problem here is that val is defined as "int *val" and at least in Mac OS X with LLVM compiler, looks like the compiler is checking if the val pointer is set with any value rather than the pointer itself is "0" or "1". Sure trickery is being used so that int and booleans can be handled the same way but looks like this is troublesome for new compilers. The change below got it to work properly.

-                            cval = val ? strdup("t") : strdup("f");
+                            cval = ((int)val == 1) ? strdup("t") : strdup("f");

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

$ uname -a
Darwin CORSAIR.local 14.0.0 Darwin Kernel Version 14.0.0: Tue Sep 23 23:01:41 PDT 2014; root:xnu-2782.1.97~6/RELEASE_X86_64 x86_64

If approved, I can make the changes to postgresql and others.

Schema cleanup

The DB schema for jabberd2 is badly in need of cleanup.

MySQL is the most common real DB engine (i.e. not sqlite) that jabberd2 users are likely to use as a back-end for jabberd2. There are 15 tables in jabberd2's DB schema; 8 of those 15 tables have names that are illegal in MySQL (because they contain hyphens) and so must always be quoted wherever they are used. The status table (for example) has seven columns, of which five are illegally named (four contain hyphens, one is a reserved word). This is sloppy practice and should be cleaned up.

send messages to all resources

It seems a common request to be able to configure jabberd2 to be able to send messages to all resources. This gets more and more common a request and the ubiquity of devices increases.

This would be a good feature to have I think.

[NFR]Whether can be set custom database fields and the vcard attribute mapping

In the configuration file configuration, can cover the preset value _iq_vcard_map in file mod_iq_vcard.c

mod_iq_vcard.c

static const char *_iq_vcard_map[] = {
    "FN",           "fn",
    "N/FAMILY",     "n-family",
    "N/GIVEN",      "n-given",
    "N/MIDDLE",     "n-middle",
    "N/PREFIX",     "n-prefix",
    "N/SUFFIX",     "n-suffix",
    NULL,           NULL
};

sm.xml

<sm>
    <storage>
        <field>
            <fn>fn</fn>
        </field>
    <storage>
<sm>

Unable to run jabberd2 with mysql module on Ubuntu 14.04.1 LTS

Recently I've upgraded to Ubuntu 14.04 from 12.x, and jabberd2 stopped working for me. My configuration relies on data kept in MySQL tables. All I see in sm.log is:

Wed Aug 27 09:22:02 2014 [info] loading 'mysql' storage module
Wed Aug 27 09:22:02 2014 [notice] initialisation of storage driver 'mysql' failed
Wed Aug 27 09:22:02 2014 [error] failed to initialise one or more storage drivers, aborting

MySQL server is working totally fine, and is fully accessible for other services (PHP, Exim etc).

I have no clue how to further debug this issue (?)

If it's not proper place for such questions, please guide me where should I go with it. Thanks!

storage_ldapvcard.c problem in shared roster group

in
storage/storage_ldapvcard.c

on 437^

            if (data->groupattr_regex != NULL && processregex(vals[0],data->groupattr_regex,2,1,group,sizeof(group),drv) !=0) {
                strncpy(group,vals[0],sizeof(group)-1);
            }
            group[sizeof(group)-1]='\0';
            ldap_value_free(vals);

in sm/mod_roster_publish.c on 573:

os_object_get_str(os, o, "group", &str)

ALWAYS returned ''(empty) if groupattr_regex in sm.xml not set (in my case - I use groupattr only )

sm crashes on HUP signal (CentOS)

If HUP signal is sent to sm, sm crashes on same place every time.
It can only be replicated on CentOS (as far as I know).
It is not possible to replicate this problem on Gentoo, for instance.

Usually, one sends HUP signal from logrotate script to rotate the sm log file.

Coredump:

#0  0x00685b2c in __strncmp_sse4_2 () from /lib/libc.so.6
#1  0x08065357 in _xhash_node_get (h=<value optimized out>, key=0xc2dcc6 "urn:xmpp:blocking", len=17, index=241413863) at xhash.c:90
#2  0x080654f6 in xhash_getx (h=0x8d222a0, key=0xc2dcc6 "urn:xmpp:blocking", len=17) at xhash.c:174
#3  0x08065554 in xhash_get (h=0x8d222a0, key=0xc2dcc6 "urn:xmpp:blocking") at xhash.c:187
#4  0x08052f91 in sm_register_ns (sm=0x8d07018, uri=0xc2dcc6 "urn:xmpp:blocking") at sm.c:332
#5  0x00c2a3f3 in module_init (mi=0x8d4c170, arg=0x14 <Address 0x14 out of bounds>) at mod_privacy.c:1337
#6  0x0804fd6c in mm_new (sm=0x8d07018) at mm.c:230
#7  0x0804ef54 in _sm_signal_hup (signum=1) at main.c:61
#8  <signal handler called>
#9  0x00173424 in __kernel_vsyscall ()
#10 0x0063be88 in __epoll_wait_nocancel () from /lib/libc.so.6
#11 0x0805b7a2 in _mio_poll (m=0x8d37938, timeout=5) at mio_impl.h:91
#12 _mio_run (m=0x8d37938, timeout=5) at mio_impl.h:225
#13 0x0804e8fb in main (argc=3, argv=0xbf800284) at main.c:400

This affects clean installation of jabberd2, no special configuration, just configure, make, make install (master branch).

Possible solution to this crash is here:
https://gist.github.com/sergej/6959996

jabberd services stops

Hi,

jabberd services stops frequently

[root@mail ~]# /etc/init.d/jabberd status
router dead but subsys locked
sm dead but subsys locked
c2s dead but subsys locked
s2s dead but subsys locked

I have done strace for router pid and found below logs

epoll_ctl(4, EPOLL_CTL_MOD, 8, {EPOLLIN, {u32=31752800, u64=31752800}}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 2883 detached

Kindly give us solution to fix this ...unable to trace the reason why services are getting stopped .

xml syntax error

Hi,
I have done a clean installation of jabberd2 on ubuntu.

Now, when opening the url:5222 I get an error in the logfile.

"jabberd/c2s[1153]: [7] [192.168.110.165, port=53631] error: XML parse error (syntax error)"

Yes, message is clear.

I expect it to be in the file "c2s.xml".

Since the file is large, is there any tool to check the syntax with to get some more information where the syntax error could be?

The website shows:

<stream:stream xmlns:stream='http://etherx.jabber.org/streams' version='1.0'><stream:error xmlns:stream='http://etherx.jabber.org/streams'><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xmlns='urn:ietf:params:xml:ns:xmpp-streams'>syntax error</text></stream:error></stream:stream>

Regards
Karl-Heinz

User still present when network lost

When UserA is friend of UserB, after both get connected to server and check there existent, UserA disable its network connection (without closing the client,or closing the connection) .UserB still see the UserA as it alive.
Dose server use ping timeout,to check if the user can't pinged and remove it from the alive users?
I'm using pidgin as client, and checked this scenario using virtual-machine .

Use Pidgin login:SSL Handshake Failed

C2S : sx (chain.c:93) calling io read chain
C2S : sx (ssl.c:511) in _sx_ssl_rio
C2S : sx (ssl.c:515) loading 99 bytes into ssl read buffer
C2S : sx (ssl.c:336) secure channel not established, handshake in progress
C2S : sx (ssl.c:375) openssl error: error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number

sm segfaults router if the domain name consists of four parts.

My domain name consists of 4 parts like xxx.yyy.zzz.ru. When I run router and after sm, router gets a segfault:
[25302.497901] router[8805]: segfault at f ip 00007fa0cd064c47 sp 00007fff7f61c870 error 4 in libc-2.16.so[7fa0cd01a000+19b000]

jabberd2 2.2.14, gentoo, gcc-4.7.2

The patch, which makes a workaround:

--- router/router.c.old 2013-03-20 17:44:23.000000000 +0400
+++ router/router.c     2013-03-20 17:44:38.000000000 +0400
@@ -233,7 +233,7 @@
         return;
     }

-    for(alias = comp->r->aliases; alias != NULL; alias = alias->next)
+/*    for(alias = comp->r->aliases; alias != NULL; alias = alias->next)
         if(strcmp(alias->name, name->domain) == 0) {
             log_write(comp->r->log, LOG_NOTICE, "[%s, port=%d] tried to bind '%s', but that name is aliased", comp->ip, c
             nad_set_attr(nad, 0, -1, "name", NULL, 0);
@@ -243,7 +243,7 @@
             free(user);
             return;
         }
-
+*/
     /* default route */
     if(nad_find_elem(nad, 0, NAD_ENS(nad, 0), "default", 1) >= 0) {
         if(!aci_check(comp->r->aci, "default-route", user)) {

An obscure error in c2s.log when the client connects: disconnect jid=unbound, packets: 0

I have a new installation. I didn't make it work yet. jabberd starts without any errors. But I am getting this error when the client attempts to create an account:
Tue Nov 6 19:06:07 2012 [notice] [8] [192.168.5.100, port=57554] connect
Tue Nov 6 19:06:07 2012 [notice] [8] [192.168.5.100, port=57554] disconnect jid=unbound, packets: 0

There is probably some configuration issue. But this error doesn't help to resolve it at all. It doesn't point to anything that is wrong. Googling it produces inconclusive results.

Error message should suggest what may be wrong. Why jid is unbound?
I got this with both kopete from kde4 and gajim clients.

storage_ldapvcard.c:442: possible free of automatic variable ?

I just ran the static analyser cppcheck over the source code of
jabberd 2.2.17

It said

[storage_ldapvcard.c:442]: (error) Deallocation of an auto-variable results in undefined behaviour.

The source code is

                ldap_value_free(vals);
                free(group);
                continue;

but

char jid[2048], group[1024], name[2048]; // name is sn[1024] + ' ' + initials[1024]

Suggest code rework.

It also said

[router.c:1206]: (error) Resource leak: message_file

which looks like some missing calls to fclose in some error handling code.

C2S per session user data & authreg auth API extensions

I am building a XMPP service around jabberd2 and I am very impressed
with the current architecture. However, as I am getting further into
our implementation, a couple of problems have become apparent.

Problems:

  • We need to maintain per user session data in c2s. For example:
    authentication token and unique user ID that is system and session
    specific. authreg_t has a private member to hold authreg related data
    but this is module wide and not tied to an individual user.
  • For CRAM-MD5, to generate the proper challenge, we need more than the
    username. Here, realm would be good to have and for verifying the
    response, the associated resource would be needed to generate the
    unique login ID in our system.

For us, the two are intertwined and the current APIs and data structures
do not provide a solution to the above problems.

Discussed on the mailing list: http://www.mail-archive.com/[email protected]/msg02335.html

option to exclude domain from s2s require_tls

I'd like to enable require_tls for s2s, but then I can't talk to a select few servers -- any chance there could be a way to say that I want require_tls in general, but not for server X?

authreg_db calls exit

Hi. I'm packaging jabberd2 for Debian and got a complaint from lintian:

X: jabberd2: shlib-calls-exit usr/lib/x86_64-linux-gnu/jabberd2/authreg_db.so
N:
N: The listed shared library calls the C library exit() or _exit()
N: functions.
N:
N: In the case of an error, the library should instead return an
N: appropriate error code to the calling program which can then determine
N: how to handle the error, including performing any required clean-up.
N:
N: In most cases, removing the call should be discussed with upstream,
N: particularly as it may produce an ABI change.

And indeed the code does call exit:

https://github.com/jabberd2/jabberd2/blob/master/storage/storage_db.c#L516

Is there something better than exit that could be done here?

/Simon

Broken "issue tracker" link on homepage

On the jabberd2 homepage there is a link to report issues which reads:

Use issue tracker to submit new issues.

The words "issue tracker" are supposed to be a link to the GitHub new issue page, but the link is broken because there is an erroneous ">" at the end of it.

feature addon _pubsub

loosing s2s connection if incoming server does not piggy-back

In the following scenario:

Sep  9 18:30:04 xkh0g1 jabberd/s2s[8570]: [15] [178.33.33.232, port=44447] incoming connection
Sep  9 18:30:04 xkh0g1 jabberd/s2s[8570]: [15] [178.33.33.232, port=44447] incoming stream online (id dkul7hyamk13nmi03xhtsj7ddskuruh)
Sep  9 18:30:05 xkh0g1 jabberd/s2s[8570]: [15] [178.33.33.232, port=44447] received dialback auth request for route 'chrome.pl/jabber.i-pobox.net'
Sep  9 18:30:05 xkh0g1 jabberd/s2s[8570]: [67] [178.33.33.232, port=5269] outgoing connection for 'jabber.i-pobox.net'
Sep  9 18:30:05 xkh0g1 jabberd/s2s[8570]: [67] [178.33.33.232, port=5269] sending dialback auth request for route 'chrome.pl/jabber.i-pobox.net'
Sep  9 18:30:05 xkh0g1 jabberd/s2s[8570]: [137] [178.33.33.232, port=36290] incoming connection
Sep  9 18:30:05 xkh0g1 jabberd/s2s[8570]: [137] [178.33.33.232, port=36290] incoming stream online (id 9vnjecq2726holgi8x1mwgwr4f6g69n)
Sep  9 18:30:06 xkh0g1 jabberd/s2s[8570]: [137] [178.33.33.232, port=36290] checking dialback verification from jabber.i-pobox.net: sending valid
Sep  9 18:30:06 xkh0g1 jabberd/s2s[8570]: [67] [178.33.33.232, port=5269] outgoing route 'chrome.pl/jabber.i-pobox.net' is now valid, TLS negotiated
Sep  9 18:31:38 xkh0g1 jabberd/s2s[8570]: [67] [178.33.33.232, port=5269] dialback verify request timed out
Sep  9 18:31:38 xkh0g1 jabberd/s2s[8570]: [67] [178.33.33.232, port=5269] disconnect, packets: 4
Sep  9 18:33:05 xkh0g1 jabberd/s2s[8570]: [15] [178.33.33.232, port=44447] disconnect, packets: 1
Sep  9 18:33:06 xkh0g1 jabberd/s2s[8570]: [137] [178.33.33.232, port=36290] disconnect, packets: 1

s2s connection is dropped.
Probably because route key 'chrome.pl/jabber.i-pobox.net' on incoming connections gets overwritten in route map xhash.

should nad_find_elem_path return path's leaf node element?

i have a xml:
iq type='set'
pubsub node='node1'
options/
/pubsub
/iq
i want to get the element 'options' directly,so i write: int elem=nad_find_elem_path(nad,0,-1,"pubsub/options");
but nad_find_elem_path will return element 'pubsub',is it a bug or by design?
i see the code is:

for(elem = nad_find_elem(nad, elem, ns, str, 1); ; elem = nad_find_elem(nad, elem, ns, str, 0)) {
if(elem < 0) break;
if(nad_find_elem_path(nad, elem, ns, slash) >= 0) break;
}

free(str);
return elem;

////////////////////////////////////end/////////////////////////////////////////
i think :

for(elem = nad_find_elem(nad, elem, ns, str, 1); ; elem = nad_find_elem(nad, elem, ns, str, 0)) {
if(elem < 0) break;
if(elem=nad_find_elem_path(nad, elem, ns, slash) >= 0) break;
}

free(str);
return elem;

these code will return sub child directly

jabberd/router: storage_mysql.so: undefined symbol: nad_print

May 29 01:48:30 gsom jabberd/router[1867]: loading 'mysql' storage module
May 29 01:48:30 gsom jabberd/router[1867]: failed loading storage module 'my
sql' (/usr/lib/jabberd/storage_mysql.so: undefined symbol: nad_print)
May 29 01:48:30 gsom jabberd/router[1867]: failed to initialise one or more
storage drivers, aborting

but

May 29 01:48:31 gsom jabberd/sm[1882]: loading 'mysql' storage module
May 29 01:48:31 gsom jabberd/s2s[1898]: starting up (interval=60, queue=60,
keepalive=0, idle=86400)
May 29 01:48:31 gsom jabberd/s2s[1898]: process id is 1898, written to /var/
run/jabber/s2s.pid
May 29 01:48:31 gsom jabberd/sm[1882]: initialised storage driver 'mysql'

mysql-5.1.67, gentoo linux, x86

rand() is sufficient to seed Expat

This is a follow up to issue #5 . The fix there involved using clock() to seed the hash generator in expat (and avoid it calling srand() in bad ways). But clock() is overkill, and as pointed out still has a race. Instead just call rand() which is properly seeded from startup, and will always give a new value on each invocation.

router crash

Mon Dec  9 12:42:52 2013 router.c:1037 read action on fd 9
Mon Dec  9 12:42:52 2013 router.c:698 reading from 9
Mon Dec  9 12:42:52 2013 router.c:756 read 411 bytes
Mon Dec  9 12:42:52 2013 router.c:449 unicast route from c2s to sm
Dec  9 12:42:52 cerberus kernel: [3476663.509312] jabberd2-router[26191]: segfault at 7f77a59eb804 ip 00007f77a479c995 sp 00007fff386a69d0 error 4 in jabberd2-router[7f77a4795000+26000]

Mon Dec  9 12:42:52 2013 filter.c:218 matched packet (null)->[email protected] vs rule ((null) (null)->*)
Mon Dec  9 12:42:52 2013 router.c:563 writing route for 'sm'*1 to 127.0.0.1, port 55242
Mon Dec  9 12:42:52 2013 router.c:693 want write
Mon Dec  9 12:42:52 2013 router.c:1051 write action on fd 7
Mon Dec  9 12:42:52 2013 router.c:763 writing to 7
Mon Dec  9 12:42:52 2013 router.c:767 411 bytes written
Mon Dec  9 12:42:52 2013 router.c:688 want read
Mon Dec  9 12:42:52 2013 router.c:688 want read
Mon Dec  9 12:42:52 2013 router.c:1037 read action on fd 7
Mon Dec  9 12:42:52 2013 router.c:698 reading from 7
Mon Dec  9 12:42:52 2013 router.c:756 read 338 bytes
Mon Dec  9 12:42:52 2013 router.c:449 unicast route from sm to norchemlab.com
Mon Dec  9 12:42:52 2013 router.c:563 writing route for 'norchemlab.com'*1 to 127.0.0.1, port 55242

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.