From 2ae4d56ba0f63825e3f424e1c00ffdca556aca60 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 6 Dec 2024 17:20:30 +0100 Subject: [PATCH] set the proper file type for directory junction entries Close #7157 Signed-off-by: Matthieu Gallien --- src/csync/vio/csync_vio_local_win.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/csync/vio/csync_vio_local_win.cpp b/src/csync/vio/csync_vio_local_win.cpp index 76aa4a45a3a18..da677c692433d 100644 --- a/src/csync/vio/csync_vio_local_win.cpp +++ b/src/csync/vio/csync_vio_local_win.cpp @@ -161,7 +161,13 @@ std::unique_ptr csync_vio_local_readdir(csync_vio_handle_t *h !isDirectory) { file_stat->type = ItemTypeSkip; } else if (isDirectory) { - file_stat->type = ItemTypeDirectory; + if (handle->ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && + (handle->ffd.dwReserved0 == IO_REPARSE_TAG_SYMLINK || + handle->ffd.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT)) { + file_stat->type = ItemTypeSoftLink; + } else { + file_stat->type = ItemTypeDirectory; + } } else { file_stat->type = ItemTypeFile; }