summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2008-09-12 16:41:49 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-21 23:17:58 +0200
commitfaa4ac2a52cee89be66a11604dd65871b3b70a6b (patch)
tree905e7ce7437b58224f91b127d7535bef0d57539d
parent2121c1bb2967f0aa8cc6903c507eb2c22a25b341 (diff)
downloadsamba-faa4ac2a52cee89be66a11604dd65871b3b70a6b.tar.gz
samba-faa4ac2a52cee89be66a11604dd65871b3b70a6b.tar.bz2
samba-faa4ac2a52cee89be66a11604dd65871b3b70a6b.zip
Registry tool "regtree": Handle the default attribute in the right way
This commit introduces the default attribute in "regtree"
-rw-r--r--source4/lib/registry/tools/regtree.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index 19e4a010b4..fef9c7ee49 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -40,8 +40,8 @@ static void print_tree(int level, struct registry_key *p,
struct registry_key *subkey;
const char *valuename;
const char *keyname;
- uint32_t value_type;
- DATA_BLOB value_data;
+ uint32_t valuetype;
+ DATA_BLOB valuedata;
struct security_descriptor *sec_desc;
WERROR error;
int i;
@@ -73,18 +73,24 @@ static void print_tree(int level, struct registry_key *p,
if (!novals) {
mem_ctx = talloc_init("print_tree");
- for(i = 0; W_ERROR_IS_OK(error = reg_key_get_value_by_index(mem_ctx,
- p,
- i,
- &valuename,
- &value_type,
- &value_data)); i++) {
+ /* default value */
+ if (W_ERROR_IS_OK(reg_key_get_value_by_index(mem_ctx, p, 0,
+ &valuename, &valuetype, &valuedata))) {
int j;
- char *desc;
for(j = 0; j < level+1; j++) putchar(' ');
- desc = reg_val_description(mem_ctx, lp_iconv_convenience(cmdline_lp_ctx), valuename,
- value_type, value_data);
- printf("%s\n", desc);
+ printf("%s\n", reg_val_description(mem_ctx,
+ lp_iconv_convenience(cmdline_lp_ctx),
+ "(Default)", valuetype, valuedata));
+ }
+ /* other values */
+ for(i = 1; W_ERROR_IS_OK(error = reg_key_get_value_by_index(
+ mem_ctx, p, i, &valuename, &valuetype, &valuedata));
+ i++) {
+ int j;
+ for(j = 0; j < level+1; j++) putchar(' ');
+ printf("%s\n", reg_val_description(mem_ctx,
+ lp_iconv_convenience(cmdline_lp_ctx), valuename,
+ valuetype, valuedata));
}
talloc_free(mem_ctx);