summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2008-09-13 13:32:39 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:40:41 +0200
commite23e99764436b9a8432dd6552d12c3ad82a27362 (patch)
tree9848729178674beb8080857cc0307e3148952d1b /source4/lib
parentf58f74949d1c596a9c696dc71b325f7d4475fc5f (diff)
downloadsamba-e23e99764436b9a8432dd6552d12c3ad82a27362.tar.gz
samba-e23e99764436b9a8432dd6552d12c3ad82a27362.tar.bz2
samba-e23e99764436b9a8432dd6552d12c3ad82a27362.zip
Registry server: More work to be compatible
Some fixup's and assure, that we send only initialized values.
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/ldb.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 42c99fbb24..e384fdbaf0 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -258,6 +258,15 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx,
{
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 */
+ if (last_mod_time != NULL)
+ *last_mod_time = 0; /* TODO: we need to add this to the
+ ldb backend properly */
/* Do a search if necessary */
if (kd->subkeys == NULL) {
@@ -274,13 +283,6 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx,
if (name != NULL)
*name = talloc_strdup(mem_ctx, (char *)el->values[0].data);
- if (classname != NULL)
- *classname = NULL; /* TODO: Store properly */
-
- if (last_mod_time != NULL)
- *last_mod_time = 0; /* TODO: we need to add this to the
- ldb backend properly */
-
return WERR_OK;
}
@@ -729,6 +731,22 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
{
struct ldb_key_data *kd = talloc_get_type(key, struct ldb_key_data);
+ /* Initialization */
+ if (classname != NULL)
+ *classname = NULL;
+ if (num_subkeys != NULL)
+ *num_subkeys = 0;
+ if (num_values != NULL)
+ *num_values = 0;
+ if (last_change_time != NULL)
+ *last_change_time = 0;
+ if (max_subkeynamelen != NULL)
+ *max_subkeynamelen = 0;
+ if (max_valnamelen != NULL)
+ *max_valnamelen = 0;
+ if (max_valbufsize != NULL)
+ *max_valbufsize = 0;
+
if (kd->subkeys == NULL) {
W_ERROR_NOT_OK_RETURN(cache_subkeys(kd));
}
@@ -737,20 +755,13 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
W_ERROR_NOT_OK_RETURN(cache_values(kd));
}
- /* FIXME */
- if (classname != NULL)
- *classname = NULL;
-
if (num_subkeys != NULL) {
*num_subkeys = kd->subkey_count;
}
-
if (num_values != NULL) {
*num_values = kd->value_count;
}
- if (last_change_time != NULL)
- *last_change_time = 0;
if (max_subkeynamelen != NULL) {
int i;