Commit 96d05d15 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed permission check when renaming a directory (based on a patch by

Andriy Palamarchuk).
parent 85350c8c
...@@ -2627,8 +2627,16 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag ) ...@@ -2627,8 +2627,16 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag )
hFile = FILE_CreateFile( full_name1.long_name, 0, 0, hFile = FILE_CreateFile( full_name1.long_name, 0, 0,
NULL, OPEN_EXISTING, 0, 0, TRUE, NULL, OPEN_EXISTING, 0, 0, TRUE,
GetDriveTypeW( full_name1.short_name ) ); GetDriveTypeW( full_name1.short_name ) );
if (!hFile) return FALSE; if (!hFile)
CloseHandle(hFile); {
DWORD attr;
if (GetLastError() != ERROR_ACCESS_DENIED) return FALSE;
attr = GetFileAttributesA( full_name1.long_name );
if (attr == (DWORD)-1 || !(attr & FILE_ATTRIBUTE_DIRECTORY)) return FALSE;
/* if it's a directory we can continue */
}
else CloseHandle(hFile);
/* check, if we are allowed to delete the destination, /* check, if we are allowed to delete the destination,
** (but the file not being there is fine) */ ** (but the file not being there is fine) */
......
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