Commit 8691c8ec authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

SetFileAttributes returns now an error if target file is on CDROM.

parent 34f5563d
...@@ -91,10 +91,23 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes) ...@@ -91,10 +91,23 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
lpFileName,attributes); lpFileName,attributes);
if (-1==chmod(full_name.long_name,buf.st_mode)) if (-1==chmod(full_name.long_name,buf.st_mode))
{ {
FILE_SetDosError(); if(GetDriveTypeA(lpFileName) == DRIVE_CDROM) {
MESSAGE("Wine ERROR: Couldn't set file attributes for existing file \"%s\".\n" SetLastError( ERROR_ACCESS_DENIED );
"Check permissions or set VFAT \"quiet\" mount flag\n", full_name.long_name); return FALSE;
return TRUE; }
/*
* FIXME: We don't return FALSE here because of differences between
* Linux and Windows privileges. Under Linux only the owner of
* the file is allowed to change file attributes. Under Windows,
* applications expect that if you can write to a file, you can also
* change its attributes (see GENERIC_WRITE). We could try to be
* clever here but that would break multi-user installations where
* users share read-only DLLs. This is because some installers like
* to change attributes of already installed DLLs.
*/
FIXME("Couldn't set file attributes for existing file \"%s\".\n"
"Check permissions or set VFAT \"quiet\" mount flag\n", full_name.long_name);
} }
return TRUE; return TRUE;
} }
......
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