Commit f834d231 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

server: FILE_OVERWRITE and FILE_OVERWRITE_IF need the FILE_WRITE_ATTRIBUTES permission.

parent 0cc619cc
......@@ -1609,20 +1609,6 @@ static void test_NtCreateFile(void)
td[i].attrib_in, FILE_SHARE_READ|FILE_SHARE_WRITE,
td[i].disposition, 0, NULL, 0);
/* FIXME: completely remove once Wine is fixed */
if (td[i].status == STATUS_ACCESS_DENIED)
{
todo_wine
ok(status == td[i].status, "%d: expected %#x got %#x\n", i, td[i].status, status);
CloseHandle(handle);
SetFileAttributesW(path, FILE_ATTRIBUTE_ARCHIVE);
if (td[i].needs_cleanup)
DeleteFileW(path);
continue;
}
ok(status == td[i].status, "%d: expected %#x got %#x\n", i, td[i].status, status);
if (!status)
......
......@@ -179,10 +179,12 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
{
case FILE_CREATE: flags = O_CREAT | O_EXCL; break;
case FILE_OVERWRITE_IF: /* FIXME: the difference is whether we trash existing attr or not */
access |= FILE_WRITE_ATTRIBUTES;
case FILE_SUPERSEDE: flags = O_CREAT | O_TRUNC; break;
case FILE_OPEN: flags = 0; break;
case FILE_OPEN_IF: flags = O_CREAT; break;
case FILE_OVERWRITE: flags = O_TRUNC; break;
case FILE_OVERWRITE: flags = O_TRUNC;
access |= FILE_WRITE_ATTRIBUTES; break;
default: set_error( STATUS_INVALID_PARAMETER ); goto done;
}
......
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