]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: dos_mode_post: remove smb_fname param
authorNoel Power <noel.power@suse.com>
Thu, 10 Jun 2021 09:04:39 +0000 (10:04 +0100)
committerNoel Power <npower@samba.org>
Fri, 11 Jun 2021 09:30:53 +0000 (09:30 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org
source3/smbd/dosmode.c

index 8686b1547569e923e24ec0dcfb20e615762a450f..4a7de4d52a1d1d03332f9ed7aeb4cdc2c2d1bcff 100644 (file)
@@ -679,11 +679,10 @@ static uint32_t dos_mode_from_name(connection_struct *conn,
 }
 
 static uint32_t dos_mode_post(uint32_t dosmode,
-                             connection_struct *conn,
                              struct files_struct *fsp,
-                             struct smb_filename *smb_fname,
                              const char *func)
 {
+       struct smb_filename *smb_fname = NULL;
        NTSTATUS status;
 
        if (fsp != NULL) {
@@ -708,17 +707,17 @@ static uint32_t dos_mode_post(uint32_t dosmode,
                dosmode &= ~(FILE_ATTRIBUTE_DIRECTORY);
        }
 
-       if (conn->fs_capabilities & FILE_FILE_COMPRESSION) {
+       if (fsp->conn->fs_capabilities & FILE_FILE_COMPRESSION) {
                bool compressed = false;
 
-               status = dos_mode_check_compressed(conn, fsp, smb_fname,
+               status = dos_mode_check_compressed(fsp->conn, fsp, smb_fname,
                                                   &compressed);
                if (NT_STATUS_IS_OK(status) && compressed) {
                        dosmode |= FILE_ATTRIBUTE_COMPRESSED;
                }
        }
 
-       dosmode |= dos_mode_from_name(conn, smb_fname, dosmode);
+       dosmode |= dos_mode_from_name(fsp->conn, smb_fname, dosmode);
 
        if (S_ISDIR(smb_fname->st.st_ex_mode)) {
                dosmode |= FILE_ATTRIBUTE_DIRECTORY;
@@ -778,7 +777,7 @@ uint32_t fdos_mode(struct files_struct *fsp)
                }
        }
 
-       result = dos_mode_post(result, fsp->conn, fsp, NULL, __func__);
+       result = dos_mode_post(result, fsp, __func__);
        return result;
 }
 
@@ -890,9 +889,7 @@ static void dos_mode_at_vfs_get_dosmode_done(struct tevent_req *subreq)
        }
        if (NT_STATUS_IS_OK(status)) {
                state->dosmode = dos_mode_post(state->dosmode,
-                                              state->smb_fname->fsp->conn,
                                               state->smb_fname->fsp,
-                                              NULL,
                                               __func__);
                tevent_req_done(req);
                return;