summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-04-23 23:57:19 +0200
committerStefan Metzmacher <metze@samba.org>2011-04-24 09:53:54 +0200
commite7cf7204e60552b45952325f343ea894fda21346 (patch)
tree3d2f372a6b797ee4e20af15dfe120f955168bddb /source3/winbindd
parent7309daa532c9689d64ce3f33da522f23635213d6 (diff)
downloadsamba-e7cf7204e60552b45952325f343ea894fda21346.tar.gz
samba-e7cf7204e60552b45952325f343ea894fda21346.tar.bz2
samba-e7cf7204e60552b45952325f343ea894fda21346.zip
s3:winbindd: let winbindd_lookup_names() use dcerpc_binding_handle functions
metze
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_msrpc.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c
index cd87f5fd95..83cdd063a7 100644
--- a/source3/winbindd/winbindd_msrpc.c
+++ b/source3/winbindd/winbindd_msrpc.c
@@ -1143,15 +1143,16 @@ NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
-typedef NTSTATUS (*lookup_names_fn_t)(struct rpc_pipe_client *cli,
+typedef NTSTATUS (*lookup_names_fn_t)(struct dcerpc_binding_handle *h,
TALLOC_CTX *mem_ctx,
struct policy_handle *pol,
- int num_names,
+ uint32_t num_names,
const char **names,
const char ***dom_names,
- int level,
+ enum lsa_LookupNamesLevel level,
struct dom_sid **sids,
- enum lsa_SidType **types);
+ enum lsa_SidType **types,
+ NTSTATUS *result);
NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
struct winbindd_domain *domain,
@@ -1162,15 +1163,17 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
enum lsa_SidType **types)
{
NTSTATUS status;
+ NTSTATUS result;
struct rpc_pipe_client *cli = NULL;
+ struct dcerpc_binding_handle *b = NULL;
struct policy_handle lsa_policy;
unsigned int orig_timeout = 0;
- lookup_names_fn_t lookup_names_fn = rpccli_lsa_lookup_names;
+ lookup_names_fn_t lookup_names_fn = dcerpc_lsa_lookup_names;
if (domain->can_do_ncacn_ip_tcp) {
status = cm_connect_lsa_tcp(domain, mem_ctx, &cli);
if (NT_STATUS_IS_OK(status)) {
- lookup_names_fn = rpccli_lsa_lookup_names4;
+ lookup_names_fn = dcerpc_lsa_lookup_names4;
goto lookup;
}
domain->can_do_ncacn_ip_tcp = false;
@@ -1182,15 +1185,16 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
}
lookup:
+ b = cli->binding_handle;
/*
* This call can take a long time
* allow the server to time out.
* 35 seconds should do it.
*/
- orig_timeout = rpccli_set_timeout(cli, 35000);
+ orig_timeout = dcerpc_binding_handle_set_timeout(b, 35000);
- status = lookup_names_fn(cli,
+ status = lookup_names_fn(b,
mem_ctx,
&lsa_policy,
num_names,
@@ -1198,10 +1202,11 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
domains,
1,
sids,
- types);
+ types,
+ &result);
/* And restore our original timeout. */
- rpccli_set_timeout(cli, orig_timeout);
+ dcerpc_binding_handle_set_timeout(b, orig_timeout);
if (NT_STATUS_V(status) == DCERPC_FAULT_ACCESS_DENIED ||
NT_STATUS_V(status) == DCERPC_FAULT_SEC_PKG_ERROR) {
@@ -1219,7 +1224,11 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
return status;
}
- return status;
+ if (!NT_STATUS_IS_OK(result)) {
+ return result;
+ }
+
+ return NT_STATUS_OK;
}
/* the rpc backend methods are exposed via this structure */