[Samba] incomplete smbmount smbfs Win98SE iso8859-1 translation in kernel 2.4.18

Ian! D. Allen idallen at freenet.carleton.ca
Tue Sep 3 05:09:01 GMT 2002


On Mon, Sep 02, 2002 at 10:30:13PM +0000, Urban Widmark wrote:
> On Mon, 2 Sep 2002, Ian! D. Allen [NCFreeNet] wrote:
> 
> > # cat /proc/mounts | grep /mnt/d
> > //win/D /mnt/d smbfs //ro,win95,file_mode=0755,dir_mode=0755,codepage=cp850 0 0
>                        ^^
> What is that?

Transcription cut/paste error in vi.  Vi folded the line when I pasted
it and stuck an extra // in front of the folded bit because it thought
it was a continued C++ comment.  I didn't notice the // when I re-joined
the line back into one piece.  Sorry about that.  It really is:

 //win/D /mnt/d smbfs ro,win95,file_mode=0755,dir_mode=0755,codepage=cp850 0 0

> > nls_cp850               3584   1  (autoclean)
> > nls_iso8859-1           2816   1  (autoclean)
> 
> If you umount and unload the smbfs module, these both go to 0?

Yes.

> To find out what the server is sending you could sniff it using ethereal 
> and see if it makes sense.

Good idea.  Here is the last part of the ethereal dump for that directory
being sent from the Win98 machine into my Linux machine:

    bf 01 00 f7 97 d8 19 45  bf 01 4f 00 00 00 00 00   ¿..÷.Ø.E ¿.O.....
    00 00 4f 00 00 00 00 00  00 00 20 00 00 00 20 00   ..O..... .. ... .
    00 00 00 00 00 00 0c 00  54 45 53 54 80 5f 7e 31   ........ TEST._~1
    2e 55 52 4c 00 00 00 00  00 00 00 00 00 00 00 00   .URL.... ........
    74 65 73 74 87 5f 82 90  83 88 8c 93 96 5f 5f 5f   test._.. .....___
    5f 5f 85 8a 8d 95 97 5f  5f 5f 5f 5f 2e 75 72 6c   __....._ ____.url

In the dump, one can see the DOS "8.3" short name for my file
"TEST?_~1.URL" followed by the Windows long name starting with "test".

I note that the bytes coming in via the Windows long name are already
underscores before they even enter my Linux box.  Obviously Win98 isn't
sending the correct bytes down the wire.  Now how do I track down the
reason for that?  [Read the Windows source code?  :-(]

Clearly some autonegociation has taken place between my Linux box smbfs
and Win98 that has convinced Win98 that I can't handle the full iso8859-1
character set, so Win98 is "censoring" some (but not all) of the non-ASCII
bytes for me by replacing them with underscores.

I'm not fluent in the SMB protocol; I don't know where the negociation
is getting misunderstood (or how to change it).  I saved the raw ethereal
capture dump (8537 bytes) here if you want to decode it:

    http://idallen.ca/~idallen/sambadump.bin

The linux box is 192.168.0.2 and the Windows98 box is 192.168.0.5.
What I did for the capture was:

  # mount -r -t smbfs -o iocharset=iso8859-1,codepage=cp850 //win/D /mnt/d
  # echo /mnt/d/test*
  # echo /mnt/d/test*
  # echo /mnt/d/test*
  # echo /mnt/d/test*
  # echo /mnt/d/test*
  # umount /mnt/d

Here is the Win98 test name I created under D:\ in the above dumps:

    testçãéÉâêîôûÂÊÎÔÛàèìòùÀÈÌÒÙ.url

What I actually see when I mount it via smbfs is:

    testç_éÉâêîôû_____àèìòù_____.url

How do I tell Win98 to give me *all* the bytes?
(And don't other Mandrake 8.2 users have this problem too?)

-- 
-IAN!  Ian! D. Allen   Ottawa, Ontario, Canada   idallen at ncf.ca
       Home Page on the Ottawa FreeNet: http://www.ncf.ca/~aa610/
       College professor at: http://www.algonquincollege.com/~alleni/
       Board Member, TeleCommunities CANADA  http://www.tc.ca/



More information about the samba mailing list