alpha_strcpy() problem

TAKAHASHI Motonobu monyo at samba.gr.jp
Wed Aug 15 16:38:28 GMT 2001


Andrew Tridgell wrote:

>> The 2nd (or 3rd) byte of multibyte character often becomes non-ASCII
>> code, so we cannot use multibyte NetBIOS name correctly now in HEAD
>> branch.
>> Is there any reason not to use characters except '/'?
>
>yes, other characters are potentially dangerous, eg:
>
>  "foo\"; rm -rf ."

Though I know what you want mean, to support Japanese character, this
problem need to be solved.

In Japanese both SJIS and EUC encode method are commonly used as
filenames. 

In SJIS, 1st byte exists between 0x81-0x9f, 0xe0-0xea, 0xed-ee and
0xf0-fc and 2nd byte exists between 0x40-0xfc except 0x7f. So there
are several dangerous chars, especially \(0x5c) often makes problems.

In EUC, 1st byte exists between 0x8e-0x8f and 0xa1-0xfe and both 2nd
and 3rd byte exists between 0xa1-0xfe. So there are no dangerous chars
if 8bit through.

Indeed Samba also supports JIS, but it is impossible to support JIS
because allowing / (0x2f) in filenames is necessary.

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