s3:libsmb: fix smb signing for fragmented trans/trans2/nttrans requests
authorStefan Metzmacher <metze@samba.org>
Wed, 18 Mar 2009 06:56:51 +0000 (07:56 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 19 Mar 2009 14:04:55 +0000 (15:04 +0100)
commitd01cca5e3ddb925696d49a1ea728013ec1032372
tree76cf73b6cfbc9e24411b565b610ad12465c34f2e
parentfecb980bc90ba4be1fa95b4a6e2aa6967d036656
s3:libsmb: fix smb signing for fragmented trans/trans2/nttrans requests

Before we send the secondary requests we need to remove the
old mid=>seqnum mapping and reset cli->mid and make the new
mid=>seqnum mapping "persistent".

The bug we had in cli_send_trans was this:
The first cli_send_smb() incremented cli->mid
and the secondary requests used the incremented mid,
but as cli->outbuf still had the correct mid,
we send the correct mid to the server. The real problem
was that the cli_send_smb() function stored the seqnum
under the wrong mid.

cli_send_nttrans() was totally broken and now follows the
same logic as cli_send_trans().

The good thing is that in practice the problem is unlikely to happen,
because max_xmit is large enough to avoid secondary requests.

metze
(cherry picked from commit 880fbc4e8cd67de73c4bcda94489eb1e1422a04b)
(cherry picked from commit 70466990b4b7c68ae95dbbcf741cd3f41f2dd0b3)
source/libsmb/clitrans.c