From: Jeremy Allison Date: Tue, 19 Sep 2023 16:49:25 +0000 (-0700) Subject: s3: smbd: rename_internals_fsp() has to reopen the parent directory of the target... X-Git-Tag: tevent-0.16.0~544 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e61a956b9346833e863d35d29e36a702ca1e92f2;p=thirdparty%2Fsamba.git s3: smbd: rename_internals_fsp() has to reopen the parent directory of the target as a pathref to check permissions. So it never looks at any passed in dst_dirfsp. Prove this by passing NULL. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index dfcd05d2cae..aea5d627add 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -1938,7 +1938,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, status = rename_internals_fsp(conn, fsp, - dst_dirfsp, + NULL, smb_fname_dst, dst_original_lcomp, attrs, diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 23081a11e43..0f1ef2d4354 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -4751,7 +4751,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn, smb_fname_str_dbg(smb_fname_dst))); status = rename_internals_fsp(conn, fsp, - dst_dirfsp, + NULL, smb_fname_dst, dst_original_lcomp, 0,