diff options
author | Günther Deschner <gd@samba.org> | 2008-11-07 02:57:58 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-11-10 21:46:30 +0100 |
commit | d4d9a73ad1e5561a7a19e0c226936d1b21de60cb (patch) | |
tree | e10c41a0b3dba213139aa73b7a4e3ad795973188 /source4/libnet/libnet_domain.c | |
parent | bb1d7684d2d2b0ebf11acb267de1885f79d05a5e (diff) | |
download | samba-d4d9a73ad1e5561a7a19e0c226936d1b21de60cb.tar.gz samba-d4d9a73ad1e5561a7a19e0c226936d1b21de60cb.tar.xz samba-d4d9a73ad1e5561a7a19e0c226936d1b21de60cb.zip |
s4-samr: merge samr_EnumDomains from s3 idl. (fixme: python)
Guenther
Diffstat (limited to 'source4/libnet/libnet_domain.c')
-rw-r--r-- | source4/libnet/libnet_domain.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/libnet/libnet_domain.c b/source4/libnet/libnet_domain.c index adb826a2d1..eb6920d88e 100644 --- a/source4/libnet/libnet_domain.c +++ b/source4/libnet/libnet_domain.c @@ -1001,6 +1001,10 @@ static void continue_samr_connect(struct rpc_request *req) s->enumdom.in.resume_handle = &s->resume_handle; s->enumdom.in.buf_size = s->buf_size; s->enumdom.out.resume_handle = &s->resume_handle; + s->enumdom.out.num_entries = talloc(s, uint32_t); + if (composite_nomem(s->enumdom.out.num_entries, c)) return; + s->enumdom.out.sam = talloc(s, struct samr_SamArray *); + if (composite_nomem(s->enumdom.out.sam, c)) return; enumdom_req = dcerpc_samr_EnumDomains_send(s->ctx->samr.pipe, c, &s->enumdom); if (composite_nomem(enumdom_req, c)) return; @@ -1116,16 +1120,16 @@ static struct domainlist* get_domain_list(TALLOC_CTX *mem_ctx, struct domain_lis /* prepare domains array */ if (s->domains == NULL) { s->domains = talloc_array(mem_ctx, struct domainlist, - s->enumdom.out.num_entries); + *s->enumdom.out.num_entries); } else { s->domains = talloc_realloc(mem_ctx, s->domains, struct domainlist, - s->count + s->enumdom.out.num_entries); + s->count + *s->enumdom.out.num_entries); } /* copy domain names returned from samr_EnumDomains call */ - for (i = s->count; i < s->count + s->enumdom.out.num_entries; i++) + for (i = s->count; i < s->count + *s->enumdom.out.num_entries; i++) { - struct lsa_String *domain_name = &s->enumdom.out.sam->entries[i - s->count].name; + struct lsa_String *domain_name = &(*s->enumdom.out.sam)->entries[i - s->count].name; /* strdup name as a child of allocated array to make it follow the array in case of talloc_steal or talloc_free */ @@ -1134,7 +1138,7 @@ static struct domainlist* get_domain_list(TALLOC_CTX *mem_ctx, struct domain_lis } /* number of entries returned (domains enumerated) */ - s->count += s->enumdom.out.num_entries; + s->count += *s->enumdom.out.num_entries; return s->domains; } |