From: Joel Holdsworth <joel(a)airwebreathe.org.uk> If a file is opened for write access, it is not necessary to open it with O_RDWR if FILE_READ_ATTRIBUTES has been requested in addition. File attributes can be read from any file open descriptor. Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- server/fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/fd.c b/server/fd.c index 839a1dec914..f744e82c3f6 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1944,7 +1944,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam if ((access & (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_ATTRIBUTES|FILE_WRITE_EA)) && !(options & FILE_DIRECTORY_FILE)) { - if (access & (FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA)) rw_mode = O_RDWR; + if (access & (FILE_READ_DATA|FILE_READ_EA)) rw_mode = O_RDWR; else rw_mode = O_WRONLY; } else rw_mode = O_RDONLY; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1895