Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Post by Art Walk » Fri, 08 Sep 1995 04:00:00



The following is a small patch to version 0.2.4 of the 'ksmbfs' filesystem
driver for Linux that allows it to properly recognize long filenames on
systems running Microsoft Windows 95.

I came up with this while setting up ksmbfs to allow a Linux box to back up
a number of PCs running Windows 95 as part of a nightly backup.  While
ksmbfs would mount to the PCs without any problem, the files on the PCs
would appear as translated 8.3 character filenames instead of Windows 95
long filenames.  Some further digging revealed that during the SMB protocol
negotiation sequence, Windows 95 would always select the "LANMAN1.0"
protocol out of the list of protocols that ksmbfs would offer to use.
Apparently, Win95 would only send long filenames if the NT LanManager
protocol ("NT LM 0.12") is used, which ksmbfs doesn't directly support.
However, ksmbfs does support the "LANMAN2" protocol, which the NT version
is based upon and also handles long filenames.

So, I made an addition to the table of supported protocols so that ksmbfs
will tell Windows 95 that it supports NT LanManager, but will actually use
LANMAN2 instead.

WARNING:  The following patch has not been thoroughly tested.  The standard
          disclaimers apply.  The version of ksmbfs I set this up for was
          version 0.2.4 compiled as a loadable module for Linix 1.2.13.  It
          seems to work for me, I can't promise it will do likewise for you.

-----Cut Here---------------------------------------------------------------
*** proc.c.orig Fri Jun 16 11:23:38 1995
--- proc.c      Thu Sep  7 16:42:34 1995
***************
*** 1532,1537 ****
--- 1532,1538 ----
  #endif
  #ifdef LANMAN2
            { PROTOCOL_LANMAN2,"LM1.2X002"},
+           { PROTOCOL_LANMAN2,"NT LM 0.12"},
  #endif
            {-1, NULL} };
        char dev[] = "A:";

--

alt.sex/alt.binaries.pictures.*a/alt.sex.*, etc.
At best, the regulars of these groups are failed phone sex customers...
                                                   - SPY, Jul/Aug 94, Page 85

 
 
 

Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Post by Volker Lendec » Sat, 09 Sep 1995 04:00:00


   The following is a small patch to version 0.2.4 of the 'ksmbfs' filesystem
   driver for Linux that allows it to properly recognize long filenames on
   systems running Microsoft Windows 95.

Wow! I did not think it would be so simple. I will send a patch to linus to
make 1.3.x work that way, too.

--
    Volker

   +=================================================================+

   ! D-37081 Goettingen, Germany                                     !
   +=================================================================+

 
 
 

Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Post by Gilbert Callagh » Sun, 10 Sep 1995 04:00:00





>   The following is a small patch to version 0.2.4 of the 'ksmbfs' filesystem
>   driver for Linux that allows it to properly recognize long filenames on
>   systems running Microsoft Windows 95.

>Wow! I did not think it would be so simple. I will send a patch to linus to
>make 1.3.x work that way, too.

Well there might be a bit more to it... I hand patched the one line into
Linux 1.3.24 which has the smbfs built in, and it crashed when I did the
smbmount.  Now I have to drive to work to press the reset button :-(
I'm not saying for sure this isn't the right fix; I'll try it again.
Thanks for the patch (and especially smb!)

--
Gilbert Callaghan

--


 
 
 

Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Post by Peter van der Lande » Tue, 12 Sep 1995 04:00:00



>Well there might be a bit more to it... I hand patched the one line into
>Linux 1.3.24 which has the smbfs built in, and it crashed when I did the
>smbmount.  Now I have to drive to work to press the reset button :-(

It crashed my Linux 1.2.8 too, just as I was getting close to break my uptime record. Oh
well, he did warn us...

Maybe these messages from my messages file may help? (maybe not)

Sep 10 19:31:37 Tina kernel: smb_receive: Received length (3222) > max_xmit (2924)!
Sep 10 19:31:48 Tina last message repeated 199 times
Sep 10 19:31:48 Tina kernel: smb_proc_readdir_long: Looping in FIND_NEXT??
Sep 10 19:32:52 Tina kernel: smb_receive: Received length (3222) > max_xmit (2924)!
Sep 10 19:33:08 Tina last message repeated 199 times
Sep 10 19:33:08 Tina kernel: smb_proc_readdir_long: Looping in FIND_NEXT??
Sep 10 19:53:51 Tina kernel: smbfs: init_module called
Sep 10 19:54:25 Tina kernel: smb_response: rcls=70, err=17989
Sep 10 19:54:25 Tina kernel: smb_proc_connect: Passed SESSION REQUEST.
Sep 10 19:54:25 Tina kernel: smb_proc_connect: Server wants NT LM 0.12 protocol.
Sep 10 19:54:25 Tina kernel: smb_proc_connect: password =
Sep 10 19:54:25 Tina kernel: smb_proc_connect: usernam = ROOT
Sep 10 19:54:25 Tina kernel: max_xmit = 2924, tid = 53249
Sep 10 19:54:25 Tina kernel: smb_proc_connect: Normal exit
Sep 10 19:54:25 Tina kernel: smb_read_super : 44803 512 64 7278
Sep 10 19:54:25 Tina kernel: smb_proc_open: path=\
Sep 10 19:54:25 Tina kernel: smb_response: rcls=1, err=2
Sep 10 19:54:25 Tina kernel: smb_errno: ERRDOS - ERRbadfile (File not found.)
Sep 10 19:54:25 Tina kernel: smb_read_super: SMB_SBP(sb) = ccf018
Sep 10 19:54:31 Tina kernel: smb_readdir: Not found in cache.

Sep 10 19:54:31 Tina kernel:           mask = \*
Sep 10 19:54:31 Tina kernel: smb_receive: Received length (3222) > max_xmit (2924)!

Eagerly awaiting the new version,

Peter van der Landen

-----------------------------------------------------------------------------
 Centre for Computers and Law, L4-42, Erasmus University, Rotterdam, Holland
     Tel 31-10-4082187 (home 2331650) Fax 31-10-4082920 (home 2331215)

 
 
 

Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Post by Gilbert Callagh » Tue, 12 Sep 1995 04:00:00





>>Well there might be a bit more to it... I hand patched the one line into
>>Linux 1.3.24 which has the smbfs built in, and it crashed when I did the
>>smbmount.  Now I have to drive to work to press the reset button :-(

>It crashed my Linux 1.2.8 too, just as I was getting close to break my uptime record. Oh
>well, he did warn us...

>Maybe these messages from my messages file may help? (maybe not)

>Sep 10 19:31:37 Tina kernel: smb_receive: Received length (3222) > max_xmit (2924)!

Yes, this does seem to be the key.  If you cd to a 'small' directory, it
will work, but a 'large' one fails.  I guess this buffer needs to be
increased to hold the exctra long names.

--
Gilbert Callaghan

--


 
 
 

Linux ksmbfs-0.2.4 patch for Win95 long filenames.

Post by Erwin Authri » Fri, 15 Sep 1995 04:00:00


: Hi!

: I looked at the SMB spec a bit more closely and have tried to implement the
: buffer size parameters better. Here's a patch against plain 1.3.25 which
: MIGHT solve the problem. As I do not have Win95, I can not test it
: myself. All those who have problems, please try the following patch and
: tell me how it works. But, as always, be careful.

I tried your patch and it works GREAT with Win95 long filenames, even
with Umlaut characters ! Thanks for the patch !
There are only a few remaining problems:

1. The DOS characterset is used for the Umlaut characters on the Samba
   server, so they don't appear right in Linux. (Just a cosmetical problem)

2. The DOS-attributes (System,Read Only, Hidden) seem to be ignored.
      (Maybe I have missed something ??)

-Erwin