]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: check for non FSA fsps in smb_file_rename_information()
authorRalph Boehme <slow@samba.org>
Tue, 17 Nov 2020 11:11:13 +0000 (12:11 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index 03398ab140c093b1a00e904c99081190048d790a..497ae94b3924d3237f93be6f5f6c4c86eb1f46cf 100644 (file)
@@ -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),