summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2006-12-22 22:34:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:29:41 -0500
commit37457a0f0796b4d945f2feb1297c684b99271594 (patch)
tree276cca897ecd2a6fea8b9e418eaf591e2db08b69 /source4
parent89771a974c4d3a36639e29ccffc820d0c6677f1b (diff)
downloadsamba-37457a0f0796b4d945f2feb1297c684b99271594.tar.gz
samba-37457a0f0796b4d945f2feb1297c684b99271594.tar.bz2
samba-37457a0f0796b4d945f2feb1297c684b99271594.zip
r20328: use prereq function instead of local implementation.
rafal (This used to be commit f79dcd41e78662c376d29cf210436c0a28cce4e8)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_lookup.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index d194c1a73c..ebf9b4842d 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -227,45 +227,6 @@ NTSTATUS libnet_LookupDCs_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
}
-static struct composite_context* lsa_policy_opened(struct libnet_context *ctx,
- const char *domain_name,
- struct composite_context *parent_ctx,
- struct libnet_DomainOpen *domain_open,
- void (*continue_fn)(struct composite_context*),
- void (*monitor)(struct monitor_msg*))
-{
- struct composite_context *domopen_req;
-
- if (domain_name == NULL) {
- if (policy_handle_empty(&ctx->lsa.handle)) {
- domain_open->in.type = DOMAIN_LSA;
- domain_open->in.domain_name = cli_credentials_get_domain(ctx->cred);
- domain_open->in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-
- } else {
- composite_error(parent_ctx, NT_STATUS_INVALID_PARAMETER);
- return parent_ctx;
- }
- } else {
- if (policy_handle_empty(&ctx->lsa.handle) ||
- !strequal(domain_name, ctx->lsa.name)) {
- domain_open->in.type = DOMAIN_LSA;
- domain_open->in.domain_name = domain_name;
- domain_open->in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-
- } else {
- return NULL;
- }
- }
-
- domopen_req = libnet_DomainOpen_send(ctx, domain_open, monitor);
- if (composite_nomem(domopen_req, parent_ctx)) return parent_ctx;
-
- composite_continue(parent_ctx, domopen_req, continue_fn, parent_ctx);
- return parent_ctx;
-}
-
-
/**
* Synchronous version of LookupDCs
*/
@@ -305,8 +266,8 @@ struct composite_context* libnet_LookupName_send(struct libnet_context *ctx,
{
struct composite_context *c;
struct lookup_name_state *s;
- struct composite_context *prereq_ctx;
struct rpc_request *lookup_req;
+ BOOL prereq_met = False;
c = composite_create(mem_ctx, ctx->event_ctx);
if (c == NULL) return NULL;
@@ -320,9 +281,9 @@ struct composite_context* libnet_LookupName_send(struct libnet_context *ctx,
s->monitor_fn = monitor;
s->ctx = ctx;
- prereq_ctx = lsa_policy_opened(ctx, io->in.domain_name, c, &s->domopen,
+ prereq_met = lsa_domain_opened(ctx, io->in.domain_name, &c, &s->domopen,
continue_lookup_name, monitor);
- if (prereq_ctx) return prereq_ctx;
+ if (!prereq_met) return c;
if (!prepare_lookup_params(ctx, c, s)) return c;