From b1b14817eaa6e6579596d54166e17bc8d5605c01 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 27 Feb 2005 11:35:47 +0000 Subject: 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) --- source4/lib/registry/reg_backend_ldb.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source4/lib/registry') 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="); -- cgit