Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4753711

Browse files
committed
Correctly handle junctions
A junction has S_IFDIR | S_IFLNK set, however, only one makes sense. Signed-off-by: Sven Strickroth <[email protected]>
1 parent 022a45e commit 4753711

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/win32/posix_w32.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ static int do_lstat(
9090
if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
9191
fMode |= S_IFLNK;
9292

93+
if ((fMode & (S_IFDIR | S_IFLNK)) == (S_IFDIR | S_IFLNK)) // junction
94+
fMode ^= S_IFLNK;
95+
9396
buf->st_ino = 0;
9497
buf->st_gid = 0;
9598
buf->st_uid = 0;

0 commit comments

Comments
 (0)