Bug#347657: please add imapd.patch from kolab upstream

Ondrej Sury ondrej at sury.org
Fri Jan 13 22:41:17 UTC 2006


On Fri, 2006-01-13 at 19:35 +0100, Sven Mueller wrote:
> Ondrej Sury wrote on 12/01/2006 20:25:
> >>>-static void db_err(const char *db_prfx, char *buffer)
> >>>+static void db_err(const DB_ENV *dbenv, const char *db_prfx, const char *buffer)
> >>> {
> >>>     syslog(LOG_WARNING, "DBERROR %s: %s", db_prfx, buffer);
> >>> }
> >>
> >>We should verify this one.
> > 
> > 
> > AFAIK I remember something like this from info-cyrus list to be related
> > to db4.4.  But I could be wrong...
> 
> I honestly don't understand wether that patch is necessary or not. In
> db.h from libdb4.2-dev, there are two definitions for the set_errcall()
> function (which sets the callback for db errors, used in
> lib/cyrusdb_berkeley.c):
> 
> in struct __db:
>  void (*set_errcall) __P((DB *, void (*)(const char *, char *)));
> in struct __db_env:
>  void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *)));
> 
> Which leads me to _think_ we need the patch, since it is called as:
>  dbenv->set_errcall(dbenv, db_err);

Err, nope.  it means, that db_err in *DB4.2* has two params:

1. const char *
2. char *

This call is DB4.3 was changed to:

        void (*set_errcall) __P((DB *,
            void (*)(const DB_ENV *, const char *, const char *)));

        void (*set_errcall) __P((DB_ENV *,
            void (*)(const DB_ENV *, const char *, const char *)));

So, correct fix is something like this:

#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 3
static void db_err(const char *db_prfx, char *buffer)
#else
static void db_err(const DB_ENV *dbenv, const char *db_prfx, const char *buffer)
#endif

> dbenv is of type DB_ENV*, which is actually (struct __db_env)*.
> 
> Should I apply the patch? I think so, but I'm not really sure.

-- 
Ondrej Sury <ondrej at sury.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/pkg-cyrus-imapd-debian-devel/attachments/20060113/c74530b0/attachment.pgp


More information about the Pkg-Cyrus-imapd-Debian-devel mailing list