summaryrefslogtreecommitdiff
path: root/source4/lib/registry/reg_backend_ldb.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-10 22:57:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:30 -0500
commitf0eff2525b8df834765a7162007bc8b4565e9a58 (patch)
treed0903882670ba66ec968a0bc2dce80d97fe6e6b1 /source4/lib/registry/reg_backend_ldb.c
parentd792ee488372c7259567d12b141cf449c0bdb6a8 (diff)
downloadsamba-f0eff2525b8df834765a7162007bc8b4565e9a58.tar.gz
samba-f0eff2525b8df834765a7162007bc8b4565e9a58.tar.bz2
samba-f0eff2525b8df834765a7162007bc8b4565e9a58.zip
r4140: Get rid of close_hive (replace it with talloc destructors).
(This used to be commit bcbfce7b0119538bab06801c97aa9c7d4bf3a6c6)
Diffstat (limited to 'source4/lib/registry/reg_backend_ldb.c')
-rw-r--r--source4/lib/registry/reg_backend_ldb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c
index 7804a68d3d..b20a56046d 100644
--- a/source4/lib/registry/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb.c
@@ -29,6 +29,15 @@ struct ldb_key_data
int subkey_count, value_count;
};
+static int ldb_close_hive (void *_hive)
+{
+ struct registry_hive *hive = _hive;
+ ldb_close (hive->backend_data);
+ return 0;
+}
+
+
+
static int reg_close_ldb_key (void *data)
{
struct registry_key *key = data;
@@ -189,6 +198,7 @@ static WERROR ldb_open_hive(struct registry_hive *hive, struct registry_key **k)
hive->root = talloc_zero_p(hive, struct registry_key);
talloc_set_destructor (hive->root, reg_close_ldb_key);
+ talloc_set_destructor (hive, ldb_close_hive);
hive->root->name = talloc_strdup(hive->root, "");
hive->root->backend_data = kd = talloc_zero_p(hive->root, struct ldb_key_data);
kd->dn = talloc_strdup(hive->root, "key=root");
@@ -240,18 +250,11 @@ static WERROR ldb_del_key (struct registry_key *key)
return WERR_OK;
}
-static WERROR ldb_close_hive (struct registry_hive *hive)
-{
- ldb_close (hive->backend_data);
- return WERR_OK;
-}
-
static struct hive_operations reg_backend_ldb = {
.name = "ldb",
.add_key = ldb_add_key,
.del_key = ldb_del_key,
.open_hive = ldb_open_hive,
- .close_hive = ldb_close_hive,
.open_key = ldb_open_key,
.get_value_by_index = ldb_get_value_by_id,
.get_subkey_by_index = ldb_get_subkey_by_id,