[Pkg-xmpp-commits] [jabberd2] 02/05: Imported Upstream version 2.5.0

Simon Josefsson jas at moszumanska.debian.org
Sat Mar 4 08:14:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

jas pushed a commit to branch master
in repository jabberd2.

commit 1023a48868c201b5949a92d278473818e7d196f0
Author: Simon Josefsson <simon at josefsson.org>
Date:   Sat Mar 4 09:00:42 2017 +0100

    Imported Upstream version 2.5.0
---
 NEWS                    | 13 +++++++++++++
 README.md               |  1 +
 c2s/main.c              |  3 ++-
 configure.ac            |  2 +-
 etc/c2s.xml.dist.in     |  4 +---
 sm/main.c               | 17 -----------------
 sm/mod_iq_private.c     |  1 +
 sm/mod_privacy.c        |  1 +
 storage/storage_pgsql.c | 15 ++++++++++++++-
 9 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/NEWS b/NEWS
index 979ddd2..f028985 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,19 @@ This file contains news, important changes
 and upgrade instructions between different versions of jabberd2.
 
 
+* 2.4.0 to 2.5.0 upgrade:
+
+What changed:
+- Do not attempt to reload SM modules on SIGHUP
+- Cleanup config files example
+- Fixed memory leak in pgsql storage driver
+- Fixed two double-frees caused by dangling pointers
+- Fixed c2s logger initialization point
+
+This is a bugfix release.
+The main visible changes that SIGHUP to SM will logrotate only.
+
+
 * 2.3.6 to 2.4.0 upgrade:
 
 What changed:
diff --git a/README.md b/README.md
index b8a030f..eff9267 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@ Jabber Open Source Server (2.x)
 [![Build Status](https://travis-ci.org/jabberd2/jabberd2.svg?branch=master)](https://travis-ci.org/jabberd2/jabberd2)
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/8550/badge.svg)](https://scan.coverity.com/projects/jabberd)
 [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jabberd2/jabberd2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![Flattr this](https://button.flattr.com/flattr-badge-large.png)](https://flattr.com/submit/auto?fid=8n22qr&url=https%3A%2F%2Fgithub.com%2Fjabberd2%2Fjabberd2)
 
 Thanks for downloading jabberd2. Below are some basic instructions to
 get you started. Complete documentation is available at http://jabberd2.org/
diff --git a/c2s/main.c b/c2s/main.c
index f88a7bd..1efa365 100644
--- a/c2s/main.c
+++ b/c2s/main.c
@@ -754,6 +754,8 @@ JABBER_MAIN("jabberd2c2s", "Jabber 2 C2S", "Jabber Open Source Server: Client to
 
     _c2s_config_expand(c2s);
 
+    c2s->log = log_new(c2s->log_type, c2s->log_ident, c2s->log_facility);
+
     c2s->ar_modules = xhash_new(5);
     if(c2s->ar_module_name == NULL) {
         log_write(c2s->log, LOG_NOTICE, "no default authreg module specified in config file");
@@ -766,7 +768,6 @@ JABBER_MAIN("jabberd2c2s", "Jabber 2 C2S", "Jabber Open Source Server: Client to
         exit(1);
     }
 
-    c2s->log = log_new(c2s->log_type, c2s->log_ident, c2s->log_facility);
     log_write(c2s->log, LOG_NOTICE, "starting up");
 
     _c2s_pidfile(c2s);
diff --git a/configure.ac b/configure.ac
index 16b797d..5a373fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT([jabberd], [2.4.0], [jabberd2 at lists.xiaoka.com])
+AC_INIT([jabberd], [2.5.0], [jabberd2 at lists.xiaoka.com])
 AC_CONFIG_SRCDIR([sx/sx.h])
 AC_CONFIG_HEADER([config.h])
 AM_INIT_AUTOMAKE
diff --git a/etc/c2s.xml.dist.in b/etc/c2s.xml.dist.in
index 885e08c..f930cbc 100644
--- a/etc/c2s.xml.dist.in
+++ b/etc/c2s.xml.dist.in
@@ -151,9 +151,7 @@
         verify-mode='7'
         cachain='@sysconfdir@/client_ca_certs.pem'
         require-starttls='mu'
-        register-enable='mu'
-        instructions='Enter a username and password to register with this server.'
-        register-oob='http://example.org/register'
+        register-oob='http://example.net/register'
         password-change='mu'
     >example.net</id> -->
     <!-- or the default host
diff --git a/sm/main.c b/sm/main.c
index d3bee75..2579e3b 100644
--- a/sm/main.c
+++ b/sm/main.c
@@ -41,24 +41,7 @@ static void _sm_signal(int signum)
 
 static void _sm_signal_hup(int signum)
 {
-    config_t conf;
-
-    log_write(sm->log, LOG_NOTICE, "HUP handled. reloading modules...");
-
     sm_logrotate = 1;
-
-    /* reload dynamic modules */
-    conf = config_new();
-    if (conf && config_load(conf, config_file) == 0) {
-        config_free(sm->config);
-        sm->config = conf;
-        /*_sm_config_expand(sm);*/ /* we want to reload modules only */
-    } else {
-        log_write(sm->log, LOG_WARNING, "couldn't reload config (%s)", config_file);
-        if (conf) config_free(conf);
-    }
-    mm_free(sm->mm);
-    sm->mm = mm_new(sm);
 }
 
 static void _sm_signal_usr1(int signum)
diff --git a/sm/mod_iq_private.c b/sm/mod_iq_private.c
index a6915f9..eb90611 100644
--- a/sm/mod_iq_private.c
+++ b/sm/mod_iq_private.c
@@ -176,6 +176,7 @@ static mod_ret_t _iq_private_in_sess(mod_instance_t mi, sess_t sess, pkt_t pkt)
                     result = pkt_dup(pkt, jid_full(sscan->jid), NULL);
                     if(result->from != NULL) {
                         jid_free(result->from);
+                        result->from = NULL;
                         nad_set_attr(result->nad, 1, -1, "from", NULL, 0);
                     }
                     pkt_id_new(result);
diff --git a/sm/mod_privacy.c b/sm/mod_privacy.c
index 2291958..f256252 100644
--- a/sm/mod_privacy.c
+++ b/sm/mod_privacy.c
@@ -861,6 +861,7 @@ static mod_ret_t _privacy_in_sess(mod_instance_t mi, sess_t sess, pkt_t pkt) {
                     if(result->from != NULL) {
                         jid_free(result->from);
                         nad_set_attr(result->nad, 1, -1, "from", NULL, 0);
+                        result->from = NULL;
                     }
                     pkt_id_new(result);
                     pkt_sess(result, sscan);
diff --git a/storage/storage_pgsql.c b/storage/storage_pgsql.c
index a49de69..4f859c3 100644
--- a/storage/storage_pgsql.c
+++ b/storage/storage_pgsql.c
@@ -667,8 +667,21 @@ st_ret_t st_init(st_driver_t drv) {
         log_write(drv->st->log, LOG_ERR, "pgsql: connection to database failed: %s", PQerrorMessage(conn));
 
     if (schema) {
+        PGresult *res;
         snprintf(sql, sizeof(sql), "SET search_path TO \"%s\"", schema);
-        PQexec(conn, sql);
+        res = PQexec(conn, sql);
+
+	if (res) {
+	    if (PQresultStatus(res) != PGRES_COMMAND_OK) {
+                log_write(drv->st->log, LOG_ERR, "pgsql: unable to set search path: %s", PQresultErrorMessage(res));
+		PQclear(res);
+		return st_FAILED;
+	    }
+            PQclear(res);
+	} else {
+            log_write(drv->st->log, LOG_ERR, "pgsql: unable to set search path");
+	    return st_FAILED;
+	}
     }
 
     data = (drvdata_t) calloc(1, sizeof(struct drvdata_st));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xmpp/jabberd2.git



More information about the Pkg-xmpp-commits mailing list