[jabberd] fixes "Regression with jabberd 2.3.1 and postgresql" (#1036876)

Adrian Reber adrian at fedoraproject.org
Wed Dec 4 12:33:09 UTC 2013


commit 08713e41ff3742fe5831ff9c1ba7c53bc2c4fef5
Author: Adrian Reber <adrian at lisas.de>
Date:   Wed Dec 4 13:33:04 2013 +0100

    fixes "Regression with jabberd 2.3.1 and postgresql" (#1036876)
    
      https://github.com/jabberd2/jabberd2/issues/48

 2e0e7c8cf8adb3ec92a608fa0d2fa52a903de076.patch |   59 ++++++++++++++++++++++++
 jabberd.spec                                   |    8 +++-
 2 files changed, 66 insertions(+), 1 deletions(-)
---
diff --git a/2e0e7c8cf8adb3ec92a608fa0d2fa52a903de076.patch b/2e0e7c8cf8adb3ec92a608fa0d2fa52a903de076.patch
new file mode 100644
index 0000000..025e1bb
--- /dev/null
+++ b/2e0e7c8cf8adb3ec92a608fa0d2fa52a903de076.patch
@@ -0,0 +1,59 @@
+From 2e0e7c8cf8adb3ec92a608fa0d2fa52a903de076 Mon Sep 17 00:00:00 2001
+From: Tomasz Sterna <tomek at xiaoka.com>
+Date: Mon, 2 Dec 2013 21:11:52 +0100
+Subject: [PATCH] Fixed os_type_INTEGER handling in PostgreSQL
+
+Closes #48
+---
+ storage/object.c        | 7 +++----
+ storage/storage_pgsql.c | 2 +-
+ 2 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/storage/object.c b/storage/object.c
+index daf3682..956a129 100644
+--- a/storage/object.c
++++ b/storage/object.c
+@@ -141,8 +141,7 @@ void os_object_put(os_object_t o, const char *key, const void *val, os_type_t ty
+     switch(type) {
+         case os_type_BOOLEAN:
+         case os_type_INTEGER:
+-            osf->val = (void *) pmalloco(o->os->p, sizeof(int));
+-            * (int *) osf->val = * (int *) val;
++            osf->val = (void *) (intptr_t) (* (int *) val);
+             break;
+ 
+         case os_type_STRING:
+@@ -244,7 +243,7 @@ int os_object_get(os_t os, os_object_t o, const char *key, void **val, os_type_t
+     switch(type) {
+         case os_type_BOOLEAN:
+         case os_type_INTEGER:
+-            * (int *) val = * (int *) osf->val;
++            * (int *) val = (int) (intptr_t) osf->val;
+             break;
+ 
+         case os_type_STRING:
+@@ -311,7 +310,7 @@ void os_object_iter_get(os_object_t o, char **key, void **val, os_type_t *type)
+     switch(osf->type) {
+         case os_type_BOOLEAN:
+         case os_type_INTEGER:
+-            * (int *) val = * (int *) osf->val;
++            * (int *) val = (int) (intptr_t) osf->val;
+             break;
+ 
+         case os_type_STRING:
+diff --git a/storage/storage_pgsql.c b/storage/storage_pgsql.c
+index 690be1a..4fe3421 100644
+--- a/storage/storage_pgsql.c
++++ b/storage/storage_pgsql.c
+@@ -203,7 +203,7 @@ static st_ret_t _st_pgsql_put_guts(st_driver_t drv, const char *type, const char
+ 
+                         case os_type_INTEGER:
+                             cval = (char *) malloc(sizeof(char) * 20);
+-                            sprintf(cval, "%ld", (long int) val);
++                            sprintf(cval, "%ld", (int) (intptr_t) val);
+                             break;
+ 
+                         case os_type_STRING:
+-- 
+1.8.5-rc3
+
diff --git a/jabberd.spec b/jabberd.spec
index 63466b9..1db624a 100644
--- a/jabberd.spec
+++ b/jabberd.spec
@@ -3,7 +3,7 @@
 Summary:        OpenSource server implementation of the Jabber protocols
 Name:           jabberd
 Version:        2.3.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 License:        GPLv2+
 Group:          System Environment/Daemons
 Source0:        https://github.com/jabberd2/jabberd2/releases/download/jabberd-2.3.1/jabberd-2.3.1.tar.xz
@@ -13,6 +13,7 @@ Source3:        jabberd-s2s.service
 Source4:        jabberd-sm.service
 Source5:        jabberd-router.service
 Source6:        README.fedora
+Patch0:         https://github.com/jabberd2/jabberd2/commit/2e0e7c8cf8adb3ec92a608fa0d2fa52a903de076.patch
 URL:            http://jabberd2.org/
 BuildRequires:  openssl-devel libidn-devel expat-devel
 BuildRequires:  systemd-units cppunit-devel
@@ -45,6 +46,7 @@ This package defaults to use pam and sqlite.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 export CFLAGS="%{optflags}"
@@ -208,6 +210,10 @@ fi
 %attr(700, jabber, jabber) %{_var}/lib/%{name}
 
 %changelog
+* Wed Dec 04 2013 Adrian Reber <adrian at lisas.de> - 2.3.1-2
+- fixes "Regression with jabberd 2.3.1 and postgresql" (#1036876)
+  https://github.com/jabberd2/jabberd2/issues/48
+
 * Thu Nov 28 2013 Adrian Reber <adrian at lisas.de> - 2.3.1-1
 - updated to 2.3.1
 


More information about the scm-commits mailing list