Problem with Turkish character share names -- how to modify?

Deniz Akkus Kanca deniz at arayan.com
Wed May 23 06:36:45 GMT 2001


Hi Tim,

Yes, I wrote the codepage_def file.

It does the correct thing:

i -> \230
\215 -> I

for Turkish. This is not where the problem is. Filenames get
displayed/written etc. correctly. The above capitalization is as it should
be for Turkish.

You said:
> It is the SMB protocol that does not preserve the case of share
> names.
>

According to SMB protocol, are share names supposed to be ASCII only?

If this request came from the Windows world for HULUS\230, there would be no
problem. Instead it (someone, either Samba or Windows, I guess more likely
windows?)  takes hulusi and mangles it according to ASCII, not codepage 857,
resulting in HULUSI. Then, samba takes over and mangles HULUSI according to
codepage 857, resulting in the non-symmetrical case (hulus\215).

Whereas in filenames, the mangling works correctly -- request comes in
mangled according to codepage 857, samba mangles it according to codepage
857 and we are all happy.

This is not a simple codepage bug I am talking about, I wish it were, it
would be simple and within my immediate reach to fix. If you'll bear with
me, below is a full explanation of the problem.

I am including two cases:

1. Case that does not work: Turkish i's in shares.
2. Case that works: Turkish i's in filenames.

For filenames, Windows requests and receives the correct i'd name: --> for a
small dotted i, it asks for italy.gif, Samba looks and finds italy.gif or
\230taly.G\230F

For sharenames, Windows does not seem to request the correct i'd name -->
for a small dotted i, (share name [hulusi]), it should have asked for hulusi
or HULUS\230 . Instead, it asks for HULUSI, which in Turkish codemap is a
different character, so samba can't find it.

Below is log fragments etc. for these two cases.

Please give me some ideas where to look for this stuff in the code. I am
willing to work on this problem, I need guidance as to where it happens.

Best regards,
Deniz


Case that does not work: Turkish i's in shares:

1. We have samba codepage 857 running
2. We create a samba share [hulusi]
3. We list samba services available we see: \\samba01\hulusi
4. We try to request this share (click on it in NT explorer) -- get error
that "The network name cannot be found"
5. We look at samba logs:

=====================================================
Log fragment about [hulusi] share being announced:
=====================================================
[2001/05/23 09:03:41, 5] rpc_parse/parse_srv.c:init_srv_share_info1(72)
  init_srv_share_info1: hulusi        0

=====================================================
Request coming in from Windows for HULUSI share
=====================================================
[2001/05/23 09:03:41, 10] lib/util.c:dump_data(2918)
  [000] 00 5C 5C 56 45 52 49 54  41 42 41 4E 49 5C 48 55  .\\VERIT ABANI\HU
[2001/05/23 09:03:41, 10] lib/util.c:dump_data(2926)
  [010] 4C 55 53 49 00 3F 3F 3F  3F 3F 00                 LUSI.??? ??.
[2001/05/23 09:03:41, 3] smbd/process.c:switch_message(448)
  switch message SMBtconX (pid 2781)
[2001/05/23 09:03:41, 3] lib/doscalls.c:dos_ChDir(342)
  dos_ChDir to /var/log/samba
[2001/05/23 09:03:41, 3] lib/doscalls.c:dos_ChDir(342)
  dos_ChDir to /var/log/samba
[2001/05/23 09:03:41, 5] smbd/uid.c:unbecome_user(297)
  unbecome_user now uid=(0,0) gid=(0,0)
[2001/05/23 09:03:41, 4] smbd/reply.c:reply_tcon_and_X(311)
  Got device type ?????

=================================================
Log fragment, samba looking for, and not finding,  hulus\215
=================================================

[2001/05/23 09:03:41, 7] param/loadparm.c:lp_servicenumber(2897)
  lp_servicenumber: couldn't find hulus\215
[2001/05/23 09:03:41, 4] lib/username.c:map_username(91)
  Scanning username map /etc/samba/smbusers
[2001/05/23 09:03:41, 3] smbd/service.c:find_service(115)
  checking for home directory hulus\215 gave (NULL)
[2001/05/23 09:03:41, 3] smbd/service.c:find_service(134)
  checking whether hulus\215 is a valid printer name...
[2001/05/23 09:03:41, 3] smbd/service.c:find_service(146)
  hulus\215 is not a valid printer name
[2001/05/23 09:03:41, 3] smbd/service.c:find_service(183)
  find_service() failed to find service hulus\215
[2001/05/23 09:03:41, 0] smbd/service.c:make_connection(214)
  ergenekon (10.254.0.12) couldn't find service hulus\215
[2001/05/23 09:03:41, 3] smbd/error.c:error_packet(138)
  error packet at line 164 cmd=117 (SMBtconX) eclass=2 ecode=6
[2001/05/23 09:03:41, 3] smbd/error.c:error_packet(143)
  error string = No such file or directory
[2001/05/23 09:03:41, 5] lib/util.c:show_msg(430)

----------------------------------------------------------------------------
-------------------------

Now is the working stuff, with filenames.

Case that works:  Turkish i's in filenames:

1. We have samba codepage 857 running.
2. We create a samba share [foo]
3. We see this samba share from the NT world:  \\samba01\foo
4. We put into this share, two files:
    italy.gif
    \230test.rtf  (\230 being capital dotted i)
5. We access these from NT --> works fine.
6. We look at samba logs.

_________________________________________
Log fragment for Request for: italy.gif:
__________________________________________

      smb_bcc=20
    [2001/05/23 08:57:43, 10] lib/util.c:dump_data(2918)
      [000] 00 5C 00 01 01 00 00 00  00 5C 69 74 61 6C 79 2E  .\......
.\italy.
    [2001/05/23 08:57:43, 10] lib/util.c:dump_data(2926)
      [010] 67 69 66 00                                       gif.
       [2001/05/23 08:57:43, 3] smbd/process.c:switch_message(448)
      switch message SMBtrans2 (pid 2710)
    [2001/05/23 08:57:43, 5] smbd/uid.c:become_user(264)
      become_user uid=(0,99) gid=(0,99)
    [2001/05/23 08:57:43, 3] smbd/trans2.c:call_trans2qfilepathinfo(1345)
      call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 257
    [2001/05/23 08:57:43, 5] smbd/filename.c:unix_convert(329)
      unix_convert called on file "\italy.gif"
    [2001/05/23 08:57:43, 3] lib/util.c:unix_clean_name(522)
      unix_clean_name [/italy.gif]
    [2001/05/23 08:57:43, 5] smbd/mangle.c:is_8_3(338)
      Checking italy.gif for 8.3
    [2001/05/23 08:57:43, 5] smbd/filename.c:stat_cache_add(216)
      stat_cache_add: Added entry \230TALY.G\230F -> italy.gif
    [2001/05/23 08:57:43, 5] smbd/filename.c:unix_convert(429)
      conversion finished italy.gif -> italy.gif
    [2001/05/23 08:57:43, 8] lib/util.c:is_in_path(2430)
      is_in_path: italy.gif
    [2001/05/23 08:57:43, 8] lib/util.c:is_in_path(2435)
      is_in_path: no name list.
    [2001/05/23 08:57:43, 3] lib/util.c:unix_clean_name(522)
      unix_clean_name [italy.gif]
    [2001/05/23 08:57:43, 3] smbd/trans2.c:call_trans2qfilepathinfo(1363)
      call_trans2qfilepathinfo italy.gif level=257 call=5 total_data=0
    [2001/05/23 08:57:43, 8] smbd/dosmode.c:dos_mode(123)
      dos_mode: italy.gif
    [2001/05/23 08:57:43, 8] lib/util.c:is_in_path(2430)
      is_in_path: italy.gif
    [2001/05/23 08:57:43, 8] lib/util.c:is_in_path(2435)
      is_in_path: no name list.
    [2001/05/23 08:57:43, 8] smbd/dosmode.c:dos_mode(167)
      dos_mode returning
    [2001/05/23 08:57:43, 5] smbd/trans2.c:call_trans2qfilepathinfo(1431)
      SMB_QFBI - create: Wed May 23 08:46:35 2001
       access: Wed May 23 08:46:35 2001
       write: Wed May 23 08:46:35 2001
       change: Wed May 23 08:46:35 2001
       mode: 0
    [2001/05/23 08:57:43, 9] smbd/trans2.c:send_trans2_replies(159)
      t2_rep: params_sent_thistime = 2, data_sent_thistime = 36,
useable_space = 65471

==============================================
Log fragment for Request for \230test.rtf:  (\230 is capital dotted I)
===============================================

    [2001/05/23 08:59:14, 10] lib/util.c:dump_data(2918)
      [000] 00 5C 00 01 01 00 00 00  00 5C 98 74 65 73 74 2E  .\......
.\.test.
    [2001/05/23 08:59:14, 10] lib/util.c:dump_data(2926)
      [010] 72 74 66 00                                       rtf.
    [2001/05/23 08:59:14, 3] smbd/process.c:switch_message(448)
      switch message SMBtrans2 (pid 2710)
    [2001/05/23 08:59:14, 5] smbd/uid.c:become_user(264)
      become_user uid=(0,99) gid=(0,99)
    [2001/05/23 08:59:14, 3] smbd/trans2.c:call_trans2qfilepathinfo(1345)
      call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 257
    [2001/05/23 08:59:14, 5] smbd/filename.c:unix_convert(329)
      unix_convert called on file "\230test.rtf"
    [2001/05/23 08:59:14, 3] lib/util.c:unix_clean_name(522)
      unix_clean_name [/\230test.rtf]
    [2001/05/23 08:59:14, 5] smbd/mangle.c:is_8_3(338)
      Checking \230test.rtf for 8.3
    [2001/05/23 08:59:14, 5] smbd/filename.c:stat_cache_add(216)
      stat_cache_add: Added entry \230TEST.RTF -> \230test.rtf
    [2001/05/23 08:59:14, 5] smbd/filename.c:unix_convert(429)
      conversion finished \230test.rtf -> \230test.rtf
    [2001/05/23 08:59:14, 8] lib/util.c:is_in_path(2430)
      is_in_path: \230test.rtf
    [2001/05/23 08:59:14, 8] lib/util.c:is_in_path(2435)
      is_in_path: no name list.
    [2001/05/23 08:59:14, 3] lib/util.c:unix_clean_name(522)
      unix_clean_name [\230test.rtf]
    [2001/05/23 08:59:14, 3] smbd/trans2.c:call_trans2qfilepathinfo(1363)
      call_trans2qfilepathinfo \230test.rtf level=257 call=5 total_data=0
    [2001/05/23 08:59:14, 8] smbd/dosmode.c:dos_mode(123)
      dos_mode: \230test.rtf
    [2001/05/23 08:59:14, 8] lib/util.c:is_in_path(2430)
      is_in_path: \230test.rtf
    [2001/05/23 08:59:14, 8] lib/util.c:is_in_path(2435)
      is_in_path: no name list.
    [2001/05/23 08:59:14, 8] smbd/dosmode.c:dos_mode(167)
  dos_mode returning a
    [2001/05/23 08:59:14, 5] smbd/trans2.c:call_trans2qfilepathinfo(1431)







More information about the samba-technical mailing list