mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
r23380: netr_getdcname returns WERROR not NTSTATUS.
Guenther (This used to be commit 5e75ea7f2b568d76c8ced5f43171741532cc97c2)
This commit is contained in:
parent
774ceeea50
commit
1ea5dfae04
@ -442,7 +442,7 @@ typedef struct net_q_getdcname {
|
||||
typedef struct net_r_getdcname {
|
||||
uint32 ptr_dcname;
|
||||
UNISTR2 uni_dcname;
|
||||
NTSTATUS status;
|
||||
WERROR status;
|
||||
} NET_R_GETDCNAME;
|
||||
|
||||
/* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */
|
||||
|
@ -420,14 +420,14 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
|
||||
|
||||
/* GetDCName */
|
||||
|
||||
NTSTATUS rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
|
||||
WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
|
||||
TALLOC_CTX *mem_ctx, const char *mydcname,
|
||||
const char *domainname, fstring newdcname)
|
||||
{
|
||||
prs_struct qbuf, rbuf;
|
||||
NET_Q_GETDCNAME q;
|
||||
NET_R_GETDCNAME r;
|
||||
NTSTATUS result;
|
||||
WERROR result;
|
||||
fstring mydcname_slash;
|
||||
|
||||
ZERO_STRUCT(q);
|
||||
@ -440,16 +440,16 @@ NTSTATUS rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
|
||||
|
||||
/* Marshall data and send request */
|
||||
|
||||
CLI_DO_RPC(cli, mem_ctx, PI_NETLOGON, NET_GETDCNAME,
|
||||
CLI_DO_RPC_WERR(cli, mem_ctx, PI_NETLOGON, NET_GETDCNAME,
|
||||
q, r,
|
||||
qbuf, rbuf,
|
||||
net_io_q_getdcname,
|
||||
net_io_r_getdcname,
|
||||
NT_STATUS_UNSUCCESSFUL);
|
||||
WERR_GENERAL_FAILURE);
|
||||
|
||||
result = r.status;
|
||||
|
||||
if (NT_STATUS_IS_OK(result)) {
|
||||
if (W_ERROR_IS_OK(result)) {
|
||||
rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,7 @@ BOOL net_io_r_getdcname(const char *desc, NET_R_GETDCNAME *r_t, prs_struct *ps,
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if (!prs_ntstatus("status", ps, depth, &r_t->status))
|
||||
if (!prs_werror("status", ps, depth, &r_t->status))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -76,17 +76,17 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
|
||||
return result;
|
||||
}
|
||||
|
||||
static NTSTATUS cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
|
||||
static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
|
||||
TALLOC_CTX *mem_ctx, int argc,
|
||||
const char **argv)
|
||||
{
|
||||
fstring dcname;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
WERROR result = WERR_GENERAL_FAILURE;
|
||||
int old_timeout;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s domainname\n", argv[0]);
|
||||
return NT_STATUS_OK;
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/* Make sure to wait for our DC's reply */
|
||||
@ -96,7 +96,7 @@ static NTSTATUS cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
|
||||
|
||||
cli_set_timeout(cli->cli, old_timeout);
|
||||
|
||||
if (!NT_STATUS_IS_OK(result))
|
||||
if (!W_ERROR_IS_OK(result))
|
||||
goto done;
|
||||
|
||||
/* Display results */
|
||||
@ -580,7 +580,7 @@ struct cmd_set netlogon_commands[] = {
|
||||
|
||||
{ "logonctrl2", RPC_RTYPE_NTSTATUS, cmd_netlogon_logon_ctrl2, NULL, PI_NETLOGON, NULL, "Logon Control 2", "" },
|
||||
{ "getanydcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getanydcname, PI_NETLOGON, NULL, "Get trusted DC name", "" },
|
||||
{ "getdcname", RPC_RTYPE_NTSTATUS, cmd_netlogon_getdcname, NULL, PI_NETLOGON, NULL, "Get trusted PDC name", "" },
|
||||
{ "getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getdcname, PI_NETLOGON, NULL, "Get trusted PDC name", "" },
|
||||
{ "dsr_getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcname, PI_NETLOGON, NULL, "Get trusted DC name", "" },
|
||||
{ "dsr_getdcnameex", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex, PI_NETLOGON, NULL, "Get trusted DC name", "" },
|
||||
{ "dsr_getdcnameex2", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex2, PI_NETLOGON, NULL, "Get trusted DC name", "" },
|
||||
|
Loading…
x
Reference in New Issue
Block a user