Bug 6867 - trans2findnext returns reply_nterror(req, ntstatus) In a directory with a lot of files
trans2findnext returns reply_nterror(req, ntstatus) In a directory with a lo...
Status: RESOLVED FIXED
Product: Samba 3.4
Classification: Unclassified
Component: Client Tools
3.4.2
All Linux
: P3 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-02 06:58 UTC by Juan Ramón Marcobal
Modified: 2009-11-04 07:40 UTC (History)
0 users

See Also:


Attachments
git-am format patch for 3.4.4. (2.93 KB, patch)
2009-11-02 15:05 UTC, Jeremy Allison
vl: review+
jra: review? (metze)
Details
git-am format patch for 3.3.10 (2.92 KB, patch)
2009-11-02 15:53 UTC, Jeremy Allison
vl: review+
jra: review? (metze)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juan Ramón Marcobal 2009-11-02 06:58:17 UTC
I have 2 samba servers, samba-3.0.33 (Centos) and samba-3.4.2. And I have a "mediabox" connected to them.

This  media box is based on a linux-firmware and I can´t change its firmware.

It connects to server with: "/sbin/mount.smbf //ip/share /mount -n -o rw 
workgroup GRUPO password XXXXXX codepage cp850 iocharset iso8859-1" using a module smbfs.o compiled for kernel-2.4.21-xfs

That is OK with samba-3.0.33 BUT in samba-3.4.2 when I list a directory with a lot of files doesn´t work (same times return 0 files and other times only a few files)

With Wireshark I have see that 'mediabox' USES trans2findnext with a flag continue_bit=1 and doesn't use filename(resume_name) to continue.


when I compare the two version, I find in smbd/trans2.c in function 'call_trans2findnext' that samba-3.0.33(that works OK):
------
if (!(ISDOT(resume_name) || ISDOTDOT(resume_name))) {
	return ERROR_NT(ntstatus);
}
------


and in samba-3.4.2(that fails):
------
  if (!resume_name || !(ISDOT(resume_name) || ISDOTDOT(resume_name))) {
                        reply_nterror(req, ntstatus);
                        return;
                }
--------

I think, should be:
  if (!continue_bit && (!resume_name || !(ISDOT(resume_name) || ISDOTDOT(resume_name)))) {
                        reply_nterror(req, ntstatus);
                        return;
                }
--------------

When I've made this change all is OK.


I can´t found nothing about it in any forum, but I have found a lot of messages of people (people with different mediaboxes)  that have problems to list directories with a lot of files.

I don't know if this is the best way to correct the problem.

As well,  I think the debug string (DEBUG(3,("call_trans2findnext:......) should be before the call to 'srvstr_get_path_wcard'.

Thank you, and sorry for my english.
Comment 1 Jeremy Allison 2009-11-02 13:25:34 UTC
Completely correct - thanks ! I'll fix this in master and 3.5.0 and create patches for 3.3.10 and 3.4.4.
Jeremy.
Comment 2 Jeremy Allison 2009-11-02 15:05:11 UTC
Created attachment 4913 [details]
git-am format patch for 3.4.4.
Comment 3 Jeremy Allison 2009-11-02 15:53:10 UTC
Created attachment 4914 [details]
git-am format patch for 3.3.10
Comment 4 Jeremy Allison 2009-11-02 15:54:56 UTC
Re-assigning to Karolin for inclusion once Volker or Metze have reviewed.
Jeremy.
Comment 5 Juan Ramón Marcobal 2009-11-03 05:54:53 UTC
Thank you very much. 
Comment 6 Karolin Seeger 2009-11-04 07:40:34 UTC
Pushed to v3-4-test and v3-3-test.
Closing out bug report.

Thanks!