summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-05-30 16:54:47 +0200
committerMichael Adam <obnox@samba.org>2011-05-30 17:42:27 +0200
commit0d746f653e76de52985d543a15fd6ee3bf2f4823 (patch)
treeba9c2d686d73c7447fb6babdc42b743f8946723b /source3/utils
parent5ec479fa0c9db4072541d46345164542d037cfc9 (diff)
downloadsamba-0d746f653e76de52985d543a15fd6ee3bf2f4823.tar.gz
samba-0d746f653e76de52985d543a15fd6ee3bf2f4823.tar.bz2
samba-0d746f653e76de52985d543a15fd6ee3bf2f4823.zip
s3:net registry: polish output of net registry enumerate[_recursive]
so that net registry enumerate output is as before, and net registry enumerate_recursive is formatted more nicely
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;