CVS update: samba/source/smbd

Jeremy Allison jeremy at valinux.com
Fri Mar 23 18:26:20 EST 2001


On Fri, Mar 23, 2001 at 02:24:07PM +1100, Andrew Tridgell wrote:

> It's not OK I'm afraid. Instead of the following code:
> 
>     StrnCpy(pdata+2, global_myname, 15);           /* Our NetBIOS name */
>     StrnCpy(pdata+18, lp_servicename(SNUM(conn)), 13); /* Service name */
> 
> you should use
> 
>     srvstr_push(outbuf, pdata+2, global_myname, 
>                 15, STR_ASCII|STR_CONVERT|STR_TERMINATE);
>     srvstr_push(outbuf, pdata+18, lp_servicename(SNUM(conn)), 
>                 13, STR_ASCII|STR_CONVERT|STR_TERMINATE);
> 

Ok - thanks. I'll fix this tomorrow. I was unsure of the new API
to use to copy (and convert) a fixed length string.

> 
> There is a lot of code in Samba that needs to be fixed like this. It's
> a big job, but I think we should at least try to make new code do the
> right thing.

No problem, that's why I flagged it in the CVS commit (I
knew it'd get you to look at it :-). Thanks.

Jeremy.

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------




More information about the samba-cvs mailing list