Bug 1382 - smbclient with recurse-on, dir/ls both fail in V3.04.
smbclient with recurse-on, dir/ls both fail in V3.04.
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: smbclient
3.0.4
All Linux
: P1 critical
: none
Assigned To: Gerald (Jerry) Carter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-25 04:53 UTC by Phill Bertolus
Modified: 2005-08-24 10:20 UTC (History)
0 users

See Also:


Attachments
patch undoing this changes in client.c (600 bytes, patch)
2004-10-22 01:25 UTC, Andy Crook
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phill Bertolus 2004-05-25 04:53:49 UTC
Setting recurse to ON and then doing dir or ls will fail to list the contents of
sub-directories. Only the current directory is dealt with.

This is a recent breakage. Worked fine on all versions upto 3.02a. Haven't
checked 3.03.
Comment 1 Phill Bertolus 2004-05-26 00:05:26 UTC
Found it!

Turns out that
static int cmd_dir(void)
had some code changed.

The changes are:
V3.02a which works has a passage of code like so

        pstrcpy(mask,cur_dir);
        if(mask[strlen(mask)-1]!='\\')
                pstrcat(mask,"\\");

which got changed to this is V3.04 which does not work.

        if (strcmp(cur_dir, "\\") != 0) {
                pstrcpy(mask,cur_dir);
                if(mask[strlen(mask)-1]!='\\')
                        pstrcat(mask,"\\");
        } else {
                *mask = '\0';
        }

So, I got the old stuff and stucj it back in and removed the new stuff.

Result: My recursive directory listings are back again!!

I can prepare a patch if that's of any use....???

Phill.

Comment 2 Andy Crook 2004-10-22 01:25:40 UTC
Created attachment 741 [details]
patch undoing this changes in client.c

I've just searched in cvs - this bug was added in revision 1.260 of
samba/source/client/client.c:
--------------------------------------------------------------------------
Revision 1.260, Wed Mar 3 20:55:39 2004 UTC (7 months, 2 weeks ago) by jra
Branch: MAIN
Changes since 1.259: +43 -3 lines

Use a common function to parse all pathnames from the wire. This allows
much closer emulation of Win2k3 error return codes.
Jeremy.
--------------------------------------------------------------------------

BTW, I made patch reveritng these string to original and now it seems like
smbclient works fine again - my scripts can perform network search again.
Comment 3 Gerald (Jerry) Carter 2005-02-26 08:03:45 UTC
fixed after dfs cleanup.  code checked in post 3.0.12pre1
Comment 4 Gerald (Jerry) Carter 2005-08-24 10:20:32 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.