Skip to content

Commit

Permalink
set the proper file type for directory junction entries
Browse files Browse the repository at this point in the history
Close #7157

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Dec 9, 2024
1 parent d8f1df9 commit 2ae4d56
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/csync/vio/csync_vio_local_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&

Check warning on line 164 in src/csync/vio/csync_vio_local_win.cpp

View workflow job for this annotation

GitHub Actions / build

src/csync/vio/csync_vio_local_win.cpp:164:9 [bugprone-branch-clone]

if with identical then and else branches
(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;
}
Expand Down

0 comments on commit 2ae4d56

Please sign in to comment.