svn commit: samba r11705 - in branches/SAMBA_4_0/source/libnet: .

Rafal Szczesniak mimir at samba.org
Sun Nov 13 18:38:16 GMT 2005


On Sun, Nov 13, 2005 at 02:12:56PM +0100, Stefan Metzmacher wrote:
> On Sat, Nov 12, 2005 at 09:44:42PM +0000, mimir at samba.org wrote:
> >  	struct libnet_rpc_domain_open dom_io;
> >  	struct libnet_rpc_useradd user_io;
> > +	const char *address;
> >  	
> > +	address = talloc_array(mem_ctx, const char, 8);
> > +
> >  	/* find domain pdc */
> >  	fp.in.hostname    = r->in.domain_name;
> >  	fp.in.methods     = NULL;
> > +	fp.out.address    = &address;
> >  
> >  	status = libnet_LookupPdc(ctx, mem_ctx, &fp);
> >  	if (!NT_STATUS_IS_OK(status)) return status;
> 
> Hi Rafal,
> 
> can you explain that a bit more?
> 
> why an array of 8 characters? and why the caller need to set the out parameter?

I'm sorry, this is mistake. It should be long enough to store ip
address. Thanks for catching that.
Address argument is just like [ref] - you have to pass a
pointer to allocated buffer for function to fill in the result.
Otherwise resolve_name function segfaults.


cheers,
-- 
Rafal Szczesniak
Samba Team member  http://www.samba.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20051113/49f03fa3/attachment.bin


More information about the samba-technical mailing list