server: FILE_OVERWRITE and FILE_OVERWRITE_IF need the FILE_WRITE_ATTRIBUTES permission.

This commit is contained in:
Dmitry Timoshkov 2011-03-30 18:08:49 +09:00 committed by Alexandre Julliard
parent 0cc619ccc5
commit f834d23197
2 changed files with 3 additions and 15 deletions

View File

@ -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)

View File

@ -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;
}