set the proper file type for directory junction entries
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 6 Dec 2024 16:20:30 +0000 (17:20 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 9 Dec 2024 15:43:53 +0000 (16:43 +0100)
Close #7157

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/csync/vio/csync_vio_local_win.cpp

index 76aa4a45a3a182d5399f77526b7f2c3d0e51bee1..da677c692433d7b7b66045d40e4ac95e24e33ce7 100644 (file)
@@ -161,7 +161,13 @@ std::unique_ptr<csync_file_stat_t> 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;
     }