smbd: Introduce "conn" helper var in smbd_smb2_create_after_exec()
authorVolker Lendecke <vl@samba.org>
Thu, 1 Sep 2022 12:46:39 +0000 (14:46 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 2 Sep 2022 13:31:38 +0000 (13:31 +0000)
Will be used more in the future

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb2_create.c

index 75b9c7d28ff362b5479dd8c90403659f5600cd0e..b2beb6e373e99ba13408b229ef38ba21a76cf21c 100644 (file)
@@ -1387,6 +1387,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
 {
        struct smbd_smb2_create_state *state = tevent_req_data(
                req, struct smbd_smb2_create_state);
+       connection_struct *conn = state->result->conn;
        NTSTATUS status;
 
        /*
@@ -1409,7 +1410,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
                        DATA_BLOB blob = data_blob_const(p, sizeof(p));
 
                        status = smbd_calculate_access_mask_fsp(
-                                       state->result->conn->cwd_fsp,
+                                       conn->cwd_fsp,
                                        state->result,
                                        false,
                                        SEC_FLAG_MAXIMUM_ALLOWED,
@@ -1523,8 +1524,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
                SMB_STRUCT_STAT *base_sp = state->result->base_fsp ?
                        &state->result->base_fsp->fsp_name->st :
                        &state->result->fsp_name->st;
-               uint64_t file_id = SMB_VFS_FS_FILE_ID(
-                       state->result->conn, base_sp);
+               uint64_t file_id = SMB_VFS_FS_FILE_ID(conn, base_sp);
                DATA_BLOB blob = data_blob_const(p, sizeof(p));
 
                ZERO_STRUCT(p);