summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-05-15 12:55:54 +0200
committerMichael Adam <obnox@samba.org>2008-05-15 17:17:55 +0200
commit49835c6d9e5b838484e6e806b80d8acb7ef2ef5a (patch)
tree7a17dc1f12ab10c300adb0aab5a497d1770b2b44 /source3
parentf255ac9775bc86ec38855ed441aca49893353ba3 (diff)
downloadsamba-49835c6d9e5b838484e6e806b80d8acb7ef2ef5a.tar.gz
samba-49835c6d9e5b838484e6e806b80d8acb7ef2ef5a.tar.bz2
samba-49835c6d9e5b838484e6e806b80d8acb7ef2ef5a.zip
net_registry: add raw output of value to print_registry_value().
Michael (This used to be commit 340a706422cbca45cc63fa94d36c88f6751f4f31)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_registry.c2
-rw-r--r--source3/utils/net_registry_util.c45
-rw-r--r--source3/utils/net_registry_util.h2
-rw-r--r--source3/utils/net_rpc_registry.c2
4 files changed, 37 insertions, 14 deletions
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 89eadb50f9..a06a067ee3 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -291,7 +291,7 @@ static int net_registry_getvalue(struct net_context *c, int argc,
goto done;
}
- print_registry_value(value);
+ print_registry_value(value, false);
ret = 0;
diff --git a/source3/utils/net_registry_util.c b/source3/utils/net_registry_util.c
index ca80e60ec3..278377867a 100644
--- a/source3/utils/net_registry_util.c
+++ b/source3/utils/net_registry_util.c
@@ -32,32 +32,55 @@ void print_registry_key(const char *keyname, NTTIME *modtime)
d_printf("\n");
}
-void print_registry_value(const struct registry_value *valvalue)
+void print_registry_value(const struct registry_value *valvalue, bool raw)
{
- d_printf("Type = %s\n",
- reg_type_lookup(valvalue->type));
+ if (!raw) {
+ d_printf("Type = %s\n",
+ reg_type_lookup(valvalue->type));
+ }
switch(valvalue->type) {
case REG_DWORD:
- d_printf("Value = %d\n", valvalue->v.dword);
+ if (!raw) {
+ d_printf("Value = ");
+ }
+ d_printf("%d\n", valvalue->v.dword);
break;
case REG_SZ:
case REG_EXPAND_SZ:
- d_printf("Value = \"%s\"\n", valvalue->v.sz.str);
+ if (!raw) {
+ d_printf("Value = \"");
+ }
+ d_printf("%s", valvalue->v.sz.str);
+ if (!raw) {
+ d_printf("\"");
+ }
+ d_printf("\n");
break;
case REG_MULTI_SZ: {
uint32 j;
for (j = 0; j < valvalue->v.multi_sz.num_strings; j++) {
- d_printf("Value[%3.3d] = \"%s\"\n", j,
- valvalue->v.multi_sz.strings[j]);
+ if (!raw) {
+ d_printf("Value[%3.3d] = \"", j);
+ }
+ d_printf("%s", valvalue->v.multi_sz.strings[j]);
+ if (!raw) {
+ d_printf("\"");
+ }
+ d_printf("\n");
}
break;
}
case REG_BINARY:
- d_printf("Value = %d bytes\n",
- (int)valvalue->v.binary.length);
+ if (!raw) {
+ d_printf("Value = ");
+ }
+ d_printf("%d bytes\n", (int)valvalue->v.binary.length);
break;
default:
- d_printf("Value = <unprintable>\n");
+ if (!raw) {
+ d_printf("Value = ");
+ }
+ d_printf("<unprintable>\n");
break;
}
}
@@ -66,7 +89,7 @@ void print_registry_value_with_name(const char *valname,
const struct registry_value *valvalue)
{
d_printf("Valuename = %s\n", valname);
- print_registry_value(valvalue);
+ print_registry_value(valvalue, false);
d_printf("\n");
}
diff --git a/source3/utils/net_registry_util.h b/source3/utils/net_registry_util.h
index 09aaa8394b..61fd834a3c 100644
--- a/source3/utils/net_registry_util.h
+++ b/source3/utils/net_registry_util.h
@@ -24,7 +24,7 @@
void print_registry_key(const char *keyname, NTTIME *modtime);
-void print_registry_value(const struct registry_value *valvalue);
+void print_registry_value(const struct registry_value *valvalue, bool raw);
void print_registry_value_with_name(const char *valname,
const struct registry_value *valvalue);
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 5da19934dc..8832ad96f3 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -568,7 +568,7 @@ static NTSTATUS rpc_registry_getvalue_internal(struct net_context *c,
goto done;
}
- print_registry_value(value);
+ print_registry_value(value, false);
done:
rpccli_winreg_CloseKey(pipe_hnd, tmp_ctx, &key_hnd, NULL);