summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-04-23 23:56:27 +0200
committerStefan Metzmacher <metze@samba.org>2011-04-24 09:53:52 +0200
commit7309daa532c9689d64ce3f33da522f23635213d6 (patch)
tree10ea8100b775d70969aa77230471bc3afa064c05 /source3
parentc0441b17e6580de65d87d28bfd9ae72d09a3508f (diff)
downloadsamba-7309daa532c9689d64ce3f33da522f23635213d6.tar.gz
samba-7309daa532c9689d64ce3f33da522f23635213d6.tar.bz2
samba-7309daa532c9689d64ce3f33da522f23635213d6.zip
s3:winbindd: let winbindd_lookup_sids() dcerpc_binding_handle functions
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_msrpc.c28
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,