s3:smb2_*: make use of smb2req->xconn where possible
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jun 2014 06:38:48 +0000 (08:38 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 6 Aug 2014 07:51:13 +0000 (09:51 +0200)
We need to use the connection that is used by the current request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/smb2_create.c
source3/smbd/smb2_find.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_ioctl_network_fs.c
source3/smbd/smb2_negprot.c
source3/smbd/smb2_notify.c
source3/smbd/smb2_read.c
source3/smbd/smb2_sesssetup.c
source3/smbd/smb2_setinfo.c
source3/smbd/smb2_tcon.c
source3/smbd/smb2_write.c

index 0c27a010587749a9d30af295f98ca88b5485eaa7..7565201f85c34d0f5c64b4ebf99521ec92bed425 100644 (file)
@@ -820,7 +820,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                        DATA_BLOB new_cookie = data_blob_null;
                        NTTIME now = timeval_to_nttime(&smb2req->request_time);
 
-                       status = smb2srv_open_recreate(smb2req->sconn->conn,
+                       status = smb2srv_open_recreate(smb2req->xconn,
                                                smb1req->conn->session_info,
                                                persistent_id, create_guid,
                                                now, &op);
index 2d310a51527eebd5dd809dacac9822cc22817eec..7597713834c6e4e8f508078e4344cc640aaac31c 100644 (file)
@@ -207,7 +207,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
                                              uint32_t in_output_buffer_length,
                                              const char *in_file_name)
 {
-       struct smbXsrv_connection *xconn = smb2req->sconn->conn;
+       struct smbXsrv_connection *xconn = smb2req->xconn;
        struct tevent_req *req;
        struct smbd_smb2_find_state *state;
        struct smb_request *smbreq;
index 275792c04120d6ef161be3e6a83e160677a9a165..87bb1c5f2e1a7734707818a5380b8af829da5eda 100644 (file)
@@ -44,7 +44,7 @@ static NTSTATUS smbd_smb2_getinfo_recv(struct tevent_req *req,
 static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq);
 NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        NTSTATUS status;
        const uint8_t *inbody;
        uint8_t in_info_type;
index b2dfb212b0353c79928e05b0484c0a1ed7cbf79a..30d02a216fa2ea3d36cd01be4ce8e428cb85cb4b 100644 (file)
@@ -506,7 +506,7 @@ struct tevent_req *smb2_ioctl_network_fs(uint32_t ctl_code,
                break;
        case FSCTL_VALIDATE_NEGOTIATE_INFO:
                status = fsctl_validate_neg_info(state, ev,
-                                                state->smbreq->sconn->conn,
+                                                state->smbreq->xconn,
                                                 &state->in_input,
                                                 state->in_max_output,
                                                 &state->out_output,
index 3f76f3f0f518aee4a07c74085bc2235378a87517..feb5a4d6272ad87e3ac733848f87defa4b2ec6b2 100644 (file)
@@ -78,7 +78,7 @@ void reply_smb2002(struct smb_request *req, uint16_t choice)
  */
 void reply_smb20ff(struct smb_request *req, uint16_t choice)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        xconn->smb2.allow_2ff = true;
        reply_smb20xx(req, SMB2_DIALECT_REVISION_2FF);
 }
@@ -170,7 +170,7 @@ enum protocol_types smbd_smb2_protocol_dialect_match(const uint8_t *indyn,
 
 NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        NTSTATUS status;
        const uint8_t *inbody;
        const uint8_t *indyn = NULL;
index 3e33d42bcee218ed149b958955496c4faba8842e..39be8293a887832bfaa874d410da2329c44bd158 100644 (file)
@@ -48,7 +48,7 @@ static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req,
 static void smbd_smb2_request_notify_done(struct tevent_req *subreq);
 NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        NTSTATUS status;
        const uint8_t *inbody;
        uint16_t in_flags;
index 1679944ea209abc252718afc22ceb7b4ca83fde5..b8ae74342a0da899271e96d9ad05b86b40f197ef 100644 (file)
@@ -43,7 +43,7 @@ static NTSTATUS smbd_smb2_read_recv(struct tevent_req *req,
 static void smbd_smb2_request_read_done(struct tevent_req *subreq);
 NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        NTSTATUS status;
        const uint8_t *inbody;
        uint32_t in_length;
@@ -186,7 +186,7 @@ static int smb2_sendfile_send_data(struct smbd_smb2_read_state *state)
        uint64_t in_offset = state->in_offset;
        files_struct *fsp = state->fsp;
        const DATA_BLOB *hdr = state->smb2req->queue_entry.sendfile_header;
-       struct smbXsrv_connection *xconn = state->smb2req->sconn->conn;
+       struct smbXsrv_connection *xconn = state->smb2req->xconn;
        ssize_t nread;
        ssize_t ret;
        int saved_errno;
index d4f0d793a5626d3eb4470f490b7941a3c77d4474..3a80afdf2d08be0d95adb3849e27e7882a70823d 100644 (file)
@@ -479,7 +479,7 @@ static int smbd_smb2_session_setup_state_destructor(struct smbd_smb2_session_set
         * Ensure that any outstanding requests don't also refer
         * to it.
         */
-       xconn = state->smb2req->sconn->conn;
+       xconn = state->smb2req->xconn;
 
        for (preq = xconn->smb2.requests; preq != NULL; preq = preq->next) {
                if (preq == state->smb2req) {
@@ -549,7 +549,7 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx,
        state->in_security_buffer = in_security_buffer;
 
        if (in_flags & SMB2_SESSION_FLAG_BINDING) {
-               if (smb2req->sconn->conn->protocol < PROTOCOL_SMB2_22) {
+               if (smb2req->xconn->protocol < PROTOCOL_SMB2_22) {
                        tevent_req_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED);
                        return tevent_req_post(req, ev);
                }
@@ -565,13 +565,13 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx,
 
        if (state->in_session_id == 0) {
                /* create a new session */
-               status = smbXsrv_session_create(state->smb2req->sconn->conn,
+               status = smbXsrv_session_create(state->smb2req->xconn,
                                                now, &state->session);
                if (tevent_req_nterror(req, status)) {
                        return tevent_req_post(req, ev);
                }
        } else {
-               status = smb2srv_session_lookup(state->smb2req->sconn->conn,
+               status = smb2srv_session_lookup(state->smb2req->xconn,
                                                state->in_session_id, now,
                                                &state->session);
                if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_SESSION_EXPIRED)) {
@@ -877,7 +877,7 @@ static struct tevent_req *smbd_smb2_logoff_send(TALLOC_CTX *mem_ctx,
        struct smbd_smb2_logout_state *state;
        struct tevent_req *subreq;
        struct smbd_smb2_request *preq;
-       struct smbXsrv_connection *xconn = smb2req->sconn->conn;
+       struct smbXsrv_connection *xconn = smb2req->xconn;
 
        req = tevent_req_create(mem_ctx, &state,
                        struct smbd_smb2_logout_state);
index 1b5e2a8e5e171fd134e994b7f7f311273b406a02..031c0be673fb2ee4aa1c9635f6e446dcd1a28a70 100644 (file)
@@ -39,7 +39,7 @@ static NTSTATUS smbd_smb2_setinfo_recv(struct tevent_req *req);
 static void smbd_smb2_request_setinfo_done(struct tevent_req *subreq);
 NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        NTSTATUS status;
        const uint8_t *inbody;
        uint8_t in_info_type;
index 6289427bf938634ed4cf4e929c924ad4466ca383..5d78b4f840db037b6514dba99658cccb01f52b33 100644 (file)
@@ -175,7 +175,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
                                       uint32_t *out_maximal_access,
                                       uint32_t *out_tree_id)
 {
-       struct smbXsrv_connection *conn = req->sconn->conn;
+       struct smbXsrv_connection *conn = req->xconn;
        const char *share = in_path;
        char *service = NULL;
        int snum = -1;
@@ -498,7 +498,7 @@ static struct tevent_req *smbd_smb2_tdis_send(TALLOC_CTX *mem_ctx,
        struct smbd_smb2_tdis_state *state;
        struct tevent_req *subreq;
        struct smbd_smb2_request *preq;
-       struct smbXsrv_connection *xconn = smb2req->sconn->conn;
+       struct smbXsrv_connection *xconn = smb2req->xconn;
 
        req = tevent_req_create(mem_ctx, &state,
                        struct smbd_smb2_tdis_state);
index 40a59372ee40b04297fef9c4edbe7fd9e2fcc099..35ee020e8be55763c5a78ce40fa9343db5d1d8ce 100644 (file)
@@ -38,7 +38,7 @@ static NTSTATUS smbd_smb2_write_recv(struct tevent_req *req,
 static void smbd_smb2_request_write_done(struct tevent_req *subreq);
 NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
 {
-       struct smbXsrv_connection *xconn = req->sconn->conn;
+       struct smbXsrv_connection *xconn = req->xconn;
        NTSTATUS status;
        const uint8_t *inbody;
        uint16_t in_data_offset;