heimdal icon indicating copy to clipboard operation
heimdal copied to clipboard

Fix (OTP) build with no external database support

Open kaduk opened this issue 6 years ago • 0 comments

On a fairly minimal debian sid system, my builds fail in libotp trying to link otptest due to missing symbols (e.g., __roken_dbm_open); it turns out that this is not due to failing to link libroken, but rather that these symbols are not in libroken at all! Though ndbm_wrap.c is in lib/roken, the sources are used directly in lib/otp/Makefile.am; however, these wrappers are only built when HAVE_DB3 or HAVE_DB1 is defined; otherwise we try to use NDBMLIB for the DBM support (as set by the routines in cf/db.m4). However, otp_db.c includes ndbm_wrap.h when !defined(HAVE_NDBM) && !defined(HAVE_DB_NDBM), but the roken version seems to require a "real" DBN for some N.

As far as I can tell, this means that we just can't use libotp in such a minimal environment, hence the proposed change to configure to disable otp in these cases. (But of course the details of when exactly to do such disabling may not be correct, as I don't have an exhaustive test matrix to try it on.)

Please try to double-check the notes in the commit message about the commits where sqlite/lmdb were introduced, as I'm not 100% confident in them.

I'm also a bit confused at how the $db_type configure variable seems to be used both for what the HDB format is and what kind of dbN we have available (for libotp's purposes), but did not try to investigate down that path.

One final side note from my investigation's results: ndbm_wrap.c includes db.h if HAVE_DBHEADER and then has an elif chain, with the else clause also being to include db.h. I didn't fully read up on when we set HAVE_DBHEADER, but maybe this is trying to include the thing that we already checked wasn't available?

kaduk avatar Jun 23 '19 03:06 kaduk