[Samba] Mounting file shares in UTF-8

Julian Pellico thoth at ugcs.caltech.edu
Fri May 28 19:33:49 GMT 2004


Hi,

I've searched for lots of messages similar to this, but none as detailed
as this, and I haven't seen an answer that helps me.

I have a Win 2000 machine that has some file shares on it. These shares
are international; files and directories have characters from many
languages. The system codepage is set to 932. I'm using the smb binaries
from samba 3 to mount these shares on a Linux box. My goal is to mount it
so that file names and directories are in UTF-8 from the point of view of
the Linux filesystem. Unfortunately, I haven't figured out how to get this
to work.

Here is my bare bones smb.conf file:
unix charset = UTF8
display charset = UTF8
unicode = yes

Here's the command I run:
$ smbmount //.../greek /greek -o username=...
creating lame upcase table
creating lame lowcase table
Password:

I don't have a terminal that's set up to show UTF-8 correctly, so I run ls
-b to see an escaped listing:
$ ls -b /greek
df
gtrdfhsdf
\203\241\203\257\203\241\203\263\203\242\203\241\203\263\203\301\203\320\203\302\203\323
\203\301\203\317\203\303\203\303\203\310.txt

That last file has Greek characters; in Unicode, the first byte would be
03; in UTF-8, CE; in CP932, 83. Octal 203 = hex 83, so that file is listed
in the Win2K codepage.

This is the only output relevant to conversions from configure:
checking for iconv in /usr... yes
checking can we convert from CP850 to UCS2-LE?... CP850
checking can we convert from ASCII to UCS2-LE?... ASCII
checking can we convert from UTF-8 to UCS2-LE?... UTF-8

At the end of this message I have the complete conversation between Samba
and the server, for any SMB protocol experts that happen to see this.

My iconv is coming from glibc 2.2.5. My Linux is Slackware 9.1. Samba
3.0.2a.

Based on what I've gathered from resources I've found online, Samba 3
should be able to get file listings from Win 2K in "Unicode", right? And
this could be converted to UTF-8? Would this ability be dependent on any
settings outside of Samba 3, for example, locale? My current locale is "C"
and there are no UTF-8 locales on my box.

On a side note, when I don't build and install CP850.so, I see
smbmount/smbclient spew out ~65000 lines of "convert_string_internal:
Conversion not supported." When I do install it, I get
"smbmount: relocation error: /etc/charset/CP850.so: undefined symbol:
smb_register_charset"
And when I run nm on CP850.so, I see
         U smb_register_charset

Thanks for reading.


Here is the conversation between Samba and the server.
*** Conversation for mounting ***
0.0162 (0.0162)  C>S
---------------------------------------------------------------
00 00 00 b3 ff 53 4d 42 72 00 00 00 00 08 01 c0    .....SMBr.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 72    ...............r
00 00 01 00 00 90 00 02 50 43 20 4e 45 54 57 4f    ........PC NETWO
52 4b 20 50 52 4f 47 52 41 4d 20 31 2e 30 00 02    RK PROGRAM 1.0..
4d 49 43 52 4f 53 4f 46 54 20 4e 45 54 57 4f 52    MICROSOFT NETWOR
4b 53 20 31 2e 30 33 00 02 4d 49 43 52 4f 53 4f    KS 1.03..MICROSO
46 54 20 4e 45 54 57 4f 52 4b 53 20 33 2e 30 00    FT NETWORKS 3.0.
02 4c 41 4e 4d 41 4e 31 2e 30 00 02 4c 4d 31 2e    .LANMAN1.0..LM1.
32 58 30 30 32 00 02 44 4f 53 20 4c 41 4e 4d 41    2X002..DOS LANMA
4e 32 2e 31 00 02 53 61 6d 62 61 00 02 4e 54 20    N2.1..Samba..NT
4c 41 4e 4d 41 4e 20 31 2e 30 00 02 4e 54 20 4c    LANMAN 1.0..NT L
4d 20 30 2e 31 32 00                               M 0.12.
---------------------------------------------------------------

0.0169 (0.0006)  S>C
---------------------------------------------------------------
00 00 00 6d ff 53 4d 42 72 00 00 00 00 88 01 c0    ...m.SMBr.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 72    ...............r
00 00 01 00 11 08 00 07 32 00 01 00 04 41 00 00    ........2....A..
00 00 01 00 00 00 00 00 fd f3 00 00 a0 1c 51 d3    ..............Q.
8f 42 c4 01 a4 01 08 28 00 f4 2a 3f b5 4c 96 13    .B.....(..*?.L..
16 53 00 4f 00 4c 00 41 00 52 00 53 00 59 00 53    .S.O.L.A.R.S.Y.S
00 54 00 45 00 4d 00 00 00 53 00 55 00 4e 00 00    .T.E.M...S.U.N..
00                                                 .
---------------------------------------------------------------

3.5151 (3.4982)  C>S
---------------------------------------------------------------
00 00 00 90 ff 53 4d 42 73 00 00 00 00 08 01 00    .....SMBs.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 72    ...............r
00 00 02 00 0d ff 00 00 00 ff ff 02 00 82 72 00    ..............r.
00 00 00 18 00 18 00 00 00 00 00 10 00 00 00 53    ...............S
00 4b 1c 33 7e 60 70 2c a2 81 51 42 b2 62 9e 51    .K.3~`p,..QB.b.Q
50 82 41 be 44 16 11 07 82 63 f6 36 91 09 4b 6b    P.A.D....c.6..Kk
8b 29 ab fc bd fb 91 ff 51 91 a0 5c 68 1b 90 a2    .)......Q..\h...
ad 41 64 6d 69 6e 69 73 74 72 61 74 6f 72 00 57    .Administrator.W
4f 52 4b 47 52 4f 55 50 00 55 6e 69 78 00 53 61    ORKGROUP.Unix.Sa
6d 62 61 00                                        mba.
---------------------------------------------------------------

3.5185 (0.0033)  S>C
---------------------------------------------------------------
00 00 00 5a ff 53 4d 42 73 00 00 00 00 88 01 00    ...Z.SMBs.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 72    ...............r
01 b8 02 00 03 ff 00 5a 00 00 00 31 00 57 69 6e    .......Z...1.Win
64 6f 77 73 20 35 2e 30 00 57 69 6e 64 6f 77 73    dows 5.0.Windows
20 32 30 30 30 20 4c 41 4e 20 4d 61 6e 61 67 65     2000 LAN Manage
72 00 53 4f 4c 41 52 53 59 53 54 45 4d 00          r.SOLARSYSTEM.
---------------------------------------------------------------

3.5189 (0.0004)  C>S
---------------------------------------------------------------
00 00 00 48 ff 53 4d 42 75 00 00 00 00 08 01 00    ...H.SMBu.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 72    ...............r
01 b8 03 00 04 ff 00 00 00 00 00 01 00 1d 00 00    ................
5c 5c 31 30 2e 31 32 37 2e 32 30 2e 31 32 33 5c    \\10.127.20.123\
47 52 45 45 4b 00 3f 3f 3f 3f 3f 00                GREEK.?????.
---------------------------------------------------------------

3.5200 (0.0011)  S>C
---------------------------------------------------------------
00 00 00 31 ff 53 4d 42 75 00 00 00 00 88 01 00    ...1.SMBu.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 82 72    .............h.r
01 b8 03 00 03 ff 00 31 00 01 00 08 00 41 3a 00    .......1.....A:.
4e 54 46 53 00                                     NTFS.
---------------------------------------------------------------

7.9801 (4.4601)  C>S
---------------------------------------------------------------
00 00 00 23 ff 53 4d 42 80 00 00 00 00 08 03 00    ...#.SMB........
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 00 00 00                               .......
---------------------------------------------------------------

7.9807 (0.0005)  S>C
---------------------------------------------------------------
00 00 00 2d ff 53 4d 42 80 00 00 00 00 88 03 00    ...-.SMB........
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 05 1a 95 00 04 00 02 20 81 00 00 00    ........... ....
00                                                 .
---------------------------------------------------------------

7.9813 (0.0005)  C>S
---------------------------------------------------------------
00 00 00 4c ff 53 4d 42 32 00 00 00 00 08 03 00    ...L.SMB2.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 0f 08 00 00 00 40 00 60 40 00 00 00    ......... at .`@...
00 00 00 00 00 00 00 08 00 44 00 00 00 4c 00 01    .........D...L..
00 05 00 0b 00 00 44 20 01 00 00 00 00 00 5c 00    ......D ......\.
---------------------------------------------------------------

7.9821 (0.0007)  S>C
---------------------------------------------------------------
00 00 00 52 ff 53 4d 42 32 00 00 00 00 88 03 00    ...R.SMB2.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 0a 02 00 16 00 00 00 02 00 38 00 00    .............8..
00 16 00 3c 00 00 00 00 00 1b 00 00 00 00 00 01    ...<............
87 30 a4 83 b9 30 62 63 b2 30 1c 66 00 00 00 00    .0...0bc.0.f....
00 00 00 00 30 00                                  ....0.
---------------------------------------------------------------
*** end conversation for mounting ***
*** begin conversation for ls /greek ***
186.2683 (6.9863)  C>S
---------------------------------------------------------------
00 00 00 4c ff 53 4d 42 32 00 00 00 00 08 03 00    ...L.SMB2.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 0f 08 00 00 00 40 00 60 40 00 00 00    ......... at .`@...
00 00 00 00 00 00 00 08 00 44 00 00 00 4c 00 01    .........D...L..
00 05 00 0b 00 00 44 20 01 00 00 00 00 00 5c 00    ......D ......\.
---------------------------------------------------------------

186.2692 (0.0009)  S>C
---------------------------------------------------------------
00 00 00 52 ff 53 4d 42 32 00 00 00 00 88 03 00    ...R.SMB2.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 0a 02 00 16 00 00 00 02 00 38 00 00    .............8..
00 16 00 3c 00 00 00 00 00 1b 00 00 00 00 00 01    ...<............
87 30 a4 83 b9 30 15 65 b2 30 1c 66 00 00 00 00    .0...0.e.0.f....
00 00 00 00 30 00                                  ....0.
---------------------------------------------------------------

186.2697 (0.0005)  C>S
---------------------------------------------------------------
00 00 00 54 ff 53 4d 42 32 00 00 00 00 08 03 00    ...T.SMB2.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 0f 0f 00 00 00 40 00 60 40 00 00 00    ......... at .`@...
00 00 00 00 00 00 00 0f 00 44 00 00 00 54 00 01    .........D...T..
00 01 00 13 00 00 44 20 16 00 00 02 02 00 04 01    ......D ........
00 00 00 00 5c 2a 00 00                            ....\*..
---------------------------------------------------------------

186.2717 (0.0019)  S>C
---------------------------------------------------------------
00 00 03 a4 ff 53 4d 42 32 00 00 00 00 88 03 00    .....SMB2.......
00 00 00 00 00 00 00 00 00 00 00 00 04 68 01 00    .............h..
01 b8 01 00 0a 0a 00 60 03 00 00 0a 00 38 00 00    .......`.....8..
00 60 03 44 00 00 00 00 00 6d 03 00 05 00 08 00    .`.D.....m......
01 00 00 00 f0 02 44 20 60 00 00 00 00 00 00 00    ......D `.......
30 78 5e 1e f8 1c c4 01 50 08 c7 54 8c 42 c4 01    0x^.....P..T.B..
f0 a9 99 26 11 3d c4 01 f0 a9 99 26 11 3d c4 01    ...&.=.....&.=..
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00    0...............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00 00 00 00 00 00 2e 00 68 00 00 00 00 00 00 00    ........h.......
30 78 5e 1e f8 1c c4 01 50 08 c7 54 8c 42 c4 01    0x^.....P..T.B..
f0 a9 99 26 11 3d c4 01 f0 a9 99 26 11 3d c4 01    ...&.=.....&.=..
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00    0...............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00 00 00 00 00 00 2e 2e 00 00 00 00 00 00 00 00    ................
68 00 00 00 00 00 00 00 50 25 ed 01 4e 22 c4 01    h.......P%..N"..
10 7c b7 7a 8c 42 c4 01 d0 96 98 b2 36 26 c4 01    .|.z.B......6&..
c0 5c 42 a9 fb 27 c4 01 00 00 00 00 00 00 00 00    .\B..'..........
00 00 00 00 00 00 00 00 30 00 00 00 03 00 00 00    ........0.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 66    ..............df
00 00 00 00 00 00 00 00 68 00 00 00 00 00 00 00    ........h.......
d0 81 45 28 4e 22 c4 01 40 03 b9 7a 8c 42 c4 01    ..E(N".. at ..z.B..
e0 61 cd 17 39 26 c4 01 f0 e3 43 a9 fb 27 c4 01    .a..9&....C..'..
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30 00 00 00 0a 00 00 00 00 00 00 00 10 00 47 00    0.............G.
54 00 52 00 44 00 46 00 48 00 7e 00 31 00 00 00    T.R.D.F.H.~.1...
00 00 00 00 00 00 67 74 72 64 66 68 73 64 66 00    ......gtrdfhsdf.
70 00 00 00 00 00 00 00 20 99 b1 49 51 22 c4 01    p....... ..IQ"..
60 2e c2 7a 8c 42 c4 01 60 bd e1 ef 39 26 c4 01    `..z.B..`...9&..
b0 00 4a a9 fb 27 c4 01 00 00 00 00 00 00 00 00    ..J..'..........
00 00 00 00 00 00 00 00 30 00 00 00 0c 00 00 00    ........0.......
00 00 00 00 10 00 48 00 55 00 42 00 42 00 41 00    ......H.U.B.B.A.
48 00 7e 00 31 00 00 00 00 00 00 00 00 00 68 75    H.~.1.........hu
62 62 61 20 68 75 62 62 61 00 00 00 00 00 00 00    bba hubba.......
78 00 00 00 00 00 00 00 e0 f7 e8 e5 46 22 c4 01    x...........F"..
60 2e c2 7a 8c 42 c4 01 d0 00 fd d4 47 22 c4 01    `..z.B......G"..
a0 a4 51 a9 fb 27 c4 01 00 00 00 00 00 00 00 00    ..Q..'..........
00 00 00 00 00 00 00 00 30 00 00 00 17 00 00 00    ........0.......
00 00 00 00 0a 00 93 03 a1 03 93 03 7e 00 31 00    ............~.1.
00 00 00 00 00 00 00 00 00 00 00 00 00 00 83 a1    ................
83 af 83 a1 83 b3 83 a2 83 a1 83 b3 83 c1 83 d0    ................
83 c2 83 d3 00 00 00 00 70 00 00 00 00 00 00 00    ........p.......
70 5b d2 fb fa 1c c4 01 80 86 d5 4f 1c 3d c4 01    p[.........O.=..
00 32 74 88 f8 1c c4 01 70 4a db dd 93 40 c4 01    .2t.....pJ... at ..
28 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00    (.......(.......
20 00 00 00 0f 00 00 00 00 00 00 00 14 00 41 00     .............A.
34 00 46 00 43 00 7e 00 31 00 2e 00 54 00 58 00    4.F.C.~.1...T.X.
54 00 00 00 00 00 83 c1 83 cf 83 c3 83 c3 83 c8    T...............
2e 74 78 74 00 00 00 00 00 00 00 00 00 00 00 00    .txt............
50 85 67 20 11 3d c4 01 50 85 67 20 11 3d c4 01    P.g .=..P.g .=..
50 85 67 20 11 3d c4 01 f0 a9 99 26 11 3d c4 01    P.g .=.....&.=..
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
20 00 00 00 0d 00 00 00 00 00 00 00 00 00 00 00     ...............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00 00 00 00 00 00 82 d0 82 e7 82 aa 82 c8 2e 74    ...............t
78 74 00 00 00 00 00 00                            xt......
---------------------------------------------------------------
*** end conversation for listing /greek ***
You can see lots of characters in the code page up there (83 c1 83 cf 83
c3 83 c3 83 c8)


More information about the samba mailing list