Win2K client not sending unicode filename to samba server

Hayden So skhay at googoltech.com
Sun Mar 3 09:19:02 GMT 2002


Hi,

	I have spent more than a week trying to setup a Samba server to
create/rename file with names in Chinese (both traditional and simplified)
or even Japanese with no luck at all.  The name on the linux share always
end up showing as junk (or I should say, a mangled name based on junk).

	This is my environment:
	Server:  Stock RH7.0 running self-compiled Samba 2.2.3a.
	Client:  Win2K (tried both w/o SP and SP2).  Default language set
to English (US).  Traditional Chinese, and other asian languages enabled.

	After researching from the net, it seems there are stil bugs in
2.2.x regarding unicode.  However, my setup doesn't even lead me that far
yet.  It seems like my Win2k machine is not even sending out unicode for
my international filenames.  Below is an extract of my level 10 samba log.
This log is generated when I created a file by copying a file with chinese
name from a local hd and pasting to a linux share.  The name of the file
is supposed to consist of 4 chinese characters follows by ".txt".  It is
located inside a directory called "empty".  Instead of sending 16-bit
unicode, windows is sending just plain ASCII code for all alphabet, and
four 0x3F for the four chinese characters in question, causing it be
mangled by samba later on.

	My questions follow the log.

======================== begin log ==========================
  got message type 0x0 of len 0x63
[2002/03/01 11:25:58, 3] smbd/process.c:process_smb(860)
  Transaction 1564 of length 103
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(275)
  size=99
  smb_com=0xa2
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=18439
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(281)
  smb_tid=5
  smb_pid=1048
  smb_uid=103
  smb_mid=30212
  smt_wct=24
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[0]=255 (0xFF)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[1]=57054 (0xDEDE)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[2]=4096 (0x1000)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[3]=5632 (0x1600)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[4]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[5]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[6]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[7]=38400 (0x9600)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[8]=769 (0x301)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[9]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[10]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[11]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[12]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[13]=8192 (0x2000)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[14]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[15]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[16]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[17]=512 (0x200)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[18]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[19]=17408 (0x4400)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[20]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[21]=512 (0x200)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[22]=0 (0x0)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(286)
  smb_vwv[23]=768 (0x300)
[2002/03/01 11:25:58, 5] lib/util.c:show_msg(291)
  smb_bcc=16
[2002/03/01 11:25:58, 10] lib/util.c:dump_data(1484)
  [000] 5C 65 6D 70 74 79 5C 3F  3F 3F 3F 2E 74 78 74 00  \empty\? ???.txt.
[2002/03/01 11:25:58, 3] smbd/process.c:switch_message(667)
  switch message SMBntcreateX (pid 8575)
[2002/03/01 11:25:58, 4] smbd/uid.c:change_to_user(118)
  change_to_user: Skipping user change - already user
[2002/03/01 11:25:58, 10] smbd/nttrans.c:map_create_disposition(399)
  map_create_disposition: Mapped create_disposition 0x2 to 0x10
[2002/03/01 11:25:58, 10] smbd/nttrans.c:get_filename(260)
  get_filename: data_offset = 87, data_len = 16, fname_len = 16
[2002/03/01 11:25:58, 10] smbd/nttrans.c:map_share_mode(498)
  map_share_mode: DELETE_ACCESS requested. open_mode = 0x20001
[2002/03/01 11:25:58, 10] smbd/nttrans.c:map_share_mode(533)
  map_share_mode: Mapped desired access 0x30196, share access 0x0, file attributes 0x20 to open_mode 0x20011
[2002/03/01 11:25:58, 5] smbd/filename.c:unix_convert(145)
  unix_convert called on file "\empty\????.txt"
[2002/03/01 11:25:58, 3] lib/util.c:unix_clean_name(387)
  unix_clean_name [/empty/????.txt]
[2002/03/01 11:25:58, 5] smbd/mangle.c:is_8_3(337)
  Checking ????.txt for 8.3
[2002/03/01 11:25:58, 5] smbd/filename.c:unix_convert(221)
  unix_convert begin: name = empty/????.txt, dirpath = empty, start = ????.txt
[2002/03/01 11:25:58, 5] smbd/filename.c:unix_convert(350)
  New file ????.txt
[2002/03/01 11:25:58, 3] smbd/dosmode.c:unix_mode(111)
  unix_mode(empty/????.txt) returning 0744
[2002/03/01 11:25:58, 5] smbd/files.c:file_new(121)
  allocated file structure 2091, fnum = 6187 (2 used)
[2002/03/01 11:25:58, 10] smbd/open.c:open_file_shared(650)
  open_file_shared: fname = empty/????.txt, share_mode = 20011, ofun = 10, mode = 744, oplock request = 3
[2002/03/01 11:25:58, 8] lib/util.c:is_in_path(1115)
  is_in_path: empty/????.txt
[2002/03/01 11:25:58, 8] lib/util.c:is_in_path(1120)
  is_in_path: no name list.
[2002/03/01 11:25:58, 3] lib/util.c:unix_clean_name(387)
  unix_clean_name [empty/????.txt]
[2002/03/01 11:25:58, 4] smbd/open.c:open_file_shared(779)
  calling open_file with flags=0x1 flags2=0xC0 mode=0744
[2002/03/01 11:25:58, 10] smbd/open.c:fd_open(53)
  fd_open: name empty/????.txt, flags = 0301 mode = 0744, fd = 23.
[2002/03/01 11:25:58, 2] smbd/open.c:open_file(216)
  skhay opened file empty/????.txt read=No write=Yes (numopen=2)
[2002/03/01 11:25:58, 10] smbd/open.c:open_file_shared(880)
  open_file_shared : share_mode = 20011
[2002/03/01 11:25:58, 8] lib/util.c:is_in_path(1115)
  is_in_path: empty/????.txt
[2002/03/01 11:25:58, 8] lib/util.c:is_in_path(1120)
  is_in_path: no name list.
[2002/03/01 11:25:58, 5] smbd/oplock.c:set_file_oplock(184)
  set_file_oplock: granted oplock on file empty/????.txt, dev = 805, inode = 97845, file_id = 197, tv_sec = 3c7ef4c6, tv_usec = 25ab
[2002/03/01 11:25:58, 10] locking/locking.c:set_share_mode(656)
  set_share_mode: creating entry for file empty/????.txt. num_share_modes = 1
[2002/03/01 11:25:58, 10] locking/locking.c:print_share_mode_table(410)
  print_share_mode_table: share_mode_entry[0]: pid = 8575, share_mode = 0x20011, port = 0xeeb, type= 0x3, file_id = 197, dev = 0x805, inode = 97845
[2002/03/01 11:25:58, 8] smbd/dosmode.c:dos_mode(123)
  dos_mode: empty/????.txt
[2002/03/01 11:25:58, 8] lib/util.c:is_in_path(1115)
  is_in_path: empty/????.txt
[2002/03/01 11:25:58, 8] lib/util.c:is_in_path(1120)
  is_in_path: no name list.
[2002/03/01 11:25:58, 8] smbd/dosmode.c:dos_mode(167)
  dos_mode returning a
[2002/03/01 11:25:58, 5] smbd/nttrans.c:reply_ntcreate_and_X(965)
  reply_ntcreate_and_X: fnum = 6187, open name = empty/????.txt

====================== end log ========================
Question:

(1) Simple one: can I use chinese/japanese names for files on a linux
share at all?

(2) Is there a setting in smb.conf that I am missing?  Any Win2k
setting I am missing?  Here are (I beleive) relevant part of smb.conf.
Some are from testparm.

	coding system = HEX
	client code page = 437
	protocol = NT1
	large readwrite = No
	nt smb support = Yes
	nt pipe support = Yes
	announce version = 4.5
	announce as = NT

(3) In smbd/negprot.c:reply_nt1(), CAP_UNICODE is not set.  Is this
intentional?  Or is it a bug that causes Win2K not replying unicode samba
message?

(4) Just on the side.  Why is smbd/nttrans.c:get_filename() used instead
of get_filename_transact()?  I've used both Win2K stock (no SP) and Win2K
with SP2.  What will cause get_filename_transact() be called?

	I understand Samba 3.0 will have much better unicode support, but
I need to setup the system as soon as possible and I dare not deploying
alpha code.  Any help is appreciated.

	Thanks.


Hayden So





More information about the samba-technical mailing list