wineserver: Don't use O_CREAT and O_EXCL when attempting to open directories.
This commit is contained in:
parent
f8b5aa34dc
commit
afce615830
|
@ -783,7 +783,7 @@ static void test_CreateFileW(void)
|
||||||
ok(ret == TRUE, "couldn't create temporary directory\n");
|
ok(ret == TRUE, "couldn't create temporary directory\n");
|
||||||
hFile = CreateFileW(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
|
hFile = CreateFileW(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
|
||||||
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, 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());
|
"expected CreateFile to succeed on existing directory, error: %d\n", GetLastError());
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
ret = RemoveDirectoryW(filename);
|
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 we tried to open a directory for write access, retry read-only */
|
||||||
if (errno != EISDIR ||
|
if (errno != EISDIR ||
|
||||||
!(access & FILE_UNIX_WRITE_ACCESS) ||
|
!(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();
|
file_set_error();
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in New Issue