diff -u samba-3.0.6rc2.orig/source/smbd/trans2.c samba-3.0.6rc2/source/smbd/trans2.c --- samba-3.0.6rc2.orig/source/smbd/trans2.c Fri Aug 6 23:38:18 2004 +++ samba-3.0.6rc2/source/smbd/trans2.c Wed Aug 18 13:12:12 2004 @@ -1569,6 +1569,7 @@ BOOL out_of_space = False; int space_remaining; NTSTATUS ntstatus = NT_STATUS_OK; + BOOL name_has_wildcard = False; if (total_params < 12) return(ERROR_DOS(ERRDOS,ERRinvalidparam)); @@ -1732,6 +1733,9 @@ } /* end if current_pos */ } /* end if requires_resume_key && !continue_bit */ + if(strchr(mask,'?') || strchr(mask,'*')) + name_has_wildcard = True; + for (i=0;(i<(int)maxentries) && !finished && !out_of_space ;i++) { BOOL got_exact_match = False; @@ -1757,12 +1761,12 @@ /* * As an optimisation if we know we aren't looking - * for a wildcard name (ie. the name matches the wildcard exactly) + * for a wildcard name (ie. the mask does not contain wildcards) * then we can finish on any (first) match. * This speeds up large directory searches. JRA. */ - if(got_exact_match) + if(got_exact_match && !name_has_wildcard) finished = True; space_remaining = max_data_bytes - PTR_DIFF(p,pdata); Only in samba-3.0.6rc2/source/smbd/: trans2.c~