diff options
author | Günther Deschner <gd@samba.org> | 2011-01-12 11:27:26 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2011-01-13 12:23:02 +0100 |
commit | 1259e93ac07fa86eacf0870744b7c6a056a30c57 (patch) | |
tree | 674590a17f215c1f86c911f7d85479df27fb5cf9 | |
parent | f3eb5c234e3c4e07c9839c940c4558a169087dbf (diff) | |
download | samba-1259e93ac07fa86eacf0870744b7c6a056a30c57.tar.gz samba-1259e93ac07fa86eacf0870744b7c6a056a30c57.tar.bz2 samba-1259e93ac07fa86eacf0870744b7c6a056a30c57.zip |
s3-net: prefer dcerpc_netr_X functions.
Guenther
Signed-off-by: Andreas Schneider <asn@samba.org>
-rw-r--r-- | source3/utils/net_rpc.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 30d73df708..31585e5b22 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -28,7 +28,7 @@ #include "rpc_client/init_samr.h" #include "../librpc/gen_ndr/cli_lsa.h" #include "rpc_client/cli_lsarpc.h" -#include "../librpc/gen_ndr/cli_netlogon.h" +#include "../librpc/gen_ndr/ndr_netlogon_c.h" #include "../librpc/gen_ndr/cli_srvsvc.h" #include "../librpc/gen_ndr/cli_spoolss.h" #include "../librpc/gen_ndr/ndr_initshutdown_c.h" @@ -5656,6 +5656,8 @@ static NTSTATUS rpc_trustdom_get_pdc(struct net_context *c, const char *buffer = NULL; struct rpc_pipe_client *netr; NTSTATUS status; + WERROR result; + struct dcerpc_binding_handle *b; /* Use NetServerEnum2 */ @@ -5675,21 +5677,27 @@ static NTSTATUS rpc_trustdom_get_pdc(struct net_context *c, return status; } - status = rpccli_netr_GetDcName(netr, mem_ctx, + b = netr->binding_handle; + + status = dcerpc_netr_GetDcName(b, mem_ctx, cli->desthost, domain_name, &buffer, - NULL); + &result); TALLOC_FREE(netr); - if (NT_STATUS_IS_OK(status)) { + if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(result)) { return status; } DEBUG(1,("netr_GetDcName error: Couldn't find primary domain controller\ for domain %s\n", domain_name)); - return status; + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + return werror_to_ntstatus(result); } /** |