From 094c1034d2fb11e746261ff5b5048cd52fce2938 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 28 Jun 2010 21:15:17 +0200 Subject: s4:lib/ldb/registry.c - handle the classname in the right way This is for "ldb_get_key_info". --- source4/lib/registry/ldb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/lib/registry/ldb.c') diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index 20a892c151..b2b1e745f3 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -35,6 +35,7 @@ struct ldb_key_data struct ldb_dn *dn; struct ldb_message **subkeys, **values; unsigned int subkey_count, value_count; + const char *classname; }; static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, @@ -524,6 +525,8 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct hive_key *h, newkd->key.ops = ®_backend_ldb; newkd->ldb = talloc_reference(newkd, kd->ldb); newkd->dn = ldb_dn_copy(mem_ctx, res->msgs[0]->dn); + newkd->classname = talloc_steal(newkd, + ldb_msg_find_attr_as_string(res->msgs[0], "classname", NULL); *key = (struct hive_key *)newkd; @@ -616,6 +619,7 @@ static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, const struct hive_key *parent, newkd->ldb = talloc_reference(newkd, parentkd->ldb); newkd->key.ops = ®_backend_ldb; newkd->dn = talloc_steal(newkd, msg->dn); + newkd->classname = talloc_steal(newkd, classname); *newkey = (struct hive_key *)newkd; @@ -903,11 +907,14 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx, if (kd->subkeys == NULL) { W_ERROR_NOT_OK_RETURN(cache_subkeys(kd)); } - if (kd->values == NULL) { W_ERROR_NOT_OK_RETURN(cache_values(kd)); } + if (classname != NULL) { + *classname = kd->classname; + } + if (num_subkeys != NULL) { *num_subkeys = kd->subkey_count; } -- cgit