Commit 4d8618eb authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Vitaly Lipatov

server: FILE_WRITE_ATTRIBUTES should succeed for readonly files.

parent efec1010
......@@ -4303,7 +4303,7 @@ static void test_readonly(void)
status = pNtOpenFile(&handle, FILE_WRITE_ATTRIBUTES, &attr, &io,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT);
todo_wine ok(status == STATUS_SUCCESS, "got %#x\n", status);
ok(status == STATUS_SUCCESS, "got %#x\n", status);
CloseHandle(handle);
status = pNtOpenFile(&handle, DELETE, &attr, &io,
......
......@@ -2125,7 +2125,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
else if (errno == EACCES)
{
/* try to change permissions temporarily to open a file descriptor */
if (!(access & (FILE_UNIX_WRITE_ACCESS | FILE_UNIX_READ_ACCESS | DELETE)) &&
if (!(access & ((FILE_UNIX_WRITE_ACCESS | FILE_UNIX_READ_ACCESS | DELETE) & ~FILE_WRITE_ATTRIBUTES)) &&
!stat( name, &st ) && st.st_uid == getuid() &&
!chmod( name, st.st_mode | S_IRUSR ))
{
......
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