OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: bug in Sleepycat Berkeley DB 3.0.55
From: Jeff A. Earickson (jaearickcolby.edu)
Date: Wed Mar 08 2000 - 16:10:36 CST


Hey postfix users,

   I was trying to get various versions of postfix (19991231-pl04 and
snapshot-20000204) to compile with Sleepcat DB 3.0.55 and kept getting
an unsatisfied loadpoint for dbopen(). This was true for both Solaris 7
and HP systems. For postfix, I was doing:

make tidy > /dev/null
make -f Makefile.init makefiles \
  "CCARGS=-DHAS_PCRE -DHAS_DB -I/usr/local/BerkeleyDB.3.0/include -DPATH_DB_H='<db_185.h>'" \
   "AUXLIBS=-L/usr/local/BerkeleyDB.3.0/lib -lpcre -ldb"
make

This is according to the directions in the Postfix FAQ. Since the postfix
code seemed fine, I looked at 3.0.55, and made this change to their
db_185.h file:

*** db_185.h.orig Tue Mar 7 16:27:32 2000
--- db_185.h Tue Mar 7 16:27:44 2000
***************
*** 166,173 ****
  #if defined(__cplusplus)
  extern "C" {
  #endif
- #ifdef DB_LIBRARY_COMPATIBILITY_API
  #define dbopen __db185_open
  DB *__db185_open __P((const char *, int, int, DBTYPE, const void *));
  #else
  DB *dbopen __P((const char *, int, int, DBTYPE, const void *));
--- 166,173 ----
  #if defined(__cplusplus)
  extern "C" {
  #endif
  #define dbopen __db185_open
+ #ifdef DB_LIBRARY_COMPATIBILITY_API
  DB *__db185_open __P((const char *, int, int, DBTYPE, const void *));
  #else
  DB *dbopen __P((const char *, int, int, DBTYPE, const void *));

Note that the #define for dbopen is moved **outside** of the ifdef block
to fix the problem. With this minor change to Berkeley DB 3.0.55,
postfix compiled and loaded with no problems. I reported this change
to Sleepycat and they confirmed that it is a bug that they will fix
in a future release.

  I have asked Wietse to add this tip to the FAQ.

** Jeff A. Earickson, Ph.D PHONE: 207-872-3659
** Senior UNIX Sysadmin, Information Technology EMAIL: jaearickcolby.edu
** Colby College, 4214 Mayflower Hill, FAX: 207-872-3555
** Waterville ME, 04901-8842
----------------------------------------------------------------------------
"Sun believes the only place for 63,000 bugs is a rain forest. "
 -Sun Microsystems perspective of the Windows 2K Operating System
----------------------------------------------------------------------------