diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-05-31 10:15:25 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-05-31 12:08:59 +0200 |
commit | 11e2608ba97018987b0143521248a83b2dab07e6 (patch) | |
tree | df609f415883cad648362cd93eb82914560339ba /source3 | |
parent | 0eec33417eb56d1352fd66565f55162c62d86fcd (diff) | |
download | samba-11e2608ba97018987b0143521248a83b2dab07e6.tar.gz samba-11e2608ba97018987b0143521248a83b2dab07e6.tar.xz samba-11e2608ba97018987b0143521248a83b2dab07e6.zip |
s3/s4:netrEnumerateTrustedDomains - this call returns a "NTSTATUS" result
See MS-NRPC 3.5.5.6.3.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_netlog_nt.c | 14 | ||||
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 22 |
2 files changed, 16 insertions, 20 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c index ec6ade661fb..f0b9babe0ee 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 262975bc94c..faa2bfff3ef 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", "" }, |