smbd: return correct error when trying to create a hardlink to a VSS file
authorRalph Boehme <slow@samba.org>
Fri, 22 Dec 2023 10:19:38 +0000 (11:19 +0100)
committerRalph Boehme <slow@samba.org>
Mon, 8 Jan 2024 15:53:36 +0000 (15:53 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13688

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_trans2.c

index 4bfe9f8044e2314e610a8c8257f455e674256950..b0383b3cc19cc65ca4cf05b6a1c60e3d4fb90abf 100644 (file)
@@ -3755,6 +3755,11 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
                goto out;
        }
 
+       if (smb_fname_old->twrp != 0) {
+               status = NT_STATUS_NOT_SAME_DEVICE;
+               goto out;
+       }
+
        status = parent_pathref(talloc_tos(),
                                conn->cwd_fsp,
                                smb_fname_old,