summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c5
-rw-r--r--source3/rpcclient/cmd_test.c18
-rw-r--r--source3/rpcclient/rpcclient.c13
3 files changed, 23 insertions, 13 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 0876d82878..d9cc3c67f5 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -2680,8 +2680,9 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
if ( !NT_STATUS_IS_OK(nt_status) )
return WERR_GENERAL_FAILURE;
- cli2 = cli_rpc_pipe_open_noauth(cli_server2, PI_SPOOLSS, &nt_status);
- if (!cli2) {
+ nt_status = cli_rpc_pipe_open_noauth(cli_server2, &syntax_spoolss,
+ &cli2);
+ if (!NT_STATUS_IS_OK(nt_status)) {
printf("failed to open spoolss pipe on server %s (%s)\n",
servername2, nt_errstr(nt_status));
return WERR_GENERAL_FAILURE;
diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c
index dd956604cc..599e4c255d 100644
--- a/source3/rpcclient/cmd_test.c
+++ b/source3/rpcclient/cmd_test.c
@@ -30,13 +30,19 @@ static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
d_printf("testme\n");
- lsa_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
- PI_LSARPC, &status);
- if (lsa_pipe == NULL) goto done;
+ status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
+ &ndr_table_lsarpc.syntax_id,
+ &lsa_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
- samr_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
- PI_SAMR, &status);
- if (samr_pipe == NULL) goto done;
+ status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
+ &ndr_table_samr.syntax_id,
+ &samr_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
SEC_RIGHTS_QUERY_VALUE, &pol);
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 35ff14ef2d..ff98a24fba 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -145,7 +145,9 @@ static void fetch_machine_sid(struct cli_state *cli)
goto error;
}
- if ((lsapipe = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result)) == NULL) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &lsapipe);
+ if (!NT_STATUS_IS_OK(result)) {
fprintf(stderr, "could not initialise lsa pipe. Error was %s\n", nt_errstr(result) );
goto error;
}
@@ -578,9 +580,10 @@ static NTSTATUS do_cmd(struct cli_state *cli,
if (cmd_entry->pipe_idx != -1 && cmd_entry->rpc_pipe == NULL) {
switch (pipe_default_auth_type) {
case PIPE_AUTH_TYPE_NONE:
- cmd_entry->rpc_pipe = cli_rpc_pipe_open_noauth(cli,
- cmd_entry->pipe_idx,
- &ntresult);
+ ntresult = cli_rpc_pipe_open_noauth(
+ cli,
+ cli_get_iface(cmd_entry->pipe_idx),
+ &cmd_entry->rpc_pipe);
break;
case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
cmd_entry->rpc_pipe = cli_rpc_pipe_open_spnego_ntlmssp(cli,
@@ -613,7 +616,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
pipe_default_auth_type ));
return NT_STATUS_UNSUCCESSFUL;
}
- if (!cmd_entry->rpc_pipe) {
+ if (!NT_STATUS_IS_OK(ntresult)) {
DEBUG(0, ("Could not initialise %s. Error was %s\n",
cli_get_pipe_name(cmd_entry->pipe_idx),
nt_errstr(ntresult) ));