From 8366bb495abefe5cc1d0cb120530a1933d942fbf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Nov 2010 22:28:59 +1100 Subject: s4-ldb: added support for ldb module version checking --- source4/lib/ldb/include/ldb_module.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/lib/ldb/include/ldb_module.h') diff --git a/source4/lib/ldb/include/ldb_module.h b/source4/lib/ldb/include/ldb_module.h index 800bf72e44..fbea70770d 100644 --- a/source4/lib/ldb/include/ldb_module.h +++ b/source4/lib/ldb/include/ldb_module.h @@ -252,4 +252,11 @@ int ldb_register_hook(ldb_hook_fn hook_fn); */ int ldb_modules_hook(struct ldb_context *ldb, enum ldb_module_hook_type t); +#define LDB_MODULE_CHECK_VERSION(version) do { \ + if (strcmp(version, LDB_VERSION) != 0) { \ + fprintf(stderr, "ldb: module version mismatch in %s : ldb_version=%s module_version=%s\n", \ + __FILE__, version, LDB_VERSION); \ + return LDB_ERR_UNAVAILABLE; \ + }} while (0) + #endif -- cgit