]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: unconst smb_fname arg of all setfileinfo worker functions
authorRalph Boehme <slow@samba.org>
Thu, 12 Nov 2020 15:28:41 +0000 (16:28 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/trans2.c

index 72c1df1cf26aa9b5809d0ff98b92e690e2a1c3ca..1924762b8ba98f43336910593445f87358532872 100644 (file)
@@ -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);
index 11f98ce349ba92e1988f76562e1235beab423c17..ab7f2bdabd9a594072144c8c341f881a060a5166 100644 (file)
@@ -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 <eggert@twinsun.com>. */
        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;