summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-21 02:21:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:57 -0500
commit202f63e476fc1dc60d9f1271673b292288cfb436 (patch)
tree4462f5deb76f7115067a1bdcb4baf5cb23e21cb0 /source3/utils
parent95bfb975472f5cf63bb0ef2d19ae89945232883f (diff)
downloadsamba-202f63e476fc1dc60d9f1271673b292288cfb436.tar.gz
samba-202f63e476fc1dc60d9f1271673b292288cfb436.tar.bz2
samba-202f63e476fc1dc60d9f1271673b292288cfb436.zip
r19811: Decode REG_MULTI_SZ and REG_BINARY
(This used to be commit 679330175185f8504bb5968339dcc7cb20d9140c)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_printer.c2
-rw-r--r--source3/utils/net_rpc_registry.c26
2 files changed, 26 insertions, 2 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index dc3cb42dbe..5a18253aaf 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -129,7 +129,7 @@ static void display_reg_value(const char *subkey, REGISTRY_VALUE value)
break;
case REG_MULTI_SZ: {
- int i, num_values;
+ uint32 i, num_values;
char **values;
if (!NT_STATUS_IS_OK(reg_pull_multi_sz(NULL, value.data_p,
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index a04c527502..45598c49f5 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -197,7 +197,7 @@ static NTSTATUS registry_pull_value(TALLOC_CTX *mem_ctx,
struct registry_value *value;
NTSTATUS status;
- if (!(value = TALLOC_P(mem_ctx, struct registry_value))) {
+ if (!(value = TALLOC_ZERO_P(mem_ctx, struct registry_value))) {
return NT_STATUS_NO_MEMORY;
}
@@ -247,6 +247,18 @@ static NTSTATUS registry_pull_value(TALLOC_CTX *mem_ctx,
}
break;
}
+ case REG_MULTI_SZ:
+ status = reg_pull_multi_sz(value, (void *)data, length,
+ &value->v.multi_sz.num_strings,
+ &value->v.multi_sz.strings);
+ if (!(NT_STATUS_IS_OK(status))) {
+ goto error;
+ }
+ break;
+ case REG_BINARY:
+ value->v.binary.data = talloc_move(value, &data);
+ value->v.binary.length = length;
+ break;
default:
status = NT_STATUS_INVALID_PARAMETER;
goto error;
@@ -466,6 +478,18 @@ static NTSTATUS rpc_registry_enumerate_internal(const DOM_SID *domain_sid,
case REG_EXPAND_SZ:
d_printf("Value = \"%s\"\n", v->v.sz.str);
break;
+ case REG_MULTI_SZ: {
+ uint32 j;
+ for (j = 0; j < v->v.multi_sz.num_strings; j++) {
+ d_printf("Value[%3.3d] = \"%s\"\n", j,
+ v->v.multi_sz.strings[j]);
+ }
+ break;
+ }
+ case REG_BINARY:
+ d_printf("Value = %d bytes\n",
+ v->v.binary.length);
+ break;
default:
d_printf("Value = <unprintable>\n");
break;