From 924e7a702f2b9dae563b10969864a2085418be2b Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 12 Nov 2020 16:28:41 +0100 Subject: [PATCH] smbd: unconst smb_fname arg of all setfileinfo worker functions This allows avoiding making copies of the smb_fname when it needs to be passed to a function that takes a non-const smb_fname. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/proto.h | 2 +- source3/smbd/trans2.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 72c1df1cf26..1924762b8ba 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -1215,7 +1215,7 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx, struct smb_filename *smb_fname_new); NTSTATUS smb_set_file_time(connection_struct *conn, files_struct *fsp, - const struct smb_filename *smb_fname, + struct smb_filename *smb_fname, struct smb_file_time *ft, bool setting_write_time); void reply_findclose(struct smb_request *req); diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 11f98ce349b..ab7f2bdabd9 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -6523,7 +6523,7 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx, NTSTATUS smb_set_file_time(connection_struct *conn, files_struct *fsp, - const struct smb_filename *smb_fname, + struct smb_filename *smb_fname, struct smb_file_time *ft, bool setting_write_time) { @@ -6623,7 +6623,7 @@ NTSTATUS smb_set_file_time(connection_struct *conn, ****************************************************************************/ static NTSTATUS smb_set_file_dosmode(connection_struct *conn, - const struct smb_filename *smb_fname, + struct smb_filename *smb_fname, uint32_t dosmode) { struct smb_filename *smb_fname_base; @@ -6683,7 +6683,7 @@ static NTSTATUS smb_set_file_dosmode(connection_struct *conn, static NTSTATUS smb_set_file_size(connection_struct *conn, struct smb_request *req, files_struct *fsp, - const struct smb_filename *smb_fname, + struct smb_filename *smb_fname, const SMB_STRUCT_STAT *psbuf, off_t size, bool fail_after_createfile) @@ -6789,7 +6789,7 @@ static NTSTATUS smb_info_set_ea(connection_struct *conn, const char *pdata, int total_data, files_struct *fsp, - const struct smb_filename *smb_fname) + struct smb_filename *smb_fname) { struct ea_list *ea_list = NULL; TALLOC_CTX *ctx = NULL; @@ -6978,7 +6978,7 @@ static NTSTATUS smb_set_file_unix_link(connection_struct *conn, struct smb_request *req, const char *pdata, int total_data, - const struct smb_filename *new_smb_fname) + struct smb_filename *new_smb_fname) { char *link_target = NULL; struct smb_filename target_fname; @@ -7836,7 +7836,7 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn, const char *pdata, int total_data, files_struct *fsp, - const struct smb_filename *smb_fname) + struct smb_filename *smb_fname) { /* Patch to do this correctly from Paul Eggert . */ struct smb_file_time ft; @@ -7903,7 +7903,7 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn, const char *pdata, int total_data, files_struct *fsp, - const struct smb_filename *smb_fname) + struct smb_filename *smb_fname) { NTSTATUS status; struct smb_file_time ft; @@ -8063,7 +8063,7 @@ static NTSTATUS smb_set_file_end_of_file_info(connection_struct *conn, const char *pdata, int total_data, files_struct *fsp, - const struct smb_filename *smb_fname, + struct smb_filename *smb_fname, bool fail_after_createfile) { off_t size; @@ -8206,7 +8206,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, const char *pdata, int total_data, files_struct *fsp, - const struct smb_filename *smb_fname) + struct smb_filename *smb_fname) { struct smb_file_time ft; uint32_t raw_unixmode; @@ -8436,7 +8436,7 @@ static NTSTATUS smb_set_file_unix_info2(connection_struct *conn, const char *pdata, int total_data, files_struct *fsp, - const struct smb_filename *smb_fname) + struct smb_filename *smb_fname) { NTSTATUS status; uint32_t smb_fflags; -- 2.47.3