summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-24 16:17:16 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-28 23:02:56 +0200
commit3935502c67edd436134bac0c663ed3d5b593ec32 (patch)
tree63277ddfdd0766fc4d0c11573cf335c7e8efaf93 /source4/lib/registry
parent77e87e66b0e783cd0717f3fed885fcde629aa434 (diff)
downloadsamba-3935502c67edd436134bac0c663ed3d5b593ec32.tar.gz
samba-3935502c67edd436134bac0c663ed3d5b593ec32.tar.bz2
samba-3935502c67edd436134bac0c663ed3d5b593ec32.zip
s4:lib/registry/ldb.c - retrieve the classname correctly in "ldb_get_subkey_by_id"
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/ldb.c13
1 files changed, 6 insertions, 7 deletions
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;
}