summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-01-16 15:42:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:11 -0500
commit62e11c4f1748d98f479110c8c0e656a8f65dca4d (patch)
tree24dcb7a044c18fe88f7db18540a0062a3da00200 /source3/rpcclient
parent58efeafa7d0e56766a06e75f473cebb420fe18c3 (diff)
downloadsamba-62e11c4f1748d98f479110c8c0e656a8f65dca4d.tar.gz
samba-62e11c4f1748d98f479110c8c0e656a8f65dca4d.tar.bz2
samba-62e11c4f1748d98f479110c8c0e656a8f65dca4d.zip
r20832: Remove extra pointers previously added to unique [out] pointers. Instead,
add [ref] pointers where necessary (top-level [ref] pointers, by spec, don't appear on the wire). This brings us closer to the DCE/RPC standard again. (This used to be commit 580f2a7197b1bc9db14a643fdd112b40ef37aaef)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_dfs.c10
-rw-r--r--source3/rpcclient/cmd_echo.c6
-rw-r--r--source3/rpcclient/cmd_srvsvc.c10
-rw-r--r--source3/rpcclient/cmd_unixinfo.c8
4 files changed, 18 insertions, 16 deletions
diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c
index e9e26987e5..7e898ddc52 100644
--- a/source3/rpcclient/cmd_dfs.c
+++ b/source3/rpcclient/cmd_dfs.c
@@ -174,7 +174,6 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
struct dfs_EnumStruct str;
- struct dfs_EnumStruct *pstr = &str;
struct dfs_EnumArray1 info1;
struct dfs_EnumArray2 info2;
struct dfs_EnumArray3 info3;
@@ -184,7 +183,6 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS result;
uint32 total = 0;
- uint32 *ptotal = &total;
uint32 unknown = 0;
if (argc > 2) {
@@ -208,8 +206,8 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
break;
}
- result = rpccli_dfs_Enum(cli, mem_ctx, str.level, 0xFFFFFFFF, &pstr,
- &unknown, &ptotal);
+ result = rpccli_dfs_Enum(cli, mem_ctx, str.level, 0xFFFFFFFF, &str,
+ &unknown, &total);
if (NT_STATUS_IS_OK(result))
display_dfs_enumstruct(&str);
@@ -223,7 +221,6 @@ static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
struct dfs_EnumStruct str;
- struct dfs_EnumStruct *pstr = &str;
struct dfs_EnumArray1 info1;
struct dfs_EnumArray2 info2;
struct dfs_EnumArray3 info3;
@@ -233,7 +230,6 @@ static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NTSTATUS result;
uint32 total = 0;
- uint32 *ptotal = &total;
if (argc < 2 || argc > 3) {
printf("Usage: %s dfs_name [info_level]\n", argv[0]);
@@ -256,7 +252,7 @@ static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
}
result = rpccli_dfs_EnumEx(cli, mem_ctx, argv[1], str.level,
- 0xFFFFFFFF, &pstr, &ptotal);
+ 0xFFFFFFFF, &str, &total);
if (NT_STATUS_IS_OK(result))
display_dfs_enumstruct(&str);
diff --git a/source3/rpcclient/cmd_echo.c b/source3/rpcclient/cmd_echo.c
index b8058fa28a..0a06a5c166 100644
--- a/source3/rpcclient/cmd_echo.c
+++ b/source3/rpcclient/cmd_echo.c
@@ -61,11 +61,12 @@ static NTSTATUS cmd_echo_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
size = atoi(argv[1]);
in_data = (uint8 *)SMB_MALLOC(size);
+ out_data = (uint8 *)SMB_MALLOC(size);
for (i = 0; i < size; i++)
in_data[i] = i & 0xff;
- result = rpccli_echo_EchoData(cli, mem_ctx, size, in_data, &out_data);
+ result = rpccli_echo_EchoData(cli, mem_ctx, size, in_data, out_data);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -100,7 +101,8 @@ static NTSTATUS cmd_echo_source_data(struct rpc_pipe_client *cli,
size = atoi(argv[1]);
- result = rpccli_echo_SourceData(cli, mem_ctx, size, &out_data);
+ out_data = SMB_MALLOC(size);
+ result = rpccli_echo_SourceData(cli, mem_ctx, size, out_data);
if (!NT_STATUS_IS_OK(result))
goto done;
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index 1d1c2f7852..87b0fb3531 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -249,7 +249,6 @@ static NTSTATUS cmd_srvsvc_net_share_enum(struct rpc_pipe_client *cli,
union srvsvc_NetShareCtr ctr;
NTSTATUS result;
uint32 hnd;
- uint32 *phnd = &hnd;
uint32 preferred_len = 0xffffffff, i;
uint32 numentries;
@@ -289,7 +288,7 @@ static NTSTATUS cmd_srvsvc_net_share_enum(struct rpc_pipe_client *cli,
result = rpccli_srvsvc_NetShareEnum(
cli, mem_ctx, cli->cli->desthost, &info_level, &ctr, preferred_len, &numentries,
- &phnd);
+ &hnd);
if (!NT_STATUS_IS_OK(result) || !numentries)
goto done;
@@ -367,7 +366,7 @@ static NTSTATUS cmd_srvsvc_net_share_set_info(struct rpc_pipe_client *cli,
uint32 info_level = 502;
union srvsvc_NetShareInfo info_get;
NTSTATUS result;
- uint32 *parm_error = NULL;
+ uint32 parm_error = 0;
if (argc > 3) {
printf("Usage: %s [sharename] [comment]\n", argv[0]);
@@ -402,7 +401,7 @@ static NTSTATUS cmd_srvsvc_net_remote_tod(struct rpc_pipe_client *cli,
{
fstring srv_name_slash;
NTSTATUS result;
- struct srvsvc_NetRemoteTODInfo *tod;
+ struct srvsvc_NetRemoteTODInfo tod;
if (argc > 1) {
printf("Usage: %s\n", argv[0]);
@@ -428,7 +427,6 @@ static NTSTATUS cmd_srvsvc_net_file_enum(struct rpc_pipe_client *cli,
union srvsvc_NetFileCtr ctr;
NTSTATUS result;
uint32 hnd;
- uint32 *phnd = &hnd;
uint32 preferred_len = 0xffff;
uint32 numentries;
@@ -445,7 +443,7 @@ static NTSTATUS cmd_srvsvc_net_file_enum(struct rpc_pipe_client *cli,
ZERO_STRUCT(ctr);
result = rpccli_srvsvc_NetFileEnum(
- cli, mem_ctx, NULL, NULL, NULL, &info_level, &ctr, preferred_len, &numentries, &phnd);
+ cli, mem_ctx, NULL, NULL, NULL, &info_level, &ctr, preferred_len, &numentries, &hnd);
if (!NT_STATUS_IS_OK(result))
goto done;
diff --git a/source3/rpcclient/cmd_unixinfo.c b/source3/rpcclient/cmd_unixinfo.c
index 2b8490706b..1725ce8bfe 100644
--- a/source3/rpcclient/cmd_unixinfo.c
+++ b/source3/rpcclient/cmd_unixinfo.c
@@ -156,8 +156,14 @@ static NTSTATUS cmd_unixinfo_getpwuid(struct rpc_pipe_client *cli,
uids[i] = atoi(argv[i+1]);
}
+ info = TALLOC_ARRAY(mem_ctx, struct unixinfo_GetPWUidInfo, num_uids);
+ if (info == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+
result = rpccli_unixinfo_GetPWUid(cli, mem_ctx, &num_uids, uids,
- &info);
+ info);
if (!NT_STATUS_IS_OK(result)) {
return result;