From: Volker Lendecke Date: Mon, 13 Jan 2025 12:32:29 +0000 (+0100) Subject: smbd: Slightly simplify rename_internals_fsp() X-Git-Tag: tdb-1.4.13~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e126905990e0a37b9374ecb963de76724a633e7;p=thirdparty%2Fsamba.git smbd: Slightly simplify rename_internals_fsp() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index 349c312ff17..34012ebae54 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -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) {