From: Ralph Boehme Date: Tue, 17 Nov 2020 11:11:13 +0000 (+0100) Subject: smbd: check for non FSA fsps in smb_file_rename_information() X-Git-Tag: samba-4.14.0rc1~310 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d8237a87011ff0ab680fc4c609d7455cf843a0f;p=thirdparty%2Fsamba.git smbd: check for non FSA fsps in smb_file_rename_information() If the fsp is a non FSA fsp created by openat_pathref_fsp(), we can't pass it to rename_internals_fsp(). We have to go via rename_internals() which internally uses SMB_VFS_CREATE_FILE() to open an fsp which ensure we go through the lease checking code. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 03398ab140c..497ae94b392 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7456,7 +7456,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn, } } - if (fsp) { + if (fsp != NULL && fsp->fsp_flags.is_fsa) { DEBUG(10,("smb_file_rename_information: " "SMB_FILE_RENAME_INFORMATION (%s) %s -> %s\n", fsp_fnum_dbg(fsp), fsp_str_dbg(fsp),