Re: [Exim] exim_dbmbuild can't rename file.

Top Page
Delete this message
Reply to this message
Author: Friso Kuipers
Date:  
To: exim-users
Subject: Re: [Exim] exim_dbmbuild can't rename file.
Don Wilkerson wrote:

> I had the USE_GDBM=YES in my Makefile along with DBMLIB=-lgdbm. It
> compiles everything ok but still produces the same error. Apparently it
> is not creating the temporary file with the proper name, leaving the
> '.dir' off. Not sure why this is.
>


Exim 4.10 doesn't handle native gdbm files properly. It assumes they
have a dir or pag extention, which they don't. The source needs to be
modified to cope with this. Some time ago I send Philip several diffs
for examination so hopefully the problem will be cleared in the next
version. Philip?

If people really need native gdbm now they can try these two diffs, but
they may break other things. Never use my stuff in a production system,
I'm not to be trusted, honest.

Regards,
Friso Kuipers.

-------------------------- diff 1 ------------------------------

*** exim_dbmbuild.c    Mon Sep 30 20:00:50 2002
--- exim_dbmbuild.c.new    Tue Oct  1 00:20:07 2002
***************
*** 59,65 ****
   BOOL warn = TRUE;
   BOOL duperr = TRUE;
   BOOL lastdup = FALSE;
! #if !defined (USE_DB) && !defined(USE_TDB)
   int is_db = 0;
   struct stat statbuf;
   #endif
--- 59,65 ----
   BOOL warn = TRUE;
   BOOL duperr = TRUE;
   BOOL lastdup = FALSE;
! #if !defined (USE_DB) && !defined(USE_TDB) && !defined(USE_GDBM)
   int is_db = 0;
   struct stat statbuf;
   #endif
***************
*** 104,110 ****
   /* By default Berkeley db does not put extensions on... which
   can be painful! */


! #if defined(USE_DB) || defined(USE_TDB)
   if (Ustrcmp(argv[arg], argv[arg+1]) == 0)
     {
     printf("exim_dbmbuild: input and output filenames are the same\n");
--- 104,110 ----
   /* By default Berkeley db does not put extensions on... which
   can be painful! */


! #if defined(USE_DB) || defined(USE_TDB) || defined(USE_GDBM)
   if (Ustrcmp(argv[arg], argv[arg+1]) == 0)
     {
     printf("exim_dbmbuild: input and output filenames are the same\n");
***************
*** 131,137 ****
   /* Unless using native db calls, see if we have created <name>.db; if
not,
   assume .dir & .pag */


! #if !defined(USE_DB) && !defined(USE_TDB)
sprintf(CS real_dbmname, "%s.db", temp_dbmname);
is_db = Ustat(real_dbmname, &statbuf) == 0;
#endif
--- 131,137 ----
/* Unless using native db calls, see if we have created <name>.db; if
not,
assume .dir & .pag */

! #if !defined(USE_DB) && !defined(USE_TDB) && !defined(USE_GDBM)
   sprintf(CS real_dbmname, "%s.db", temp_dbmname);
   is_db = Ustat(real_dbmname, &statbuf) == 0;
   #endif
***************
*** 296,302 ****
       printf("%d duplicate key%s \n", dupcount, (dupcount > 1)? "s" : "");
       }


!   #if defined(USE_DB) || defined(USE_TDB)
     Ustrcpy(real_dbmname, temp_dbmname);
     Ustrcpy(buffer, argv[arg+1]);
     if (Urename(real_dbmname, buffer) != 0)
--- 296,302 ----
       printf("%d duplicate key%s \n", dupcount, (dupcount > 1)? "s" : "");
       }


!   #if defined(USE_DB) || defined(USE_TDB) || defined(USE_GDBM)
     Ustrcpy(real_dbmname, temp_dbmname);
     Ustrcpy(buffer, argv[arg+1]);
     if (Urename(real_dbmname, buffer) != 0)
***************
*** 348,354 ****
   else
     {
     printf("dbmbuild abandoned\n");
!   #if defined(USE_DB) || defined(USE_TDB)
     Uunlink(temp_dbmname);
     #else
     if (is_db)
--- 348,354 ----
   else
     {
     printf("dbmbuild abandoned\n");
!   #if defined(USE_DB) || defined(USE_TDB) || defined(USE_GDBM)
     Uunlink(temp_dbmname);
     #else
     if (is_db)


---------- diff 2 ------------------------------------------

*** dbmdb.c    Mon Sep 30 06:24:18 2002
--- dbmdb.c.new    Mon Sep 30 06:24:18 2002
***************
*** 49,55 ****
   int rc;
   handle = handle;    /* Keep picky compilers happy */


! #if defined(USE_DB) || defined(USE_TDB)
   rc = lf_check_file(-1, filename, S_IFREG, modemask, owners, owngroups,
     "dbm", errmsg);
   #else
--- 49,55 ----
   int rc;
   handle = handle;    /* Keep picky compilers happy */


! #if defined(USE_DB) || defined(USE_TDB) || defined(USE_GDBM)
   rc = lf_check_file(-1, filename, S_IFREG, modemask, owners, owngroups,
     "dbm", errmsg);
   #else


----------------------------- end --------------------------