I have ru_RU.UTF-8 locale. If remote computer has share with russian name then smbclient gets the name of this share in truncated form. The shares with english names look correctly.
What are your smb.conf settings for language ? Jeremy.
unix charset = utf8 display charset = utf8 dos charset = cp866
Your character set settings look correct as long as the shell you are running in has the utf8 locale set. Ok, can you tell me how you're getting the share names - doing smbclient -L ? Which Linux distribution are you running on ? What iconv library (or glibc version) are you using ? Are you really using 3.0.0rc1 or have you upgraded to Samba 3.0 released ? Have you tried the 3.0.1pre release ? Jeremy.
You are right. I use 3.0.1pre release of samba. $ iconv -V iconv (GNU libc) 2.3.2 Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Ulrich Drepper. I use RedHat 9. kernel - 2.4.22 Yes, I use 'smbclient -L' to get shares. But smbtree gets the names of shares correctly.
Add Cc: sugj-tech@samba.gr.jp to track this problem.
Created attachment 408 [details] proposed patch Alex, please try this patch. In source/client/client.c, browse_fn() uses d_printf() with format "%-15.15s" to print a sharename to terminal: d_printf("\t%-15.15s%-10.10s%s\n", name,typestr,comment); If length (byte number) of a sharename is longer than 15, printing sharename is truncated.
The patch in Additional Comment #6 has a fix for server_fn() function: Index: source/client/client.c =================================================================== RCS file: /cvsroot/samba/source/client/client.c,v retrieving revision 1.209.2.48 diff -u -p -r1.209.2.48 client.c --- source/client/client.c 12 Feb 2004 17:26:34 -0000 1.209.2.48 +++ source/client/client.c 19 Feb 2004 06:29:11 -0000 @@ -2037,7 +2037,7 @@ static void server_fn(const char *name, { if (!grepable){ - d_printf("\t%-16.16s %s\n", name, comment); + d_printf("\t%-16s %s\n", name, comment); } else { d_printf("%s|%s|%s\n",(char *)state, name, comment); } In some languages (e.g. Japanese), unix charset (e.g. UTF-8) and some characters, length of a string encoded in unix charset is longer than length of the string encoded in dos charset (CP932 for Windows Japanese edition). On the other hand, the limit of workgroupname byte length (15 or 16 (with name type)) is defined for dos charset. If workgroupname length is <16 bytes (valid length) in dos charset and is >16 bytes in unix charset, function: d_printf("\t%-16.16s %s\n", name, comment); truncates VALID workgroupname. Do not discard the fix for this problem.
patch applied to 3.0 and HEAD
originally reported against one of the 3.0.0rc[1-4] releases. Cleaning up non-production versions.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
database cleanup