Bug 221 - multibyte user/computer names make nmbd crash
Summary: multibyte user/computer names make nmbd crash
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Extended Characters (show other bugs)
Version: 3.0.0preX
Hardware: All All
: P2 normal
Target Milestone: 3.0.0rc2
Assignee: Jeremy Allison
QA Contact:
Depends on:
Reported: 2003-07-13 07:59 UTC by TAKAHASHI Motonobu
Modified: 2005-08-24 10:18 UTC (History)
1 user (show)

See Also:

prevents nmbd crash (3.34 KB, patch)
2003-07-13 08:16 UTC, TAKAHASHI Motonobu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description TAKAHASHI Motonobu 2003-07-13 07:59:29 UTC
See the thread of 
Comment 1 TAKAHASHI Motonobu 2003-07-13 08:16:40 UTC
Created attachment 49 [details]
prevents nmbd crash
Comment 2 TAKAHASHI Motonobu 2003-07-13 08:20:40 UTC
The "prevents nmbd crash" patch written by MORIYAMA Masayuki 
<msyk@mtg.biglobe.ne.jp> also prevents nmbd crash, 
but we cannot see Japanese computer name and comments on the browselist.
In browse.dat the computer name and comments are correctly written 
in Japanese (CP932 encoded).
Comment 3 Gerald (Jerry) Carter (dead mail address) 2003-07-15 09:32:24 UTC
moving to extended character component
Comment 4 Alexander Bokovoy 2003-07-15 11:20:17 UTC
Accept this bug.
Comment 5 TAKAHASHI Motonobu 2003-07-15 15:17:19 UTC
I found a problem that multibyte comments and computername on
browselist are not displayed from Windows clients.

This is because the following coding at smbd/lanman.c:1123

  push_ascii(p,service->name,15, STR_TERMINATE);
    <-- computername
  len += CopyAndAdvance(&p2,service->comment,&l2);
    <-- comments

For comments field, there are 2 problems:

one is the CopyAndAdvance() breaks byte order.

Another is that in browse.dat, the codeset is 'as is (same as dos
charset)', but in CopyAndAdvance(), push_ascii(), which assumes input
strings are encoded with  unix charset, is used. So if 'dos charset'
and 'unix charset' is different, the push_ascii() cannnot work well.
(And dos charset must be set correctly.)

To fix the problem, determine browse.dat is written with 'as is' and
modify the lanman.c or determine browse.dat is written with 'unix
charset' and modify the codes of nmbd.
Comment 6 Gerald (Jerry) Carter (dead mail address) 2003-08-28 09:34:59 UTC
should be fixed in latest SAMBA_3_0 cvs tree 
(to be included in 3.0.0rc2).  Please retest
Comment 7 Gerald (Jerry) Carter (dead mail address) 2003-08-29 08:00:36 UTC
I'm marking this as fixed in hopes that all of the mutibyte
character set work that was done for RC2 does resolve the 
problem.  If not, please reopen the bug
Comment 8 Gerald (Jerry) Carter (dead mail address) 2005-02-07 08:40:49 UTC
originally reported against 3.0.0beta2.  CLeaning out 
non-production release versions.
Comment 9 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:18:33 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.