summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-01 22:30:23 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-01 13:05:04 +0000
commita386ca85590a0ee18c1d98c80c6b1ec4faab31a7 (patch)
tree8fef6fd8fa4ed2bfbe1cd822f1428164c3858f08 /source4
parent8366bb495abefe5cc1d0cb120530a1933d942fbf (diff)
downloadsamba-a386ca85590a0ee18c1d98c80c6b1ec4faab31a7.tar.gz
samba-a386ca85590a0ee18c1d98c80c6b1ec4faab31a7.tar.bz2
samba-a386ca85590a0ee18c1d98c80c6b1ec4faab31a7.zip
s4-ldb: enable ldb module version checking
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/ldb_ldap/ldb_ldap.c3
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c9
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c1
-rw-r--r--source4/lib/ldb/modules/asq.c4
-rw-r--r--source4/lib/ldb/modules/paged_results.c1
-rw-r--r--source4/lib/ldb/modules/paged_searches.c1
-rw-r--r--source4/lib/ldb/modules/rdn_name.c1
-rw-r--r--source4/lib/ldb/modules/skel.c2
-rw-r--r--source4/lib/ldb/modules/sort.c2
-rw-r--r--source4/lib/ldb/tests/sample_module.c2
10 files changed, 20 insertions, 6 deletions
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index b32be90a89..6728269286 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -957,10 +957,11 @@ failed:
/*
initialise the module
*/
-int ldb_ldap_init(const char *ldb_version)
+int ldb_ldap_init(const char *version)
{
int ret, i;
const char *names[] = { "ldap", "ldaps", "ldapi", NULL };
+ LDB_MODULE_CHECK_VERSION(version);
for (i=0; names[i]; i++) {
ret = ldb_register_backend(names[i], lldb_connect, false);
if (ret != LDB_SUCCESS) {
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index 3aa6672964..26f0351d08 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -1932,7 +1932,8 @@ failed:
return LDB_ERR_OPERATIONS_ERROR;
}
-const struct ldb_backend_ops ldb_sqlite3_backend_ops = {
- .name = "sqlite3",
- .connect_fn = lsqlite3_connect
-};
+int ldb_sqlite3_init(const char *version)
+{
+ LDB_MODULE_CHECK_VERSION(version);
+ return ldb_register_backend("sqlite3", lsqlite3_connect, false);
+}
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 4a96af3ab8..d9547c98c4 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1449,5 +1449,6 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
int ldb_tdb_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_backend("tdb", ltdb_connect, false);
}
diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c
index 45a733bd13..ebfafb9556 100644
--- a/source4/lib/ldb/modules/asq.c
+++ b/source4/lib/ldb/modules/asq.c
@@ -32,6 +32,7 @@
* Author: Simo Sorce
*/
+#include "ldb_includes.h"
#include "ldb_module.h"
struct asq_context {
@@ -406,7 +407,8 @@ static const struct ldb_module_ops ldb_asq_module_ops = {
.init_context = asq_init
};
-int ldb_asq_init(const char *ldb_version)
+int ldb_asq_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_asq_module_ops);
}
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index f61dd9698d..5e1601c087 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -431,5 +431,6 @@ static const struct ldb_module_ops ldb_paged_results_module_ops = {
int ldb_paged_results_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_paged_results_module_ops);
}
diff --git a/source4/lib/ldb/modules/paged_searches.c b/source4/lib/ldb/modules/paged_searches.c
index 3d86b8d3ca..d4d7814d73 100644
--- a/source4/lib/ldb/modules/paged_searches.c
+++ b/source4/lib/ldb/modules/paged_searches.c
@@ -379,5 +379,6 @@ static const struct ldb_module_ops ldb_paged_searches_module_ops = {
int ldb_paged_searches_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_paged_searches_module_ops);
}
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index caff9f59e2..e27eea50bf 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -386,5 +386,6 @@ static const struct ldb_module_ops ldb_rdn_name_module_ops = {
int ldb_rdn_name_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_rdn_name_module_ops);
}
diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c
index 5dee735c60..e04436f760 100644
--- a/source4/lib/ldb/modules/skel.c
+++ b/source4/lib/ldb/modules/skel.c
@@ -31,6 +31,7 @@
* Author: Simo Sorce
*/
+#include "ldb_includes.h"
#include "ldb_module.h"
struct private_data {
@@ -139,5 +140,6 @@ static const struct ldb_module_ops ldb_skel_module_ops = {
int ldb_skel_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_skel_module_ops);
}
diff --git a/source4/lib/ldb/modules/sort.c b/source4/lib/ldb/modules/sort.c
index fd30c90505..0ecba1c714 100644
--- a/source4/lib/ldb/modules/sort.c
+++ b/source4/lib/ldb/modules/sort.c
@@ -31,6 +31,7 @@
* Author: Simo Sorce
*/
+#include "ldb_includes.h"
#include "ldb_module.h"
struct opaque {
@@ -352,5 +353,6 @@ static const struct ldb_module_ops ldb_server_sort_module_ops = {
int ldb_server_sort_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_server_sort_module_ops);
}
diff --git a/source4/lib/ldb/tests/sample_module.c b/source4/lib/ldb/tests/sample_module.c
index d93c6de440..8862325c3b 100644
--- a/source4/lib/ldb/tests/sample_module.c
+++ b/source4/lib/ldb/tests/sample_module.c
@@ -21,6 +21,7 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#include "ldb_includes.h"
#include "ldb_module.h"
int sample_add(struct ldb_module *mod, struct ldb_request *req)
@@ -63,5 +64,6 @@ static struct ldb_module_ops ldb_sample_module_ops = {
int ldb_sample_init(const char *version)
{
+ LDB_MODULE_CHECK_VERSION(version);
return ldb_register_module(&ldb_sample_module_ops);
}