summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_registry.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 62d34184b0..961cfc1553 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -138,17 +138,19 @@ static WERROR registry_enumkey(struct registry_key* parent, const char* keyname,
goto done;
}
- printf("[%s]\n", key->key->name);
-
- for (count = 0;
- werr = reg_enumkey(ctx, key, count, &subkey_name, &modtime),
- W_ERROR_IS_OK(werr);
- count++)
- {
- print_registry_key(subkey_name, &modtime);
- }
- if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
- goto done;
+ if (recursive) {
+ printf("[%s]\n\n", key->key->name);
+ } else {
+ for (count = 0;
+ werr = reg_enumkey(ctx, key, count, &subkey_name, &modtime),
+ W_ERROR_IS_OK(werr);
+ count++)
+ {
+ print_registry_key(subkey_name, &modtime);
+ }
+ if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
+ goto done;
+ }
}
for (count = 0;
@@ -180,7 +182,9 @@ static WERROR registry_enumkey(struct registry_key* parent, const char* keyname,
if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
goto done;
}
+
werr = WERR_OK;
+
done:
TALLOC_FREE(ctx);
return werr;