summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-01 22:28:59 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-01 13:05:04 +0000
commit8366bb495abefe5cc1d0cb120530a1933d942fbf (patch)
tree0042a7bbd12b14103faca5c4306c634733de5554 /source4/lib/ldb/include
parent1ccb69aabb9057d272fc584d648a4ed9ffc0f3b7 (diff)
downloadsamba-8366bb495abefe5cc1d0cb120530a1933d942fbf.tar.gz
samba-8366bb495abefe5cc1d0cb120530a1933d942fbf.tar.bz2
samba-8366bb495abefe5cc1d0cb120530a1933d942fbf.zip
s4-ldb: added support for ldb module version checking
Diffstat (limited to 'source4/lib/ldb/include')
-rw-r--r--source4/lib/ldb/include/ldb_module.h7
1 files changed, 7 insertions, 0 deletions
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