CVS update: samba/source/smbd

Andrew Tridgell tridge at samba.org
Fri Mar 23 14:24:07 EST 2001


> First one adds a new info level into the lanman printing and an ioctl to the trans2 code.
> 	Andrew - this uses ASCII only. It looks ok to me but please check !

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);

the reason is that the StrnCpy() won't do the necessary codepage
conversions. It will work with english but will fail with some other
languages.

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.

Cheers, Tridge




More information about the samba-cvs mailing list