mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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)
This commit is contained in:
parent
b33be58874
commit
aed95ba66f
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user