Re: [Exim] problems compiling exim-4.12 on freebsd 4.7 STABL…

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Philipp Gaschuetz
CC: exim-users
Subject: Re: [Exim] problems compiling exim-4.12 on freebsd 4.7 STABLE
On Tue, 31 Dec 2002, Philipp Gaschuetz wrote:

> has anyone also had problems compiling 4-12 on freebsd?
> it just didn't want to work out for me, and exim kept dying with
>
> "failed to open DB file /var/spool/exim/db/retry: Inappropriate file type or
> format"


This seems to be a problem that is specific to DB 1.85. It is provoked
by a buglet in Exim 4.12. It is calling the DB's "open" function with
O_CREAT+O_RDONLY if the database does not exist. The library creates an
empty file, which then gives the above error on subsequent accesses.

Other versions of DB don't seem to mind this behaviour, which is why the
bug wasn't noticed before (my standard tests use a later DB library).

The fix is trivial (patch below). There isn't any point in trying to
create the database for a readonly call.

Philip

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



*** exim-4.12/src/dbfn.c    Wed Dec 18 10:28:01 2002
--- dbfn.c    Fri Jan 17 11:52:19 2003
***************
*** 148,154 ****
  sprintf(CS buffer, "%s/db/%s", spool_directory, name);
  EXIM_DBOPEN(buffer, flags, EXIMDB_MODE, &(dbblock->dbptr));


! if (dbblock->dbptr == NULL && errno == ENOENT)
    {
    DEBUG(D_hints_lookup)
      debug_printf("%s appears not to exist: trying to create\n", buffer);
--- 148,154 ----
  sprintf(CS buffer, "%s/db/%s", spool_directory, name);
  EXIM_DBOPEN(buffer, flags, EXIMDB_MODE, &(dbblock->dbptr));


! if (dbblock->dbptr == NULL && errno == ENOENT && flags == O_RDWR)
    {
    DEBUG(D_hints_lookup)
      debug_printf("%s appears not to exist: trying to create\n", buffer);