lkml.org 
[lkml]   [1999]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Linux 2.2.14pre5
On Sat, 13 Nov 1999, Alan Cox wrote:

> o SMBfs long directory fix (Pete Hilton)

This one looks incomplete to me. It only changes the "findfirst" call and
not the "findnext" to not ask for resume keys. I don't see why they should
be sent with different flags. I ran into this problem myself a few weeks
ago.

There is a related bug with the filename "mask". smbfs does not get the
pointer to the last transfered name right (it has a pointer to a record,
but reads it as the actual name). For me samba servers stopped handling
(some) long dirs correctly when removing the "resume required" flag and
not also fixing the mask. The NTs tested did not seem to care.


I have a testcase on:
http://www.hojdpunkten.ac.se/054/samba/samba-dir.zip
(unpack on the server, then look at it with smbfs)

Attached is my version of solving the same problem. I have previously
posted this patch to the samba mailinglist. I did not send it to the
maintainer, I wanted to feel more certain that it worked (since I don't
really know _why_ the resumekey flag should be removed ... except that the
keys are always 0 ...)

Patch was made for 2.2.12, but should still apply.

/Urban
diff -ur linux-2.2.12-clean/fs/smbfs/proc.c linux/fs/smbfs/proc.c
--- linux-2.2.12-clean/fs/smbfs/proc.c Sat Oct 23 17:44:54 1999
+++ linux/fs/smbfs/proc.c Sat Oct 23 22:25:49 1999
@@ -1599,8 +1599,7 @@
command = TRANSACT2_FINDFIRST;
WSET(param, 0, aSYSTEM | aHIDDEN | aDIR);
WSET(param, 2, max_matches); /* max count */
- WSET(param, 4, 8 + 4 + 2); /* resume required +
- close on end +
+ WSET(param, 4, 4 + 2); /* close on end +
continue */
WSET(param, 6, info_level);
DSET(param, 8, 0);
@@ -1615,8 +1614,7 @@
WSET(param, 2, max_matches); /* max count */
WSET(param, 4, info_level);
DSET(param, 6, ff_resume_key); /* ff_resume_key */
- WSET(param, 10, 8 + 4 + 2); /* resume required +
- close on end +
+ WSET(param, 10, 4 + 2); /* close on end +
continue */
if (server->mnt->version & SMB_FIX_WIN95)
{
@@ -1687,6 +1685,12 @@
case 259:
if (ff_lastname < resp_data_len)
mask_len = resp_data_len - ff_lastname;
+ /* The lastname pointer points to the record,
+ not to the name. */
+ lastname += 12;
+ mask_len -= 12;
+ if(mask_len < 0)
+ mask_len = 0;
break;
case 1:
/* Win NT 4.0 doesn't set the length byte */
\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.037 / U:1.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site