summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-10-11 13:57:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:47 -0500
commitaed95ba66f29b9536e99027fab5327548b984b70 (patch)
tree70b13333b24c590b7da16837913e63de9f85a83d
parentb33be588743fde1c95bd5a639585326c3e74cd85 (diff)
downloadsamba-aed95ba66f29b9536e99027fab5327548b984b70.tar.gz
samba-aed95ba66f29b9536e99027fab5327548b984b70.tar.bz2
samba-aed95ba66f29b9536e99027fab5327548b984b70.zip
r2913: - Don't print hive name if it is NULL (regtree)
- Initialise hive name (reg_interface) - Fix LDB backend (enumerating keys works now!) (This used to be commit 5086d6b2494f236ef67096b2dd4da4f7402a65c5)
-rw-r--r--source4/lib/registry/common/reg_interface.c1
-rw-r--r--source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c9
-rw-r--r--source4/lib/registry/tools/regtree.c11
3 files changed, 9 insertions, 12 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c
index 28025e4d84..16edadfcbb 100644
--- a/source4/lib/registry/common/reg_interface.c
+++ b/source4/lib/registry/common/reg_interface.c
@@ -185,6 +185,7 @@ WERROR reg_import_hive(struct registry_context *h, const char *backend, const ch
ret->functions = entry->functions;
ret->backend_data = NULL;
ret->reg_ctx = h;
+ ret->name = NULL;
werr = entry->functions->open_hive(mem_ctx, ret, &ret->root);
diff --git a/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
index cc0432d9ea..7e228412d5 100644
--- a/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
+++ b/source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
@@ -51,8 +51,6 @@ static char *reg_path_to_ldb(TALLOC_CTX *mem_ctx, const char *path, const char *
ret[strlen(ret)-1] = '\0';
- printf("RETURNING: %s\n", ret);
-
if(strlen(ret) == 0) return NULL;
return ret;
@@ -65,9 +63,6 @@ static int ldb_close_registry(void *data)
return 0;
}
-
-
-
static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, struct registry_key *p, const char *name, uint32_t access_mask, SEC_DESC *sec, struct registry_key **new)
{
return WERR_NOT_SUPPORTED;
@@ -94,7 +89,6 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k,
*subkey = talloc_p(mem_ctx, struct registry_key);
(*subkey)->name = talloc_strdup(mem_ctx, el->values[0].data);
(*subkey)->backend_data = talloc_strdup(mem_ctx, msg[idx]->dn);
- printf("Retrieved: %s\n", (*subkey)->backend_data);
ldb_search_free(c, msg);
return WERR_OK;
@@ -158,7 +152,6 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, struct registry_hive *h, const c
*key = talloc_p(mem_ctx, struct registry_key);
(*key)->name = talloc_strdup(mem_ctx, strrchr(name, '\\'));
(*key)->backend_data = talloc_strdup(mem_ctx, msg[0]->dn);
- printf("Retrieved: %s\n", (*key)->backend_data);
ldb_search_free(c, msg);
@@ -183,7 +176,7 @@ static struct registry_operations reg_backend_ldb = {
.name = "ldb",
.open_hive = ldb_open_hive,
.open_key = ldb_open_key,
-/* .fetch_subkeys = ldb_fetch_subkeys,
+/*
.fetch_values = ldb_fetch_values,*/
.get_subkey_by_index = ldb_get_subkey_by_id,
.add_key = ldb_add_key,
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index 9748ca3438..bc0055a891 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -32,10 +32,13 @@ static void print_tree(int l, struct registry_key *p, int fullpath, int novals)
for(i = 0; i < l; i++) putchar(' ');
/* Hive name */
- if(p->hive->root == p) printf("%s\n", p->hive->name);
- else if(!p->name) printf("<No Name>\n");
- else if(fullpath) printf("%s\n", p->path);
- else printf("%s\n", p->name);
+ if(p->hive->root == p) {
+ if(p->hive->name) printf("%s\n", p->hive->name); else printf("<No Name>\n");
+ } else {
+ if(!p->name) printf("<No Name>\n");
+ if(fullpath) printf("%s\n", p->path);
+ else printf("%s\n", p->name);
+ }
mem_ctx = talloc_init("print_tree");
for(i = 0; W_ERROR_IS_OK(error = reg_key_get_subkey_by_index(mem_ctx, p, i, &subkey)); i++) {