Commit afce6158 authored by Jeff Zaroyko's avatar Jeff Zaroyko Committed by Alexandre Julliard

wineserver: Don't use O_CREAT and O_EXCL when attempting to open directories.

parent f8b5aa34
......@@ -783,7 +783,7 @@ static void test_CreateFileW(void)
ok(ret == TRUE, "couldn't create temporary directory\n");
hFile = CreateFileW(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);
todo_wine ok(hFile != INVALID_HANDLE_VALUE,
ok(hFile != INVALID_HANDLE_VALUE,
"expected CreateFile to succeed on existing directory, error: %d\n", GetLastError());
CloseHandle(hFile);
ret = RemoveDirectoryW(filename);
......
......@@ -1582,7 +1582,7 @@ struct fd *open_fd( const char *name, int flags, mode_t *mode, unsigned int acce
/* if we tried to open a directory for write access, retry read-only */
if (errno != EISDIR ||
!(access & FILE_UNIX_WRITE_ACCESS) ||
(fd->unix_fd = open( name, O_RDONLY | (flags & ~O_TRUNC), *mode )) == -1)
(fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode )) == -1)
{
file_set_error();
goto error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment