[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Thu May 20 20:00:02 UTC 2021


The branch, master has been updated
       via  5a976b42f07 s3: smbd: Change set_create_timespec_ea() to take the existing fsp.
      from  24fb40a8121 lib:util: Fix log level for normal startup message

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5a976b42f075b0a1ef4a5cc911659f0ed7884dd4
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 20 09:28:29 2021 -0700

    s3: smbd: Change set_create_timespec_ea() to take the existing fsp.
    
    Removes an unneeded synthetic_pathref() call.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Thu May 20 19:59:44 UTC 2021 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_default.c |  3 +--
 source3/smbd/dosmode.c        | 38 +++++++-------------------------------
 source3/smbd/proto.h          |  3 +--
 3 files changed, 9 insertions(+), 35 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 50b00de2301..e384f8885d1 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2541,8 +2541,7 @@ static int vfswrap_fntimes(vfs_handle_struct *handle,
 		}
 
 		if (!is_omit_timespec(&ft->create_time)) {
-			set_create_timespec_ea(handle->conn,
-					       fsp->fsp_name,
+			set_create_timespec_ea(fsp,
 					       ft->create_time);
 		}
 
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index d5bb9e1fd41..a858edee558 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -1302,51 +1302,27 @@ bool set_sticky_write_time_fsp(struct files_struct *fsp, struct timespec mtime)
  Set a create time EA.
 ******************************************************************/
 
-NTSTATUS set_create_timespec_ea(connection_struct *conn,
-				const struct smb_filename *psmb_fname,
+NTSTATUS set_create_timespec_ea(struct files_struct *fsp,
 				struct timespec create_time)
 {
-	struct smb_filename *smb_fname;
 	uint32_t dosmode;
 	int ret;
-	NTSTATUS status;
 
-	if (!lp_store_dos_attributes(SNUM(conn))) {
+	if (!lp_store_dos_attributes(SNUM(fsp->conn))) {
 		return NT_STATUS_OK;
 	}
 
-	status = synthetic_pathref(talloc_tos(),
-					conn->cwd_fsp,
-					psmb_fname->base_name,
-					NULL,
-					NULL,
-					psmb_fname->twrp,
-					psmb_fname->flags,
-					&smb_fname);
-
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
-
-	dosmode = fdos_mode(psmb_fname->fsp);
+	dosmode = fdos_mode(fsp);
 
-	smb_fname->st.st_ex_btime = create_time;
-	/*
-	 * ensure if we pass fsp around we can get the create time
-	 * from fsp->fsp_name
-	 */
-	smb_fname->fsp->fsp_name->st.st_ex_btime = create_time;
-
-	ret = file_set_dosmode(conn, smb_fname, dosmode, NULL, false);
+	fsp->fsp_name->st.st_ex_btime = create_time;
+	ret = file_set_dosmode(fsp->conn, fsp->fsp_name, dosmode, NULL, false);
 	if (ret == -1) {
-		TALLOC_FREE(smb_fname);
 		return map_nt_error_from_unix(errno);
 	}
 
-	DEBUG(10,("set_create_timespec_ea: wrote create time EA for file %s\n",
-		smb_fname_str_dbg(smb_fname)));
+	DBG_DEBUG("wrote create time EA for file %s\n",
+		smb_fname_str_dbg(fsp->fsp_name));
 
-	TALLOC_FREE(smb_fname);
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 1eb74628218..b9131ba5bd9 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -297,8 +297,7 @@ NTSTATUS set_ea_dos_attribute(connection_struct *conn,
 			      const struct smb_filename *smb_fname,
 			      uint32_t dosmode);
 
-NTSTATUS set_create_timespec_ea(connection_struct *conn,
-				const struct smb_filename *smb_fname,
+NTSTATUS set_create_timespec_ea(struct files_struct *fsp,
 				struct timespec create_time);
 
 struct timespec get_create_timespec(connection_struct *conn,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list