The branch, master has been updated via b649007a532 smbd: remove now unneccessary wrapper vfs_fget_dos_attributes() via 7dca8a96867 smbd: Alternative fix for smb2.stream.attributes2 test from 95443320847 smbd: fix has_other_nonposix_opens_fn()
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit b649007a532812ffb14a8fd7cbf204acb388e6d0 Author: Ralph Boehme <s...@samba.org> Date: Fri Nov 10 10:01:46 2023 +0100 smbd: remove now unneccessary wrapper vfs_fget_dos_attributes() Signed-off-by: Ralph Boehme <s...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Tue Nov 14 00:10:19 UTC 2023 on atb-devel-224 commit 7dca8a96867f67441eebdf4824b406177ebb8806 Author: Volker Lendecke <v...@samba.org> Date: Fri Nov 10 08:39:15 2023 +0100 smbd: Alternative fix for smb2.stream.attributes2 test It confused me that a function that supposedly just retrieves dos attributes also updates something. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/include/proto.h | 3 --- source3/smbd/dosmode.c | 8 +++++++- source3/smbd/open.c | 5 ++++- source3/smbd/vfs.c | 39 --------------------------------------- 4 files changed, 11 insertions(+), 44 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index bbb089a5908..06ad7fb508a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -82,9 +82,6 @@ NTSTATUS vfs_at_fspcwd(TALLOC_CTX *mem_ctx, struct connection_struct *conn, struct files_struct **_fsp); -NTSTATUS vfs_fget_dos_attributes(struct files_struct *fsp, - uint32_t *dosmode); - #include "source3/lib/interface.h" /* The following definitions come from lib/ldap_debug_handler.c */ diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index c0fc468cdfb..229a85a9171 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -715,7 +715,9 @@ uint32_t fdos_mode(struct files_struct *fsp) } /* Get the DOS attributes via the VFS if we can */ - status = vfs_fget_dos_attributes(fsp, &result); + status = SMB_VFS_FGET_DOS_ATTRIBUTES(fsp->conn, + metadata_fsp(fsp), + &result); if (!NT_STATUS_IS_OK(status)) { /* * Only fall back to using UNIX modes if we get NOT_IMPLEMENTED. @@ -1292,6 +1294,10 @@ struct timespec get_create_timespec(connection_struct *conn, struct files_struct *fsp, const struct smb_filename *smb_fname) { + if (fsp != NULL) { + struct files_struct *meta_fsp = metadata_fsp(fsp); + return meta_fsp->fsp_name->st.st_ex_btime; + } return smb_fname->st.st_ex_btime; } diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 87a252a3d1b..cb1e2adbf1e 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3906,7 +3906,10 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, */ uint32_t attr = 0; - status = vfs_fget_dos_attributes(smb_fname->fsp, &attr); + status = SMB_VFS_FGET_DOS_ATTRIBUTES( + conn, + metadata_fsp(smb_fname->fsp), + &attr); if (NT_STATUS_IS_OK(status)) { existing_dos_attributes = attr; } diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index a34b9083352..3a1d18d6676 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1297,45 +1297,6 @@ NTSTATUS vfs_at_fspcwd(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } -NTSTATUS vfs_fget_dos_attributes(struct files_struct *fsp, - uint32_t *dosmode) -{ - NTSTATUS status; - - /* - * First make sure to pass the base_fsp to the VFS - */ - status = SMB_VFS_FGET_DOS_ATTRIBUTES( - fsp->conn, metadata_fsp(fsp), dosmode); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - /* - * If this isn't a stream fsp we're done, ... - */ - if (!fsp_is_alternate_stream(fsp)) { - return NT_STATUS_OK; - } - - /* - * ...otherwise the VFS might have updated the btime, propagate the - * btime from the base_fsp to the stream fsp. - */ - - if (fsp->base_fsp->fsp_name->st.st_ex_iflags & ST_EX_IFLAG_CALCULATED_BTIME) { - /* - * Not a value from backend storage, ignore it - */ - return NT_STATUS_OK; - } - - update_stat_ex_create_time(&fsp->fsp_name->st, - fsp->base_fsp->fsp_name->st.st_ex_btime); - - return NT_STATUS_OK; -} - static struct smb_vfs_deny_state *smb_vfs_deny_global; void smb_vfs_assert_allowed(void) -- Samba Shared Repository