hdb: Use db type preference from ./configure
Use the HDB backend type from the --with-db-type-preference=... option to ./configure to make the default HDB backend more stable.
This commit is contained in:
@@ -7,6 +7,7 @@ AM_CPPFLAGS += $(INCLUDE_openldap) -DHDB_DB_DIR=\"$(DIR_hdbdir)\"
|
|||||||
AM_CPPFLAGS += -I$(srcdir)/../krb5
|
AM_CPPFLAGS += -I$(srcdir)/../krb5
|
||||||
AM_CPPFLAGS += $(INCLUDE_sqlite3)
|
AM_CPPFLAGS += $(INCLUDE_sqlite3)
|
||||||
AM_CPPFLAGS += $(INCLUDE_libintl)
|
AM_CPPFLAGS += $(INCLUDE_libintl)
|
||||||
|
AM_CPPFLAGS += -DHDB_DEFAULT_DB_TYPE=\"$(db_type):\"
|
||||||
if HAVE_DBHEADER
|
if HAVE_DBHEADER
|
||||||
AM_CPPFLAGS += -I$(DBHEADER)
|
AM_CPPFLAGS += -I$(DBHEADER)
|
||||||
endif
|
endif
|
||||||
|
@@ -802,7 +802,19 @@ hdb_create(krb5_context context, HDB **db, const char *filename)
|
|||||||
*db = NULL;
|
*db = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef HDB_DEFAULT_DB_TYPE
|
||||||
|
if (cb_ctx.h == NULL || cb_ctx.h->prefix == NULL) {
|
||||||
|
/*
|
||||||
|
* If still we've not picked a backend, use a build configuration time
|
||||||
|
* default.
|
||||||
|
*/
|
||||||
|
for (cb_ctx.h = methods; cb_ctx.h->prefix != NULL; cb_ctx.h++)
|
||||||
|
if (strcmp(cb_ctx.h->prefix, HDB_DEFAULT_DB_TYPE) == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (cb_ctx.h == NULL || cb_ctx.h->prefix == NULL)
|
if (cb_ctx.h == NULL || cb_ctx.h->prefix == NULL)
|
||||||
|
/* Last resort default */
|
||||||
cb_ctx.h = &default_dbmethod;
|
cb_ctx.h = &default_dbmethod;
|
||||||
if (cb_ctx.h == NULL || cb_ctx.h->prefix == NULL) {
|
if (cb_ctx.h == NULL || cb_ctx.h->prefix == NULL) {
|
||||||
krb5_set_error_message(context, ENOTSUP,
|
krb5_set_error_message(context, ENOTSUP,
|
||||||
|
Reference in New Issue
Block a user