summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-30 20:00:52 +0200
committerGünther Deschner <gd@samba.org>2009-10-01 11:40:30 +0200
commitad836c4d48e7c7a8a6f1d240f20cca730487a651 (patch)
treeaeab897279f88524727cc4c7703ff5e1dca77938 /source3/utils
parent98245727c9a314849248e5419b347b444e79a2f7 (diff)
downloadsamba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.tar.gz
samba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.tar.bz2
samba-ad836c4d48e7c7a8a6f1d240f20cca730487a651.zip
s3-registry: use pull_reg_sz() where appropriate.
(and move away from rpcstr_pull and rpcstr_pull_talloc). Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_printer.c12
-rw-r--r--source3/utils/net_rpc_registry.c10
2 files changed, 9 insertions, 13 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 9a8e0a9ba6..5652caf834 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -72,7 +72,8 @@ static void display_print_driver3(struct spoolss_DriverInfo3 *r)
static void display_reg_value(const char *subkey, struct regval_blob value)
{
- char *text;
+ const char *text;
+ DATA_BLOB blob;
switch(value.type) {
case REG_DWORD:
@@ -81,11 +82,8 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
break;
case REG_SZ:
- rpcstr_pull_talloc(talloc_tos(),
- &text,
- value.data_p,
- value.size,
- STR_TERMINATE);
+ blob = data_blob_const(value.data_p, value.size);
+ pull_reg_sz(talloc_tos(), &blob, &text);
if (!text) {
break;
}
@@ -102,7 +100,7 @@ static void display_reg_value(const char *subkey, struct regval_blob value)
case REG_MULTI_SZ: {
uint32_t i;
const char **values;
- DATA_BLOB blob = data_blob_const(value.data_p, value.size);
+ blob = data_blob_const(value.data_p, value.size);
if (!pull_reg_multi_sz(NULL, &blob, &values)) {
d_printf("pull_reg_multi_sz failed\n");
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 1ad1d74ca0..d9eb9b3c09 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -895,8 +895,9 @@ static int rpc_registry_save(struct net_context *c, int argc, const char **argv
static void dump_values( REGF_NK_REC *nk )
{
int i, j;
- char *data_str = NULL;
+ const char *data_str = NULL;
uint32 data_size, data;
+ DATA_BLOB blob;
if ( !nk->values )
return;
@@ -908,11 +909,8 @@ static void dump_values( REGF_NK_REC *nk )
data_size = nk->values[i].data_size & ~VK_DATA_IN_OFFSET;
switch ( nk->values[i].type ) {
case REG_SZ:
- rpcstr_pull_talloc(talloc_tos(),
- &data_str,
- nk->values[i].data,
- -1,
- STR_TERMINATE);
+ blob = data_blob_const(nk->values[i].data, data_size);
+ pull_reg_sz(talloc_tos(), &blob, &data_str);
if (!data_str) {
break;
}