From c306a52d19871f5bea28d506a396bc9cce3916ab Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Fri, 21 Jan 2022 17:26:09 +0000 Subject: [PATCH] tst: ntptfs: fix Rename on versions of the OS without POSIX rename --- tst/ntptfs/ptfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tst/ntptfs/ptfs.c b/tst/ntptfs/ptfs.c index dc1ca7ac..fc942920 100644 --- a/tst/ntptfs/ptfs.c +++ b/tst/ntptfs/ptfs.c @@ -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;