]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Slightly simplify rename_internals_fsp()
authorVolker Lendecke <vl@samba.org>
Mon, 13 Jan 2025 12:32:29 +0000 (13:32 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Jan 2025 23:08:38 +0000 (23:08 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_reply.c

index 349c312ff17d45b21ea426add825253aaf11d094..34012ebae54df34734554b9391b88f3070762ebc 100644 (file)
@@ -1557,16 +1557,11 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
        new_is_stream = is_ntfs_stream_smb_fname(smb_fname_dst);
 
        /* Return the correct error code if both names aren't streams. */
-       if (!old_is_stream && new_is_stream) {
+       if (old_is_stream != new_is_stream) {
                status = NT_STATUS_OBJECT_NAME_INVALID;
                goto out;
        }
 
-       if (old_is_stream && !new_is_stream) {
-               status = NT_STATUS_INVALID_PARAMETER;
-               goto out;
-       }
-
        dst_exists = vfs_stat(conn, smb_fname_dst) == 0;
 
        if(!replace_if_exists && dst_exists) {