struct lookup_state {
struct composite_context *resolve_ctx;
struct nbt_name hostname;
- const char **address;
};
struct composite_context *c;
struct lookup_state *s;
const char** methods;
- const char* address = talloc_array(ctx, const char, 16);
if (!io) return NULL;
if (s == NULL) goto failed;
/* prepare event context */
- c->event_ctx = event_context_init(c);
+ c->event_ctx = event_context_find(c);
if (c->event_ctx == NULL) goto failed;
/* parameters */
s->hostname.name = talloc_strdup(s, io->in.hostname);
s->hostname.type = io->in.type;
s->hostname.scope = NULL;
- s->address = &address;
/* name resolution methods */
if (io->in.methods) {
{
NTSTATUS status;
struct lookup_state *s;
+ const char *address;
s = talloc_get_type(c->private_data, struct lookup_state);
- status = resolve_name_recv(s->resolve_ctx, mem_ctx, s->address);
+ status = resolve_name_recv(s->resolve_ctx, mem_ctx, &address);
if (NT_STATUS_IS_OK(status)) {
- io->out.address = s->address;
+ io->out.address = str_list_make(mem_ctx, address, NULL);
+ NT_STATUS_HAVE_NO_MEMORY(io->out.address);
}
return status;
NTSTATUS status;
struct libnet_RpcConnect r2;
struct libnet_Lookup f;
- const char *address = talloc_array(ctx, const char, 16);
f.in.hostname = r->in.domain_name;
f.in.methods = NULL;
- f.out.address = &address;
+ f.out.address = NULL;
status = libnet_LookupPdc(ctx, mem_ctx, &f);
if (!NT_STATUS_IS_OK(status)) {
}
r2.level = LIBNET_RPC_CONNECT_SERVER;
- r2.in.domain_name = talloc_strdup(mem_ctx, *f.out.address);
+ r2.in.domain_name = talloc_strdup(mem_ctx, f.out.address[0]);
r2.in.dcerpc_iface_name = r->in.dcerpc_iface_name;
r2.in.dcerpc_iface_uuid = r->in.dcerpc_iface_uuid;
r2.in.dcerpc_iface_version = r->in.dcerpc_iface_version;