summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-02-19 22:52:50 +0000
committerTim Potter <tpot@samba.org>2003-02-19 22:52:50 +0000
commit7024ab8dcaab5ee590975fc8660dfd37e0b6a776 (patch)
treec27df53b5a097b8cd8e6794c57c1676b42aec70e /source3
parentaa1a248336776079ba305744d35f529bd17d2e94 (diff)
downloadsamba-7024ab8dcaab5ee590975fc8660dfd37e0b6a776.tar.gz
samba-7024ab8dcaab5ee590975fc8660dfd37e0b6a776.tar.bz2
samba-7024ab8dcaab5ee590975fc8660dfd37e0b6a776.zip
Merge NTSTATUS vs WERROR return for cli_srvsvc_net_srv_get_info()
(This used to be commit 7edaf937963fa1d0f06343969b46ed6e4f39a6ea)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_srvsvc.c18
-rw-r--r--source3/rpcclient/cmd_srvsvc.c7
2 files changed, 10 insertions, 15 deletions
diff --git a/source3/rpc_client/cli_srvsvc.c b/source3/rpc_client/cli_srvsvc.c
index 1bdd19620b..b6c6b377ff 100644
--- a/source3/rpc_client/cli_srvsvc.c
+++ b/source3/rpc_client/cli_srvsvc.c
@@ -23,14 +23,14 @@
#include "includes.h"
-NTSTATUS cli_srvsvc_net_srv_get_info(struct cli_state *cli,
- TALLOC_CTX *mem_ctx,
- uint32 switch_value, SRV_INFO_CTR *ctr)
+WERROR cli_srvsvc_net_srv_get_info(struct cli_state *cli,
+ TALLOC_CTX *mem_ctx,
+ uint32 switch_value, SRV_INFO_CTR *ctr)
{
prs_struct qbuf, rbuf;
SRV_Q_NET_SRV_GET_INFO q;
SRV_R_NET_SRV_GET_INFO r;
- NTSTATUS result;
+ WERROR result = W_ERROR(ERRgeneral);
ZERO_STRUCT(q);
ZERO_STRUCT(r);
@@ -47,21 +47,17 @@ NTSTATUS cli_srvsvc_net_srv_get_info(struct cli_state *cli,
/* Marshall data and send request */
if (!srv_io_q_net_srv_get_info("", &q, &qbuf, 0) ||
- !rpc_api_pipe_req(cli, SRV_NET_SRV_GET_INFO, &qbuf, &rbuf)) {
- result = NT_STATUS_UNSUCCESSFUL;
+ !rpc_api_pipe_req(cli, SRV_NET_SRV_GET_INFO, &qbuf, &rbuf))
goto done;
- }
/* Unmarshall response */
r.ctr = ctr;
- if (!srv_io_r_net_srv_get_info("", &r, &rbuf, 0)) {
- result = NT_STATUS_UNSUCCESSFUL;
+ if (!srv_io_r_net_srv_get_info("", &r, &rbuf, 0))
goto done;
- }
- result = werror_to_ntstatus(r.status);
+ result = r.status;
done:
prs_mem_free(&qbuf);
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index 282cbb3b99..10fdfd7437 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -179,14 +179,13 @@ static void display_srv_info_102(SRV_INFO_102 *sv102)
}
/* Server query info */
-
static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
int argc, char **argv)
{
uint32 info_level = 101;
SRV_INFO_CTR ctr;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ WERROR result;
if (argc > 2) {
printf("Usage: %s [infolevel]\n", argv[0]);
@@ -199,7 +198,7 @@ static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli,
result = cli_srvsvc_net_srv_get_info(cli, mem_ctx, info_level,
&ctr);
- if (!NT_STATUS_IS_OK(result)) {
+ if (!W_ERROR_IS_OK(result)) {
goto done;
}
@@ -218,7 +217,7 @@ static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli,
}
done:
- return result;
+ return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
}
static void display_share_info_1(SRV_SHARE_INFO_1 *info1)