smbclient, unicode, and winnt

TAKAHASHI Motonobu monyo at samba.org
Thu Jul 26 18:16:53 GMT 2001


>After experimenting a bit I found that the following modification to
>dos_PutUniCode() makes it work:

*** util_unistr.c.sav   Fri Jul  6 04:01:36 2001              ---
util_unistr.c       Fri Jul 20 09:28:28 2001              ***************                                             

*** 68,74 ****                                               
                if (skip == 2)                               
                        val = ((val << 8) | (src[1] & 0xff));
                                                              !              
SSVAL(dst,ret,doscp_to_ucs2[val]);           
                ret += 2;                                    
                len -= 2;                                    
                if (skip)                                     --- 68,74
----                                               
                if (skip == 2)                               
                        val = ((val << 8) | (src[1] & 0xff));
                                                              !              
SSVAL(dst,ret,unixcp_to_ucs2[val]);          
                ret += 2;                                    
                len -= 2;                                    
                if (skip)                                    
***************

>I'm aware that this could break other things. But maybe it's worth to
>look at it.
>
>Cheers, Frank

Unfortunately this patch causes another problems. For example
smbd creates broken filenames.

dos_PutUniCode() should be called with already 'internal'ed character
code. 

So in order to fix it, you should call unix_to_dos() before calling
dos_PutUniCode().

I met the same problem and it is fixed in Samba Japanese Edition.

-----
TAKAHASHI, Motonobu(monyo)         monyo at samba.org
Personal - http://home.monyo.com/, 
Samba Team - http://samba.org/,    Samba-JP - http://www.samba.gr.jp/  
JWNTUG - http://www.jwntug.or.jp/, Analog-JP - http://www.jp.analog.cx/
MCSE+I, SCNA, CCNA, Turbo-CI




More information about the samba-technical mailing list