]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: add smb_fname_fsp_unlink()
authorRalph Boehme <slow@samba.org>
Mon, 23 Nov 2020 04:59:02 +0000 (05:59 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:30 +0000 (09:08 +0000)
Remove the link between an smb_fname and it's embedded smb_fname->fsp.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/files.c
source3/smbd/proto.h

index 7315d7fb75a93b7972b6855e8a2e622eca6e219a..e69a910e1f8e1ae68316b6eac8189c4996910083 100644 (file)
@@ -553,6 +553,13 @@ fail:
        return status;
 }
 
+void smb_fname_fsp_unlink(struct smb_filename *smb_fname)
+{
+       talloc_set_destructor(smb_fname, NULL);
+       smb_fname->fsp = NULL;
+       destroy_fsp_smb_fname_link(&smb_fname->fsp_link);
+}
+
 /****************************************************************************
  Close all open files for a connection.
 ****************************************************************************/
index b37c6e36bde69a89a878f8ebed2a8534b04e19e8..c79f4814f1e45b22d52ab96f5c42704a182099eb 100644 (file)
@@ -458,6 +458,8 @@ NTSTATUS open_internal_dirfsp(connection_struct *conn,
 NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
                            struct smb_filename *smb_fname);
 
+void smb_fname_fsp_unlink(struct smb_filename *smb_fname);
+
 /* The following definitions come from smbd/ipc.c  */
 
 NTSTATUS nt_status_np_pipe(NTSTATUS status);