]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use reference_smb_fname_fsp_link() in rename_internals_fsp()
authorRalph Boehme <slow@samba.org>
Fri, 8 Apr 2022 09:54:01 +0000 (11:54 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 9 Dec 2022 23:11:37 +0000 (23:11 +0000)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_reply.c

index d50da4274418fd4dae1d781d5252c45a720ed3b0..90aa92193b954cf9d28984a9699ef05f533e41a1 100644 (file)
@@ -1714,6 +1714,18 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                 * destination parent name.
                 */
                parent_dir_fname_src = parent_dir_fname_dst;
+
+               /*
+                * Ensure we have a pathref fsp on the
+                * parent_dir_fname_src_atname to match the code in the else
+                * branch where we use parent_pathref().
+                */
+               status = reference_smb_fname_fsp_link(
+                       parent_dir_fname_src_atname,
+                       fsp->fsp_name);
+               if (!NT_STATUS_IS_OK(status)) {
+                       goto out;
+               }
        } else {
                /*
                 * source and destination parent directories are