diff options
-rw-r--r-- | source3/winbindd/winbindd_msrpc.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c index 8986598daa..cd87f5fd95 100644 --- a/source3/winbindd/winbindd_msrpc.c +++ b/source3/winbindd/winbindd_msrpc.c @@ -1057,14 +1057,15 @@ static NTSTATUS msrpc_password_policy(struct winbindd_domain *domain, return status; } -typedef NTSTATUS (*lookup_sids_fn_t)(struct rpc_pipe_client *cli, +typedef NTSTATUS (*lookup_sids_fn_t)(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, const struct dom_sid *sids, char ***pdomains, char ***pnames, - enum lsa_SidType **ptypes); + enum lsa_SidType **ptypes, + NTSTATUS *result); NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, @@ -1075,15 +1076,17 @@ NTSTATUS winbindd_lookup_sids(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; - lookup_sids_fn_t lookup_sids_fn = rpccli_lsa_lookup_sids; + lookup_sids_fn_t lookup_sids_fn = dcerpc_lsa_lookup_sids; if (domain->can_do_ncacn_ip_tcp) { status = cm_connect_lsa_tcp(domain, mem_ctx, &cli); if (NT_STATUS_IS_OK(status)) { - lookup_sids_fn = rpccli_lsa_lookup_sids3; + lookup_sids_fn = dcerpc_lsa_lookup_sids3; goto lookup; } domain->can_do_ncacn_ip_tcp = false; @@ -1095,24 +1098,27 @@ NTSTATUS winbindd_lookup_sids(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_sids_fn(cli, + status = lookup_sids_fn(b, mem_ctx, &lsa_policy, num_sids, sids, domains, names, - 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) { @@ -1130,7 +1136,11 @@ NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx, return status; } - return status; + if (!NT_STATUS_IS_OK(result)) { + return result; + } + + return NT_STATUS_OK; } typedef NTSTATUS (*lookup_names_fn_t)(struct rpc_pipe_client *cli, |