From: Ralph Boehme Date: Fri, 8 Apr 2022 09:54:01 +0000 (+0200) Subject: smbd: use reference_smb_fname_fsp_link() in rename_internals_fsp() X-Git-Tag: talloc-2.4.0~384 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f20625f982cbb7f0ed05f4602dcedfa41278917;p=thirdparty%2Fsamba.git smbd: use reference_smb_fname_fsp_link() in rename_internals_fsp() Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index d50da427441..90aa92193b9 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -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