summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_sqlite3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-06-07 21:03:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:57 -0500
commit247af0d569594512a24e83156e257b8d4d356883 (patch)
tree01cc382ba950b92059d8dd3686016333caf043b1 /source4/lib/ldb/ldb_sqlite3
parent2ab5bafd7296e4c2a415a4fcbe8a2ba7b4373699 (diff)
downloadsamba-247af0d569594512a24e83156e257b8d4d356883.tar.gz
samba-247af0d569594512a24e83156e257b8d4d356883.tar.bz2
samba-247af0d569594512a24e83156e257b8d4d356883.zip
r16083: Make it possible to initialise a backend module, without it setting up
the whole ldb structure. Because the sequence number was a fn pointer on the main ldb context, turn it into a full request (currently sync). Andrew Bartlett (This used to be commit fbe7d0ca9031e292b2d2fae263233c973982980a)
Diffstat (limited to 'source4/lib/ldb/ldb_sqlite3')
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index 06b76e812d..053ccd1b21 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -2073,9 +2073,10 @@ static const struct ldb_module_ops lsqlite3_ops = {
* connect to the database
*/
static int lsqlite3_connect(struct ldb_context *ldb,
- const char *url,
- unsigned int flags,
- const char *options[])
+ const char *url,
+ unsigned int flags,
+ const char *options[],
+ struct ldb_module **module)
{
int i;
int ret;
@@ -2097,15 +2098,18 @@ static int lsqlite3_connect(struct ldb_context *ldb,
talloc_set_destructor(lsqlite3, destructor);
- ldb->modules = talloc(ldb, struct ldb_module);
- if (!ldb->modules) {
+
+
+ *module = talloc(ldb, struct ldb_module);
+ if (!module) {
+ ldb_oom(ldb);
goto failed;
}
- ldb->modules->ldb = ldb;
- ldb->modules->prev = ldb->modules->next = NULL;
- ldb->modules->private_data = lsqlite3;
- ldb->modules->ops = &lsqlite3_ops;
-
+ (*module)->ldb = ldb;
+ (*module)->prev = ldb->modules->next = NULL;
+ (*module)->private_data = lsqlite3;
+ (*module)->ops = &lsqlite3_ops;
+
if (options) {
/*
* take a copy of the options array, so we don't have to rely