Ensure the server can cope with multiple secondary trans
authorJeremy Allison <jra@samba.org>
Mon, 1 Dec 2003 06:53:21 +0000 (06:53 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 1 Dec 2003 06:53:21 +0000 (06:53 +0000)
requests when signing is turned on.
Jeremy.
(This used to be commit b97596df7834a80b648022e22983cab5dfb0f7dd)

source3/smbd/ipc.c
source3/smbd/nttrans.c
source3/smbd/trans2.c

index 86d982b0227819f6fbafdb2add1f61568a222a91..dd92cc4e4d5cdf98913227b2324291a4534bc9ea 100644 (file)
@@ -445,6 +445,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int
                   of the parameter/data bytes */
                outsize = set_message(outbuf,0,0,True);
                show_msg(outbuf);
+               srv_signing_trans_stop();
                if (!send_smb(smbd_server_fd(),outbuf))
                        exit_server("reply_trans: send_smb failed.");
        }
@@ -456,6 +457,13 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int
       
                ret = receive_next_smb(inbuf,bufsize,SMB_SECONDARY_WAIT);
 
+               /*
+                * The sequence number for the trans reply is always
+                * based on the last secondary received.
+                */
+
+               srv_signing_trans_start(SVAL(inbuf,smb_mid));
+
                if ((ret && (CVAL(inbuf, smb_com) != SMBtranss)) || !ret) {
                        if(ret) {
                                DEBUG(0,("reply_trans: Invalid secondary trans packet\n"));
index 8158c67a5ee605a3302db5e80cd2c6b28d078d33..25721d99a8b60bb55386182298f96c6553e23c18 100644 (file)
@@ -2489,6 +2489,7 @@ due to being in oplock break state.\n", (unsigned int)function_code ));
                /* We need to send an interim response then receive the rest
                        of the parameter/data bytes */
                outsize = set_message(outbuf,0,0,True);
+               srv_signing_trans_stop();
                if (!send_smb(smbd_server_fd(),outbuf))
                        exit_server("reply_nttrans: send_smb failed.");
 
@@ -2499,6 +2500,13 @@ due to being in oplock break state.\n", (unsigned int)function_code ));
 
                        ret = receive_next_smb(inbuf,bufsize,SMB_SECONDARY_WAIT);
 
+                       /*
+                        * The sequence number for the trans reply is always
+                        * based on the last secondary received.
+                        */
+
+                       srv_signing_trans_start(SVAL(inbuf,smb_mid));
+
                        if((ret && (CVAL(inbuf, smb_com) != SMBnttranss)) || !ret) {
                                outsize = set_message(outbuf,0,0,True);
                                if(ret) {
index 56d1aae3a2a562fac4804f44f7c2cd2f7e8d6c20..525b0153791f2705f8f4c1af08876026ab4e112b 100644 (file)
@@ -3523,6 +3523,7 @@ int reply_trans2(connection_struct *conn,
                /* We need to send an interim response then receive the rest
                   of the parameter/data bytes */
                outsize = set_message(outbuf,0,0,True);
+               srv_signing_trans_stop();
                if (!send_smb(smbd_server_fd(),outbuf))
                        exit_server("reply_trans2: send_smb failed.");
 
@@ -3536,6 +3537,13 @@ int reply_trans2(connection_struct *conn,
 
                        ret = receive_next_smb(inbuf,bufsize,SMB_SECONDARY_WAIT);
                        
+                       /*
+                        * The sequence number for the trans reply is always
+                        * based on the last secondary received.
+                        */
+
+                       srv_signing_trans_start(SVAL(inbuf,smb_mid));
+
                        if ((ret && 
                             (CVAL(inbuf, smb_com) != SMBtranss2)) || !ret) {
                                outsize = set_message(outbuf,0,0,True);