Re: ntdll: Fix Directory Searching when VFAT_IOCTL_READDIR_BOTH returns an invalid d_reclen
Robert Shearman <rob(a)codeweavers.com> writes:
--- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -1245,7 +1245,11 @@ static NTSTATUS find_file_in_dir( char * unix_name[pos - 1] = '/'; for (;;) { - if (!de[0].d_reclen) break; + if (!de[0].d_reclen) + { + unix_name[pos - 1] = 0; + break;
We should probably have a 'goto not_found' here instead. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard wrote:
Robert Shearman <rob(a)codeweavers.com> writes:
--- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -1245,7 +1245,11 @@ static NTSTATUS find_file_in_dir( char * unix_name[pos - 1] = '/'; for (;;) { - if (!de[0].d_reclen) break; + if (!de[0].d_reclen) + { + unix_name[pos - 1] = 0; + break;
We should probably have a 'goto not_found' here instead.
No, the file it is searching for exists, but doesn't seem to be returned by the ioctl for some reason. It is likely a x86-64 kernel bug, but we should still fix in our code IMHO. -- Rob Shearman
Robert Shearman <rob(a)codeweavers.com> writes:
No, the file it is searching for exists, but doesn't seem to be returned by the ioctl for some reason. It is likely a x86-64 kernel bug, but we should still fix in our code IMHO.
Yes, but falling through to readdir when we reach the end of the directory is not correct behavior, it will cause every directory to be searched twice. This needs more investigation. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Robert Shearman