summaryrefslogtreecommitdiff
path: root/source4/lib/registry/reg_backend_ldb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-02-27 11:35:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:55 -0500
commitb1b14817eaa6e6579596d54166e17bc8d5605c01 (patch)
treeb1af59838a0337dd52b510374b048255397dfe24 /source4/lib/registry/reg_backend_ldb.c
parentd2dc86994e7075490f95faa1cc85008feb38f04a (diff)
downloadsamba-b1b14817eaa6e6579596d54166e17bc8d5605c01.tar.gz
samba-b1b14817eaa6e6579596d54166e17bc8d5605c01.tar.bz2
samba-b1b14817eaa6e6579596d54166e17bc8d5605c01.zip
r5585: LDB interfaces change:
changes: - ldb_wrap disappears from code and become a private structure of db_wrap.c thanks to our move to talloc in ldb code, we do not need to expose it anymore - removal of ldb_close() function form the code thanks to our move to talloc in ldb code, we do not need it anymore use talloc_free() to close and free an ldb database - some minor updates to ldb modules code to cope with the change and fix some bugs I found out during the process (This used to be commit d58be9e74b786a11a57e89df36081d55730dfe0a)
Diffstat (limited to 'source4/lib/registry/reg_backend_ldb.c')
-rw-r--r--source4/lib/registry/reg_backend_ldb.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c
index 9f44f92888..7e63b14245 100644
--- a/source4/lib/registry/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb.c
@@ -30,10 +30,10 @@ struct ldb_key_data
int subkey_count, value_count;
};
-static int ldb_close_hive (void *_hive)
+static int ldb_free_hive (void *_hive)
{
struct registry_hive *hive = _hive;
- ldb_close (hive->backend_data);
+ talloc_free(hive->backend_data);
return 0;
}
@@ -231,9 +231,8 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, const ch
static WERROR ldb_open_hive(struct registry_hive *hive, struct registry_key **k)
{
- struct ldb_context *c;
struct ldb_key_data *kd;
- struct ldb_wrap *wrap;
+ struct ldb_context *wrap;
if (!hive->location) return WERR_INVALID_PARAM;
wrap = ldb_wrap_connect(hive, hive->location, 0, NULL);
@@ -243,14 +242,12 @@ static WERROR ldb_open_hive(struct registry_hive *hive, struct registry_key **k)
return WERR_FOOBAR;
}
- c = wrap->ldb;
-
- ldb_set_debug_stderr(c);
- hive->backend_data = c;
+ ldb_set_debug_stderr(wrap);
+ hive->backend_data = wrap;
*k = talloc_zero(hive, struct registry_key);
talloc_set_destructor (*k, reg_close_ldb_key);
- talloc_set_destructor (hive, ldb_close_hive);
+ talloc_set_destructor (hive, ldb_free_hive);
(*k)->name = talloc_strdup(*k, "");
(*k)->backend_data = kd = talloc_zero(*k, struct ldb_key_data);
kd->dn = talloc_strdup(*k, "hive=");