summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--librpc/idl/netlogon.idl2
-rw-r--r--source3/rpc_server/srv_netlog_nt.c14
-rw-r--r--source3/rpcclient/cmd_netlogon.c22
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c4
-rw-r--r--source4/torture/rpc/netlogon.c2
5 files changed, 20 insertions, 24 deletions
diff --git a/librpc/idl/netlogon.idl b/librpc/idl/netlogon.idl
index 4bebb83374..7670d34548 100644
--- a/librpc/idl/netlogon.idl
+++ b/librpc/idl/netlogon.idl
@@ -1080,7 +1080,7 @@ interface netlogon
[size_is(length)] uint8 *data;
} netr_Blob;
- WERROR netr_NetrEnumerateTrustedDomains(
+ NTSTATUS netr_NetrEnumerateTrustedDomains(
[in,unique] [string,charset(UTF16)] uint16 *server_name,
[out,ref] netr_Blob *trusted_domains_blob
);
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index ec6ade661f..f0b9babe0e 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -384,8 +384,8 @@ WERROR _netr_LogonControl2Ex(pipes_struct *p,
_netr_NetrEnumerateTrustedDomains
*************************************************************************/
-WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
- struct netr_NetrEnumerateTrustedDomains *r)
+NTSTATUS _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
+ struct netr_NetrEnumerateTrustedDomains *r)
{
NTSTATUS status;
DATA_BLOB blob;
@@ -403,25 +403,25 @@ WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
unbecome_root();
if (!NT_STATUS_IS_OK(status)) {
- return ntstatus_to_werror(status);
+ return status;
}
trusted_domains = talloc_zero_array(p->mem_ctx, const char *, num_domains + 1);
if (!trusted_domains) {
- return WERR_NOMEM;
+ return NT_STATUS_NO_MEMORY;
}
for (i = 0; i < num_domains; i++) {
trusted_domains[i] = talloc_strdup(trusted_domains, domains[i]->name);
if (!trusted_domains[i]) {
TALLOC_FREE(trusted_domains);
- return WERR_NOMEM;
+ return NT_STATUS_NO_MEMORY;
}
}
if (!push_reg_multi_sz(trusted_domains, &blob, trusted_domains)) {
TALLOC_FREE(trusted_domains);
- return WERR_NOMEM;
+ return NT_STATUS_NO_MEMORY;
}
r->out.trusted_domains_blob->data = blob.data;
@@ -429,7 +429,7 @@ WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
DEBUG(6,("_netr_NetrEnumerateTrustedDomains: %d\n", __LINE__));
- return WERR_OK;
+ return NT_STATUS_OK;
}
/******************************************************************
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 262975bc94..faa2bfff3e 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -938,19 +938,18 @@ static WERROR cmd_netlogon_dsr_getforesttrustinfo(struct rpc_pipe_client *cli,
return werr;
}
-static WERROR cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
- WERROR werr = WERR_GENERAL_FAILURE;
const char *server_name = cli->desthost;
struct netr_Blob blob;
if (argc < 1 || argc > 3) {
fprintf(stderr, "Usage: %s <server_name>\n", argv[0]);
- return WERR_OK;
+ return NT_STATUS_OK;
}
if (argc >= 2) {
@@ -959,18 +958,15 @@ static WERROR cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client *cli,
status = rpccli_netr_NetrEnumerateTrustedDomains(cli, mem_ctx,
server_name,
- &blob,
- &werr);
+ &blob);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
- if (W_ERROR_IS_OK(werr)) {
- printf("success\n");
- dump_data(1, blob.data, blob.length);
- }
+ printf("success\n");
+ dump_data(1, blob.data, blob.length);
done:
- return werr;
+ return status;
}
static WERROR cmd_netlogon_enumtrusteddomainsex(struct rpc_pipe_client *cli,
@@ -1175,7 +1171,7 @@ struct cmd_set netlogon_commands[] = {
{ "dsr_enumtrustdom", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_enumtrustdom, &ndr_table_netlogon.syntax_id, NULL, "Enumerate trusted domains", "" },
{ "dsenumdomtrusts", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_enumtrustdom, &ndr_table_netlogon.syntax_id, NULL, "Enumerate all trusted domains in an AD forest", "" },
{ "deregisterdnsrecords", RPC_RTYPE_WERROR, NULL, cmd_netlogon_deregisterdnsrecords, &ndr_table_netlogon.syntax_id, NULL, "Deregister DNS records", "" },
- { "netrenumtrusteddomains", RPC_RTYPE_WERROR, NULL, cmd_netlogon_enumtrusteddomains, &ndr_table_netlogon.syntax_id, NULL, "Enumerate trusted domains", "" },
+ { "netrenumtrusteddomains", RPC_RTYPE_NTSTATUS, cmd_netlogon_enumtrusteddomains, NULL, &ndr_table_netlogon.syntax_id, NULL, "Enumerate trusted domains", "" },
{ "netrenumtrusteddomainsex", RPC_RTYPE_WERROR, NULL, cmd_netlogon_enumtrusteddomainsex, &ndr_table_netlogon.syntax_id, NULL, "Enumerate trusted domains", "" },
{ "getdcsitecoverage", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getdcsitecoverage, &ndr_table_netlogon.syntax_id, NULL, "Get the Site-Coverage from a DC", "" },
{ "database_redo", RPC_RTYPE_NTSTATUS, cmd_netlogon_database_redo, NULL, &ndr_table_netlogon.syntax_id, NULL, "Replicate single object from a DC", "" },
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index cfcb4f6aaa..8bfa44988e 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1066,9 +1066,9 @@ static NTSTATUS dcesrv_netr_DatabaseRedo(struct dcesrv_call_state *dce_call, TAL
/*
- netr_NetrEnumerateTurstedDomains
+ netr_NetrEnumerateTrustedDomains
*/
-static WERROR dcesrv_netr_NetrEnumerateTrustedDomains(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+static NTSTATUS dcesrv_netr_NetrEnumerateTrustedDomains(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct netr_NetrEnumerateTrustedDomains *r)
{
DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index b1d6d1b557..03de3bdc10 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -2139,7 +2139,7 @@ static bool test_netr_NetrEnumerateTrustedDomains(struct torture_context *tctx,
status = dcerpc_netr_NetrEnumerateTrustedDomains_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "netr_NetrEnumerateTrustedDomains");
- torture_assert_werr_ok(tctx, r.out.result, "NetrEnumerateTrustedDomains");
+ torture_assert_ntstatus_ok(tctx, r.out.result, "NetrEnumerateTrustedDomains");
return true;
}