ntdll-Junction_Points: Do not use O_SYMLINK if it is not defined.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50255
This commit is contained in:
Zebediah Figura 2020-12-05 22:16:39 -06:00
parent 2dc013940d
commit fce121fcd9

View File

@ -1,12 +1,12 @@
From d5db8e054c0dc8987c0f469cccfa0652a56cf220 Mon Sep 17 00:00:00 2001
From 8106c6932c691439b014e35d1bba16bdbeef7670 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sun, 22 Nov 2020 22:39:48 -0700
Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option.
---
dlls/ntdll/tests/file.c | 4 ++--
server/fd.c | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
server/fd.c | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 053441923b3..6a99fa94ebc 100644
@ -24,15 +24,17 @@ index 053441923b3..6a99fa94ebc 100644
/* Check the size/data of the symlink target */
diff --git a/server/fd.c b/server/fd.c
index c3c53489212..6f1e796c0bc 100644
index c3c53489212..673055718f8 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1957,6 +1957,9 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -1957,6 +1957,11 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
}
else rw_mode = O_RDONLY;
+#if defined(O_SYMLINK)
+ if ((options & FILE_OPEN_REPARSE_POINT) && !(flags & O_CREAT))
+ flags |= O_SYMLINK;
+#endif
+
if ((fd->unix_fd = open( name, rw_mode | (flags & ~O_TRUNC), *mode )) == -1)
{