1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: smbd: Remove use of synthetic_pathref() in rename_internals_fsp().

As we're renaming an open file we don't need to do another
open, we already have an fsp here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
This commit is contained in:
Jeremy Allison 2021-05-21 10:27:09 -07:00 committed by Noel Power
parent f96cc29711
commit 6917e32466

View File

@ -7829,33 +7829,25 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
(lp_map_archive(SNUM(conn)) || (lp_map_archive(SNUM(conn)) ||
lp_store_dos_attributes(SNUM(conn)))) lp_store_dos_attributes(SNUM(conn))))
{ {
struct smb_filename *pathref = NULL; /*
status = synthetic_pathref(ctx, * We must set the archive bit on the newly renamed
conn->cwd_fsp, * file.
smb_fname_dst->base_name, */
smb_fname_dst->stream_name, ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
NULL, if (ret == 0) {
smb_fname_dst->twrp, uint32_t old_dosmode;
smb_fname_dst->flags, old_dosmode = fdos_mode(fsp);
&pathref);
if (NT_STATUS_IS_OK(status)) {
/* /*
* We must set the archive bit on the newly renamed * We can use fsp->fsp_name here as it has
* file. * already been changed to the new name.
*/ */
ret = SMB_VFS_FSTAT(fsp, &pathref->st); SMB_ASSERT(fsp->fsp_name->fsp == fsp);
if (ret == 0) { file_set_dosmode(conn,
uint32_t old_dosmode; fsp->fsp_name,
fsp->fsp_name->st = pathref->st; old_dosmode | FILE_ATTRIBUTE_ARCHIVE,
old_dosmode = fdos_mode(fsp); NULL,
file_set_dosmode(conn, true);
pathref,
old_dosmode | FILE_ATTRIBUTE_ARCHIVE,
NULL,
true);
}
} }
TALLOC_FREE(pathref);
} }
/* /*