cygwin: readdir: Activate check for remote reparse points

Fix and move comment accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-06-20 10:06:17 +02:00
parent 7a4e299a18
commit 185cd97d24
1 changed files with 5 additions and 4 deletions

View File

@ -189,6 +189,10 @@ readdir_check_reparse_point (POBJECT_ATTRIBUTES attr, bool remote)
&io, FSCTL_GET_REPARSE_POINT, NULL, 0, &io, FSCTL_GET_REPARSE_POINT, NULL, 0,
(LPVOID) rp, MAXIMUM_REPARSE_DATA_BUFFER_SIZE))) (LPVOID) rp, MAXIMUM_REPARSE_DATA_BUFFER_SIZE)))
{ {
/* If reparse point is stored on a remote volume, lstat returns
them as normal files or dirs, not as symlink. For a description,
see the comment preceeding remote check in
symlink_info::check_reparse_point. */
if (!remote && rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) if (!remote && rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
{ {
RtlInitCountedUnicodeString (&subst, RtlInitCountedUnicodeString (&subst,
@ -2028,10 +2032,7 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err,
InitializeObjectAttributes (&oattr, fname, pc.objcaseinsensitive (), InitializeObjectAttributes (&oattr, fname, pc.objcaseinsensitive (),
get_handle (), NULL); get_handle (), NULL);
/* FUTURE: Ideally would know at this point if reparse point if (readdir_check_reparse_point (&oattr, isremote ()))
is stored on a remote volume. Without this, may return DT_LNK
for remote names that end up lstat-ing as a normal directory. */
if (readdir_check_reparse_point (&oattr, false/*remote*/))
de->d_type = DT_LNK; de->d_type = DT_LNK;
} }