[pkg-kolab] Bug#383172: cyrus-imapd-2.2 against libdb4.2 version

Florian Zschocke zschocke at gmx.net
Tue Aug 22 17:14:21 UTC 2006


The cyrus-imapd-2.2 package is at version 2.2.13 while kolab-cyrus-imapd
is at version 2.2.12. The 2.2.13 version of cyrus does not have the
specific issue I was having, which was segmentation faults when the
Berkekely database wanted to report an error via the db_errcall_fcn

The original sources of cyrus imapd 2.2.12 work fine with db4.2 as they
use the correct prototype for the db_errcall_fcn callback. The patch
100-kolab-imapd.dpatch patches the file lib/cyrusdb_berkeley.c to use
the db4.3 version of the prototype but then the binaries aren't linked
against db4.3 but still against db4.2. This will cause segmentation

The cyrus-imapd-2.2/2.2.13 package does not have this patch. It does
have a changed version of the lib/cyrusdb_berkeley.c file which can work
with both versions of db, 4.2 and 4.3. The cyrus-imapd-2.2 package is
hence not affected.

The way I see it, your options are the following:
a) upgrade to cyrus imapd 2.2.13.
b) remove the last hunk of patch 100-kolab-imapd
c) link against db4.3
d) add yet another patch to the end which patches the erroneous
prototype for db_err() back to something useful, e.g.:

--- 8< *snip* ---------------------------------------------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## 170-fix_db_err_prototype.dpatch by  <fzschocke at batm.de>
## All lines beginning with `## DP:' are a description of the patch.
## DP: Use different prototypes for db_err for DB versions 4.2 and 4.3


--- cyrus22-imap-2.2.12.ori/lib/cyrusdb_berkeley.c.orig 2006-08-15
19:50:33.000000000 +0200
+++ cyrus22-imap-2.2.12/lib/cyrusdb_berkeley.c  2006-08-15
19:51:51.000000000 +0200
@@ -104,7 +104,12 @@

-static void db_err(const DB_ENV *dbenv, const char *db_prfx, const char
+static void db_err(const DB_ENV *dbenv __attribute__((unused)),
+                                  const char *db_prfx, const char
+static void db_err(const char *db_prfx, char *buffer)
      syslog(LOG_WARNING, "DBERROR %s: %s", db_prfx, buffer);
--- 8< *snip* -------------------------------------------------------

(For the time being I went for option d) on our servers, even if it is a
stupid quick-n-dirty hack.)

Thanks for looking into this,

More information about the pkg-kolab-devel mailing list