Commit 977ec4d9 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Prevent SetFileAttributeA from making directory read-only.

parent 5b317bc5
...@@ -77,6 +77,10 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes) ...@@ -77,6 +77,10 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
} }
if (attributes & FILE_ATTRIBUTE_READONLY) if (attributes & FILE_ATTRIBUTE_READONLY)
{ {
if(S_ISDIR(buf.st_mode))
/* FIXME */
WARN("FILE_ATTRIBUTE_READONLY ignored for directory.\n");
else
buf.st_mode &= ~0222; /* octal!, clear write permission bits */ buf.st_mode &= ~0222; /* octal!, clear write permission bits */
attributes &= ~FILE_ATTRIBUTE_READONLY; attributes &= ~FILE_ATTRIBUTE_READONLY;
} }
......
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