diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-28 21:15:17 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-28 23:02:56 +0200 |
commit | 094c1034d2fb11e746261ff5b5048cd52fce2938 (patch) | |
tree | 830054b02b40db125b55247ebf60b76a647fc59c /source4/lib/registry | |
parent | 2fb3d8a6cc94bd74974a2cc11996a2032774b08c (diff) | |
download | samba-094c1034d2fb11e746261ff5b5048cd52fce2938.tar.gz samba-094c1034d2fb11e746261ff5b5048cd52fce2938.tar.bz2 samba-094c1034d2fb11e746261ff5b5048cd52fce2938.zip |
s4:lib/ldb/registry.c - handle the classname in the right way
This is for "ldb_get_key_info".
Diffstat (limited to 'source4/lib/registry')
-rw-r--r-- | source4/lib/registry/ldb.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; } |