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

Andrew Bartlett abartlet at samba.org
Sun Nov 13 21:05:07 GMT 2005


On Sun, 2005-11-13 at 19:38 +0100, Rafal Szczesniak wrote:
> 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.

I really don't think we want those semantics in libnet.  Why can't
libnet_LookupPdc do the allocation?

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Student Network Administrator, Hawker College  http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20051114/5ed09620/attachment.bin


More information about the samba-technical mailing list