r23107: Fix renames on file descriptors that are supposed to overwrite the
authorJeremy Allison <jra@samba.org>
Thu, 24 May 2007 01:57:02 +0000 (01:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:22:46 +0000 (12:22 -0500)
target. Needs merging for 3.0.25a (sorry).
Jeremy.

source/smbd/reply.c

index 98976dd39d2da8b21a534b2fbb1caba5211a75db..40311758c9d4e11b327927954b19517bc502144d 100644 (file)
@@ -4245,9 +4245,10 @@ NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp, pstrin
        ZERO_STRUCT(sbuf);
 
        status = unix_convert(conn, newname, False, newname_last_component, &sbuf);
        ZERO_STRUCT(sbuf);
 
        status = unix_convert(conn, newname, False, newname_last_component, &sbuf);
-       /* We expect this to be NT_STATUS_OBJECT_PATH_NOT_FOUND */
-       if (!NT_STATUS_EQUAL(NT_STATUS_OBJECT_PATH_NOT_FOUND, status)) {
-               return NT_STATUS_OBJECT_NAME_COLLISION;
+
+       /* If an error we expect this to be NT_STATUS_OBJECT_PATH_NOT_FOUND */
+
+       if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(NT_STATUS_OBJECT_PATH_NOT_FOUND, status)) {
                return status;
        }
 
                return status;
        }