Zebediah Figura : ntdll: Consider mount points to be reparse points in get_file_info().
Alexandre Julliard
julliard at winehq.org
Mon Mar 23 15:47:10 CDT 2020
Module: wine
Branch: master
Commit: 6b498d98a86b5179a025afbaaeaa3d60a8bd74ec
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6b498d98a86b5179a025afbaaeaa3d60a8bd74ec
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Fri Mar 20 12:15:25 2020 -0500
ntdll: Consider mount points to be reparse points in get_file_info().
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/file.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 5b60c887e2..c2ec4a7dee 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -151,6 +151,7 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
/* get the stat info and file attributes for a file (by name) */
int get_file_info( const char *path, struct stat *st, ULONG *attr )
{
+ char *parent_path;
int ret;
*attr = 0;
@@ -163,6 +164,19 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
/* is a symbolic link and a directory, consider these "reparse points" */
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
}
+ else if (S_ISDIR( st->st_mode ) && (parent_path = RtlAllocateHeap( GetProcessHeap(), 0, strlen(path) + 4 )))
+ {
+ struct stat parent_st;
+
+ /* consider mount points to be reparse points (IO_REPARSE_TAG_MOUNT_POINT) */
+ strcpy( parent_path, path );
+ strcat( parent_path, "/.." );
+ if (!stat( parent_path, &parent_st )
+ && (st->st_dev != parent_st.st_dev || st->st_ino == parent_st.st_ino))
+ *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
+
+ RtlFreeHeap( GetProcessHeap(), 0, parent_path );
+ }
*attr |= get_file_attributes( st );
return ret;
}
More information about the wine-cvs
mailing list