summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_group.c8
-rw-r--r--source4/libnet/libnet_lookup.c4
-rw-r--r--source4/libnet/libnet_rpc.c12
-rw-r--r--source4/libnet/libnet_user.c10
4 files changed, 24 insertions, 10 deletions
diff --git a/source4/libnet/libnet_group.c b/source4/libnet/libnet_group.c
index 50ba079b71..eded378511 100644
--- a/source4/libnet/libnet_group.c
+++ b/source4/libnet/libnet_group.c
@@ -444,6 +444,8 @@ struct composite_context *libnet_GroupList_send(struct libnet_context *ctx,
/* prepare arguments of QueryDomainInfo call */
s->query_domain.in.handle = &ctx->lsa.handle;
s->query_domain.in.level = LSA_POLICY_INFO_DOMAIN;
+ s->query_domain.out.info = talloc_zero(c, union lsa_PolicyInformation *);
+ if (composite_nomem(s->query_domain.out.info, c)) return c;
/* send the request */
query_req = dcerpc_lsa_QueryInfoPolicy_send(ctx->lsa.pipe, c, &s->query_domain);
@@ -474,6 +476,8 @@ static void continue_lsa_domain_opened(struct composite_context *ctx)
/* prepare arguments of QueryDomainInfo call */
s->query_domain.in.handle = &s->ctx->lsa.handle;
s->query_domain.in.level = LSA_POLICY_INFO_DOMAIN;
+ s->query_domain.out.info = talloc_zero(c, union lsa_PolicyInformation *);
+ if (composite_nomem(s->query_domain.out.info, c)) return;
/* send the request */
query_req = dcerpc_lsa_QueryInfoPolicy_send(s->ctx->lsa.pipe, c, &s->query_domain);
@@ -502,7 +506,7 @@ static void continue_domain_queried(struct rpc_request *req)
if (!composite_is_ok(c)) return;
/* get the returned domain info */
- s->dominfo = s->query_domain.out.info->domain;
+ s->dominfo = (*s->query_domain.out.info)->domain;
/* make sure we have samr domain handle before continuing */
prereq_met = samr_domain_opened(s->ctx, s->domain_name, &c, &s->domain_open,
@@ -592,7 +596,7 @@ static void continue_groups_enumerated(struct rpc_request *req)
for (i = 0; i < s->group_list.out.sam->count; i++) {
struct dom_sid *group_sid;
struct samr_SamEntry *entry = &s->group_list.out.sam->entries[i];
- struct dom_sid *domain_sid = s->query_domain.out.info->domain.sid;
+ struct dom_sid *domain_sid = (*s->query_domain.out.info)->domain.sid;
/* construct group sid from returned rid and queried domain sid */
group_sid = dom_sid_add_rid(c, domain_sid, entry->idx);
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index dc54ec3cf1..fc307823b8 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -312,6 +312,8 @@ static bool prepare_lookup_params(struct libnet_context *ctx,
s->lookup.in.count = &s->count;
s->lookup.out.count = &s->count;
s->lookup.out.sids = &s->sids;
+ s->lookup.out.domains = talloc_zero(ctx, struct lsa_RefDomainList *);
+ if (composite_nomem(s->lookup.out.domains, c)) return false;
return true;
}
@@ -372,7 +374,7 @@ NTSTATUS libnet_LookupName_recv(struct composite_context *c, TALLOC_CTX *mem_ctx
io->out.sidstr = NULL;
if (*s->lookup.out.count > 0) {
- struct lsa_RefDomainList *domains = s->lookup.out.domains;
+ struct lsa_RefDomainList *domains = *s->lookup.out.domains;
struct lsa_TransSidArray *sids = s->lookup.out.sids;
if (domains == NULL || sids == NULL) {
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index 28cbba2933..a0d93287a5 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -607,6 +607,8 @@ static void continue_lsa_policy(struct rpc_request *req)
/* query lsa info for dns domain name and guid */
s->lsa_query_info2.in.handle = &s->lsa_handle;
s->lsa_query_info2.in.level = LSA_POLICY_INFO_DNS;
+ s->lsa_query_info2.out.info = talloc_zero(c, union lsa_PolicyInformation *);
+ if (composite_nomem(s->lsa_query_info2.out.info, c)) return;
query_info_req = dcerpc_lsa_QueryInfoPolicy2_send(s->lsa_pipe, c, &s->lsa_query_info2);
if (composite_nomem(query_info_req, c)) return;
@@ -658,13 +660,13 @@ static void continue_lsa_query_info2(struct rpc_request *req)
/* Copy the dns domain name and guid from the query result */
/* this should actually be a conversion from lsa_StringLarge */
- s->r.out.realm = s->lsa_query_info2.out.info->dns.dns_domain.string;
+ s->r.out.realm = (*s->lsa_query_info2.out.info)->dns.dns_domain.string;
s->r.out.guid = talloc(c, struct GUID);
if (composite_nomem(s->r.out.guid, c)) {
s->r.out.error_string = NULL;
return;
}
- *s->r.out.guid = s->lsa_query_info2.out.info->dns.domain_guid;
+ *s->r.out.guid = (*s->lsa_query_info2.out.info)->dns.domain_guid;
}
/* post monitor message */
@@ -680,6 +682,8 @@ static void continue_lsa_query_info2(struct rpc_request *req)
/* query lsa info for domain name and sid */
s->lsa_query_info.in.handle = &s->lsa_handle;
s->lsa_query_info.in.level = LSA_POLICY_INFO_DOMAIN;
+ s->lsa_query_info.out.info = talloc_zero(c, union lsa_PolicyInformation *);
+ if (composite_nomem(s->lsa_query_info.out.info, c)) return;
query_info_req = dcerpc_lsa_QueryInfoPolicy_send(s->lsa_pipe, c, &s->lsa_query_info);
if (composite_nomem(query_info_req, c)) return;
@@ -719,8 +723,8 @@ static void continue_lsa_query_info(struct rpc_request *req)
}
/* Copy the domain name and sid from the query result */
- s->r.out.domain_sid = s->lsa_query_info.out.info->domain.sid;
- s->r.out.domain_name = s->lsa_query_info.out.info->domain.name.string;
+ s->r.out.domain_sid = (*s->lsa_query_info.out.info)->domain.sid;
+ s->r.out.domain_name = (*s->lsa_query_info.out.info)->domain.name.string;
continue_epm_map_binding_send(c);
}
diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c
index dce7320c73..c768319452 100644
--- a/source4/libnet/libnet_user.c
+++ b/source4/libnet/libnet_user.c
@@ -957,7 +957,9 @@ struct composite_context* libnet_UserList_send(struct libnet_context *ctx,
/* prepare arguments of QueryDomainInfo call */
s->query_domain.in.handle = &ctx->lsa.handle;
s->query_domain.in.level = LSA_POLICY_INFO_DOMAIN;
-
+ s->query_domain.out.info = talloc_zero(c, union lsa_PolicyInformation *);
+ if (composite_nomem(s->query_domain.out.info, c)) return c;
+
/* send the request */
query_req = dcerpc_lsa_QueryInfoPolicy_send(ctx->lsa.pipe, c, &s->query_domain);
if (composite_nomem(query_req, c)) return c;
@@ -987,6 +989,8 @@ static void continue_lsa_domain_opened(struct composite_context *ctx)
/* prepare arguments of QueryDomainInfo call */
s->query_domain.in.handle = &s->ctx->lsa.handle;
s->query_domain.in.level = LSA_POLICY_INFO_DOMAIN;
+ s->query_domain.out.info = talloc_zero(c, union lsa_PolicyInformation *);
+ if (composite_nomem(s->query_domain.out.info, c)) return;
/* send the request */
query_req = dcerpc_lsa_QueryInfoPolicy_send(s->ctx->lsa.pipe, c, &s->query_domain);
@@ -1015,7 +1019,7 @@ static void continue_domain_queried(struct rpc_request *req)
if (!composite_is_ok(c)) return;
/* get the returned domain info */
- s->dominfo = s->query_domain.out.info->domain;
+ s->dominfo = (*s->query_domain.out.info)->domain;
/* make sure we have samr domain handle before continuing */
prereq_met = samr_domain_opened(s->ctx, s->domain_name, &c, &s->domain_open,
@@ -1107,7 +1111,7 @@ static void continue_users_enumerated(struct rpc_request *req)
for (i = 0; i < s->user_list.out.sam->count; i++) {
struct dom_sid *user_sid;
struct samr_SamEntry *entry = &s->user_list.out.sam->entries[i];
- struct dom_sid *domain_sid = s->query_domain.out.info->domain.sid;
+ struct dom_sid *domain_sid = (*s->query_domain.out.info)->domain.sid;
/* construct user sid from returned rid and queried domain sid */
user_sid = dom_sid_add_rid(c, domain_sid, entry->idx);