1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-12 04:23:49 +03:00

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 commit is contained in:
Simo Sorce
2005-02-27 11:35:47 +00:00
committed by Gerald (Jerry) Carter
parent e77a070c84
commit d58be9e74b
30 changed files with 438 additions and 428 deletions

View File

@@ -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=");