s3:smbd: pass smbXsrv_connection to smb1_parse_chain()
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jun 2014 06:43:26 +0000 (08:43 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 19 Sep 2014 07:15:11 +0000 (09:15 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/process.c
source3/smbd/proto.h
source3/torture/vfstest_chain.c

index 6ba39064879ee763e6a8e7a6eb436885e411cd64..63a902aec6517ae2e1636ab0667d862e681353ea 100644 (file)
@@ -1704,7 +1704,7 @@ static void construct_reply_chain(struct smbd_server_connection *sconn,
        unsigned num_reqs;
        bool ok;
 
-       ok = smb1_parse_chain(talloc_tos(), (uint8_t *)inbuf, sconn, encrypted,
+       ok = smb1_parse_chain(talloc_tos(), (uint8_t *)inbuf, xconn, encrypted,
                              seqnum, &reqs, &num_reqs);
        if (!ok) {
                char errbuf[smb_size];
@@ -2397,14 +2397,18 @@ static bool smb1_parse_chain_cb(uint8_t cmd,
 }
 
 bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf,
-                     struct smbd_server_connection *sconn,
+                     struct smbXsrv_connection *xconn,
                      bool encrypted, uint32_t seqnum,
                      struct smb_request ***reqs, unsigned *num_reqs)
 {
-       struct smbXsrv_connection *xconn = sconn->conn;
+       struct smbd_server_connection *sconn = NULL;
        struct smb1_parse_chain_state state;
        unsigned i;
 
+       if (xconn != NULL) {
+               sconn = xconn->sconn;
+       }
+
        state.mem_ctx = mem_ctx;
        state.buf = buf;
        state.sconn = sconn;
index a625f78d20edd2940583606506690bf07eeee4a2..f35bc61a7d654f0c007415e54c2d690c791bbff6 100644 (file)
@@ -778,7 +778,7 @@ bool smb1_walk_chain(const uint8_t *buf,
                     void *private_data);
 unsigned smb1_chain_length(const uint8_t *buf);
 bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf,
-                     struct smbd_server_connection *sconn,
+                     struct smbXsrv_connection *xconn,
                      bool encrypted, uint32_t seqnum,
                      struct smb_request ***reqs, unsigned *num_reqs);
 bool req_is_in_chain(const struct smb_request *req);
index 11c643b91a7b082db518a8112fb99e849b2b48e6..174117b7082f1ec2e5eaf9cb7045a3a1e2615e0c 100644 (file)
@@ -329,12 +329,12 @@ NTSTATUS cmd_test_chain(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
        ret &= (chain_length == 0);
 
        ret &= smb1_parse_chain(talloc_tos(), chain1_data,
-                               vfs->conn->sconn, false, 0,
+                               NULL, false, 0,
                                &requests, &chain_length);
        ret &= (chain_length == 3);
 
        ret &= smb1_parse_chain(talloc_tos(), chain2_data,
-                               vfs->conn->sconn, false, 0,
+                               NULL, false, 0,
                                &requests, &chain_length);
        ret &= (chain_length == 2);