Correctly handle junctions

A junction has S_IFDIR | S_IFLNK set, however, only one makes sense.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
Sven Strickroth 2013-06-25 16:46:06 +02:00
parent 022a45e084
commit 4753711235

View File

@ -90,6 +90,9 @@ static int do_lstat(
if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
fMode |= S_IFLNK; fMode |= S_IFLNK;
if ((fMode & (S_IFDIR | S_IFLNK)) == (S_IFDIR | S_IFLNK)) // junction
fMode ^= S_IFLNK;
buf->st_ino = 0; buf->st_ino = 0;
buf->st_gid = 0; buf->st_gid = 0;
buf->st_uid = 0; buf->st_uid = 0;