Stefan Metzmacher
a0cf42b709
s3:smb2_server: add smbd_smb2_request->do_encryption
...
For now it's always false...
metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
b5a72f4f35
s3:smb2_server: check the session before we could response with an error.
...
metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
f15d9a6670
s3:smb2_server: do central file_id check if the operation requires it
...
Note that it's fine to call file_fsp_smb2() twice, the 2nd call
just returns smb2req->compat_chain_fsp without a 2nd lookup.
metze
2012-08-09 08:21:35 +02:00
Stefan Metzmacher
1c76e99ae4
s3:smb2_server: s/i/idx in smbd_smb2_request_pending_queue()
...
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Aug 8 17:32:26 CEST 2012 on sn-devel-104
2012-08-08 17:32:26 +02:00
Stefan Metzmacher
83d262088b
s3:smb2_server: make use of SMBD_SMB2_OUT_HDR_PTR() in smbd_smb2_request_pending_queue()
...
metze
2012-08-08 12:52:52 +02:00
Stefan Metzmacher
0067de2074
s3:smb2_server: remove useless variable 'i'
...
metze
2012-08-08 12:52:51 +02:00
Stefan Metzmacher
63d92a192d
s3:smb2_server: rewrite dup_smb2_vec3() using SMBD_SMB2_*_IOV_OFS and helper variables
...
metze
2012-08-08 12:52:51 +02:00
Stefan Metzmacher
fc8e3bd569
s3:smb2_server: make use of SMBD_SMB2_* macros in smbd_smb2_request_done_ex()
...
metze
2012-08-08 12:52:51 +02:00
Stefan Metzmacher
97b5aaa648
s3:smb2_server: make use of SMBD_SMB2_* macros in smbd_smb2_request_verify_sizes()
...
metze
2012-08-08 12:52:50 +02:00
Stefan Metzmacher
05ae95a0d5
s3:smb2_server: use the common buffer layout for smbd_smb2_request_pending*
...
metze
2012-08-08 12:52:50 +02:00
Stefan Metzmacher
9f51d610d2
s3:smb2_server: don't try to update req->in.vector[0] in smbd_smb2_request_pending_queue()
...
req->in.vector[0] is reserved for the transport and might be removed in future.
This is currently always { NULL, 0 }, as it's not used, by our
transport layer code. The SMB2 layer should never touch this!
metze
2012-08-08 12:50:22 +02:00
Stefan Metzmacher
c9ecfd6f3d
s3:smb2_server: sign the last request at the start of smbd_smb2_request_reply()
...
This means we correctly sign all responses in a compound chain.
metze
2012-08-08 05:13:42 +02:00
Stefan Metzmacher
c3016915a1
s3:smb2_server: fix SMB2 signing of compound responses
...
We need to defer the signing until we know the response
doesn't change anymore before it goes over the wire.
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 7 20:29:30 CEST 2012 on sn-devel-104
2012-08-07 20:29:30 +02:00
Stefan Metzmacher
40f771e010
s3:smb2_server: there's no need to copy req->out.vector when we just keep the last request
...
metze
2012-08-07 18:32:47 +02:00
Stefan Metzmacher
8d63efe273
s3:smb2_server: use memmove instead of copying single vector elements
...
metze
2012-08-07 18:32:47 +02:00
Stefan Metzmacher
9b8973d3b5
s3:smb2_server: make use of SMBD_SMB2_OUT_HDR_PTR() smbd_smb2_request_pending_queue()
...
metze
2012-08-07 18:32:46 +02:00
Stefan Metzmacher
bfc87a4a76
s3:smb2_server: check for compound based on SMBD_SMB2_NUM_IOV_PER_REQ
...
metze
2012-08-07 18:32:46 +02:00
Stefan Metzmacher
5730272690
s3:smb2_server: make use of SMBD_SMB2_OUT_*_IOV smbd_smb2_request_reply()
...
metze
2012-08-07 18:32:46 +02:00
Stefan Metzmacher
727b1d1fa8
s3:smb2_server: check for compound based on SMBD_SMB2_NUM_IOV_PER_REQ
...
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
2da62179de
s3:smb2_server: make use of SMBD_SMB2_*_IOV_OFS
...
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
d609bb9b42
s3:smb2_server: make use of helper macros in smb2_calculate_credits()
...
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
efaea8e0e1
s3:smb2_server: make use of helper macros in smbd_smb2_request_validate()
...
metze
2012-08-07 18:32:45 +02:00
Stefan Metzmacher
4e6e1ecb6e
s3:smb2_server: make use of SMBD_SMB2_NUM_IOV_PER_REQ
...
metze
2012-08-07 18:32:44 +02:00
Stefan Metzmacher
e7bf8e7e23
s3:smb2_server: do one central as_root check if the operation requires it
...
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 7 13:14:38 CEST 2012 on sn-devel-104
2012-08-07 13:14:38 +02:00
Stefan Metzmacher
eec941e411
s3:smb2_server: do one central tcon check if the operation requires it
...
metze
2012-08-07 11:16:37 +02:00
Stefan Metzmacher
59b9dfa0cb
s3:smb2_server: do one central session check if the operation requires it
...
metze
2012-08-07 11:16:37 +02:00
Stefan Metzmacher
aba6df9f55
s3:smb2_server: add and use smbd_smb2_call()
...
metze
2012-08-07 11:16:37 +02:00
Stefan Metzmacher
e01333242f
s3:smb2_server: add .as_root to smbd_smb2_dispatch_table
...
metze
2012-08-07 11:16:36 +02:00
Stefan Metzmacher
f69ed57d0f
s3:smb2_server: add .need_tcon to smbd_smb2_dispatch_table
...
metze
2012-08-07 11:16:36 +02:00
Stefan Metzmacher
46f7a60e78
s3:smb2_server: add .need_session to smbd_smb2_dispatch_table
...
metze
2012-08-07 11:16:36 +02:00
Stefan Metzmacher
357110c10b
s3:smb2_server: introduce a smbd_smb2_dispatch_table (for now just with names)
...
metze
2012-08-07 11:16:36 +02:00
Stefan Metzmacher
5ac4d3d274
s3:smb2_server: move 'conn' to main block of smbd_smb2_request_dispatch()
...
metze
2012-08-07 11:16:36 +02:00
Stefan Metzmacher
721096b1ad
s3:smb2_server: make use of smbd_smb2_inbuf_parse_compound() in smbd_smb2_request_read*()
...
This changes the way we read SMB2 traffic from the socket,
now as create just one large buffer for the whole NBT payload
and then split it into iovec elements in smbd_smb2_inbuf_parse_compound()
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Aug 6 21:54:35 CEST 2012 on sn-devel-104
2012-08-06 21:54:35 +02:00
Stefan Metzmacher
fbd663c143
s3:smb2_server: make use of smbd_smb2_inbuf_parse_compound() in smbd_smb2_request_create()
...
metze
2012-08-06 20:02:32 +02:00
Stefan Metzmacher
9e9d784def
s3:smb2_server: remove const from smbd_smb2_first_negprot()
...
metze
2012-08-06 20:02:32 +02:00
Stefan Metzmacher
c1b3454259
s3:smb2_server: add smbd_smb2_inbuf_parse_compound()
...
metze
2012-08-06 20:02:32 +02:00
Stefan Metzmacher
4384b1e73b
s3:smb2_server: make use of SMBD_SMB2_* macros
...
metze
2012-08-05 20:55:41 +02:00
Stefan Metzmacher
7327310754
s3:smb2_server: use 'i' instead of '1' as vector index in smbd_smb2_request_pending_timer()
...
If we reach this code i is currently always 1, but it's easier to unstand this
way.
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Aug 5 20:00:26 CEST 2012 on sn-devel-104
2012-08-05 20:00:26 +02:00
Stefan Metzmacher
c66a45d3f2
s3:smb2_server: simplify the talloc_pool handling for smbd_smb2_request
...
metze
2012-07-25 12:15:01 +02:00
Volker Lendecke
abda9d3347
s3: Fix Coverity ID 709217 Dereference after null check
...
A few lines before we did check for x != NULL. I think this might
fix a potential remote crash.
Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jul 3 15:30:17 CEST 2012 on sn-devel-104
2012-07-03 15:30:16 +02:00
Michael Adam
bfc38d74cc
s3:smbd:smb2: change smbXsrv_tcon0 to smbXsrv_tcon in smbd_smb2_request_check_tcon()
...
smbXsrv_tcon0 is the internal name for the (current) version0 of the
structure. Externally, only smbXsrv_tcon should be used.
2012-07-03 13:39:40 +02:00
Stefan Metzmacher
1a622fe641
s3:smb2_server: remove max_charge check in smbd_smb2_request_verify_creditcharge()
...
The client can send any credit charge value, it's ok to send more than needed.
metze
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-29 15:21:08 +02:00
Stefan Metzmacher
34a9892ec1
s3:smb2_server: make the logic in smbd_smb2_request_verify_creditcharge() simpler
...
We just need a max_charge variable to make the algorithm independent
of multi_credit support.
metze
2012-06-29 00:14:56 +02:00
Stefan Metzmacher
967f2c44b3
s3:smb2_server: simplify smbd_smb2_request_verify_creditcharge() a bit.
...
A credit charge of 0 is really not a special case, it just means the same
as 1.
metze
2012-06-29 00:14:56 +02:00
Stefan Metzmacher
1db83d2b37
s3:smb2_server: grant extra credits for multi-credit requests
...
metze
2012-06-29 00:14:55 +02:00
Stefan Metzmacher
648b959b13
s3:smb2_server: implement credit granting similar to windows
...
This makes it much easier to compare traces.
metze
2012-06-29 00:14:55 +02:00
Stefan Metzmacher
82dc0b33b9
s3:smb2_server: make sure sequence numbers don't wrap at UINT64_MAX
...
metze
2012-06-29 00:14:54 +02:00
Stefan Metzmacher
ee8ae459ae
s3:smb2_server: make sure we don't grant more credits than we allow
...
If the client hasn't consumed the lowest seqnum, but the distance
between lowest and highest seqnum has reached max credits.
In that case we should stop granting credits.
metze
2012-06-29 00:14:54 +02:00
Stefan Metzmacher
4fe41c0bb1
s3:smb2_server: check the credit_charge against the already granted credits
...
metze
2012-06-29 00:14:54 +02:00
Stefan Metzmacher
984fdaf914
s3:smb2_server: split out a smb2_validate_sequence_number() function
...
metze
2012-06-29 00:14:53 +02:00