NTFileSystemHelper: Rename will now return STATUS_OBJECT_NAME_COLLISION if the destination exists

This commit is contained in:
Tal Aloni 2017-02-11 01:25:59 +02:00
parent 7e6ad281b1
commit 353460a976

View file

@ -384,7 +384,8 @@ namespace SMBLibrary.Server
}
else if (errorCode == (ushort)Win32Error.ERROR_ALREADY_EXISTS)
{
return NTStatus.STATUS_OBJECT_NAME_EXISTS;
// According to [MS-FSCC], FileRenameInformation MUST return STATUS_OBJECT_NAME_COLLISION when the specified name already exists and ReplaceIfExists is zero.
return NTStatus.STATUS_OBJECT_NAME_COLLISION;
}
else
{