]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: let openat_pathref_fsp() make use of fsp_attach_smb_fname()
authorStefan Metzmacher <metze@samba.org>
Wed, 16 Dec 2020 14:02:11 +0000 (15:02 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jan 2021 11:30:38 +0000 (11:30 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/files.c

index 092cfcc011036ba28ce45ce9bcca6f24ed978c45..84717d91767f759a2ea2d0ed80bd816845379c05 100644 (file)
@@ -26,6 +26,9 @@
 
 #define FILE_HANDLE_OFFSET 0x1000
 
+static NTSTATUS fsp_attach_smb_fname(struct files_struct *fsp,
+                                    struct smb_filename **_smb_fname);
+
 /**
  * create new fsp to be used for file_new or a durable handle reconnect
  */
@@ -457,11 +460,7 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
                full_fname->stream_name = NULL;
        }
 
-       fsp->fsp_name = full_fname;
-
-       status = file_name_hash(fsp->conn,
-                               smb_fname_str_dbg(fsp->fsp_name),
-                               &fsp->name_hash);
+       status = fsp_attach_smb_fname(fsp, &full_fname);
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
@@ -536,13 +535,6 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
                goto fail;
        }
 
-       status = fsp_smb_fname_link(fsp,
-                                   &fsp->fsp_name->fsp_link,
-                                   &fsp->fsp_name->fsp);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto fail;
-       }
-
        DBG_DEBUG("fsp [%s]: OK\n", fsp_str_dbg(fsp));
 
        talloc_set_destructor(smb_fname, smb_fname_fsp_destructor);