From: Jeremy Allison Date: Mon, 21 Mar 2005 18:10:21 +0000 (+0000) Subject: r5922: Fix for NASTY NASTY bug #2501. All my fault :-(. Brown paper bag time. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5088 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e32a58742e618a49934e19b72cd5222c9666cf95;p=thirdparty%2Fsamba.git r5922: Fix for NASTY NASTY bug #2501. All my fault :-(. Brown paper bag time. Stops Win98 from looping doing findnext on a singleton directory. More testing very welcome. Jeremy. --- diff --git a/source/smbd/dir.c b/source/smbd/dir.c index db16b8a6e00..1ec35d839c2 100644 --- a/source/smbd/dir.c +++ b/source/smbd/dir.c @@ -595,6 +595,13 @@ const char *dptr_ReadDirName(struct dptr_struct *dptr, long *poffset, SMB_STRUCT BOOL dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst) { ZERO_STRUCTP(pst); + + if (!dptr->has_wild && (dptr->dir_hnd->offset == -1)) { + /* This is a singleton directory and we're already at the end. */ + *poffset = -1; + return False; + } + while (SearchDir(dptr->dir_hnd, name, poffset) == True) { if (is_visible_file(dptr->conn, dptr->path, name, pst, True)) { return True;