From 3935502c67edd436134bac0c663ed3d5b593ec32 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 24 Jun 2010 16:17:16 +0200 Subject: s4:lib/registry/ldb.c - retrieve the classname correctly in "ldb_get_subkey_by_id" --- source4/lib/registry/ldb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source4/lib/registry/ldb.c') diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index 5aea30a287..9295486ec9 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -372,14 +372,13 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, const char **classname, NTTIME *last_mod_time) { - struct ldb_message_element *el; struct ldb_key_data *kd = talloc_get_type(k, struct ldb_key_data); /* Initialization */ if (name != NULL) *name = NULL; if (classname != NULL) - *classname = NULL; /* TODO: Store properly */ + *classname = NULL; if (last_mod_time != NULL) *last_mod_time = 0; /* TODO: we need to add this to the ldb backend properly */ @@ -392,12 +391,12 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, if (idx >= kd->subkey_count) return WERR_NO_MORE_ITEMS; - el = ldb_msg_find_element(kd->subkeys[idx], "key"); - SMB_ASSERT(el != NULL); - SMB_ASSERT(el->num_values != 0); - if (name != NULL) - *name = talloc_strdup(mem_ctx, (char *)el->values[0].data); + *name = talloc_strdup(mem_ctx, + ldb_msg_find_attr_as_string(kd->subkeys[idx], "key", NULL)); + if (classname != NULL) + *classname = talloc_strdup(mem_ctx, + ldb_msg_find_attr_as_string(kd->subkeys[idx], "classname", NULL)); return WERR_OK; } -- cgit