tst: ntptfs: fix Rename on versions of the OS without POSIX rename

This commit is contained in:
Bill Zissimopoulos 2022-01-21 17:26:09 +00:00
parent 627ad8be8c
commit c306a52d19
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -654,13 +654,15 @@ static NTSTATUS Rename(FSP_FILE_SYSTEM *FileSystem,
65/*FileRenameInformationEx*/);
if (!NT_SUCCESS(Result))
{
if (STATUS_OBJECT_NAME_COLLISION == Result && ReplaceIfExists && !PosixReplaceIfExists)
switch (Result)
{
Result = STATUS_ACCESS_DENIED;
case STATUS_OBJECT_NAME_COLLISION:
if (ReplaceIfExists && !PosixReplaceIfExists)
Result = STATUS_ACCESS_DENIED;
goto exit;
case STATUS_ACCESS_DENIED:
goto exit;
}
if (STATUS_INVALID_PARAMETER != Result)
goto exit;
FileRenInfo.V.Flags = 0;
FileRenInfo.V.ReplaceIfExists = ReplaceIfExists;