Attaching a patch which is the result of the two upstream svn commits, applied cleanly to Debian's clilist.c, and reran diff. Justin
--- clilist.c 2005-03-13 09:29:52.541928856 -0500 +++ old/clilist.c 2005-03-13 09:30:02.151467984 -0500 @@ -185,7 +185,7 @@ setup = TRANSACT2_FINDFIRST; SSVAL(param,0,attribute); /* attribute */ SSVAL(param,2,max_matches); /* max count */ - SSVAL(param,4,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */ + SSVAL(param,4,4+2); /* resume required + close on end */ SSVAL(param,6,info_level); SIVAL(param,8,0); p = param+12; @@ -197,9 +197,7 @@ SSVAL(param,2,max_matches); /* max count */ SSVAL(param,4,info_level); SIVAL(param,6,0); /* ff_resume_key */ - /* NB. *DON'T* use continue here. If you do it seems that W2K and bretheren - can miss filenames. Use last filename continue instead. JRA */ - SSVAL(param,4,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */ + SSVAL(param,10,8+4+2); /* continue + resume required + close on end */ p = param+12; p += clistr_push(cli, param+12, mask, sizeof(param)-12, STR_TERMINATE); @@ -264,6 +262,24 @@ p = rdata; /* we might need the lastname for continuations */ + if (ff_lastname > 0) { + switch(info_level) { + case 260: + clistr_pull(cli, mask, p+ff_lastname, + sizeof(mask), + data_len-ff_lastname, + STR_TERMINATE); + break; + case 1: + clistr_pull(cli, mask, p+ff_lastname+1, + sizeof(mask), + -1, + STR_TERMINATE); + break; + } + } else { + pstrcpy(mask,""); + } /* and add them to the dirlist pool */ tdl = SMB_REALLOC(dirlist,dirlist_len + data_len); @@ -277,18 +293,10 @@ /* put in a length for the last entry, to ensure we can chain entries into the next packet */ - for (p2=p,i=0;i<(ff_searchcount-1);i++) { - p2 += interpret_long_filename(cli,info_level,p2,&finfo); - } + for (p2=p,i=0;i<(ff_searchcount-1);i++) + p2 += interpret_long_filename(cli,info_level,p2,NULL); SSVAL(p2,0,data_len - PTR_DIFF(p2,p)); - /* we might need the lastname for continuations */ - if (ff_lastname > 0) { - pstrcpy(mask, finfo.name); - } else { - pstrcpy(mask,""); - } - /* grab the data for later use */ memcpy(dirlist+dirlist_len,p,data_len); dirlist_len += data_len;