1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-23 20:59:10 +03:00
Commit Graph

142 Commits

Author SHA1 Message Date
cb120b4df6 Never hand out 0xffff as a mid
This is used for oplock replies
2009-04-06 21:32:07 +02:00
64067f9204 Remove async_req based async libsmb infrastructure 2009-04-06 21:32:07 +02:00
8bdac3615a Add new async libsmb infrastructure
I know this is just yet another iteration, but I like this one much better than
the one that exists right now :-)

It will do trans and echo requests without a _recv helper and without
unnecessary memcpy().
2009-04-06 21:32:06 +02:00
6af15943c6 s3:libsmb: use new simplified smb_signing code for the client side
We store the seqnum/mid mapping in the cli_request structure
for async requests and in the cli_state structure for sync calls.

We skip the signing check for oplock requests while waiting
for async requests coming in.

metze
2009-03-23 12:21:14 +01:00
808928c24b Fix crash in async_smb.c 2009-03-20 09:56:15 +01:00
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00
b99859b948 Make is_andx_req non-static 2009-01-31 11:09:39 +01:00
c001b456cf Fix a valgrind error when the socket dies
Don't reference anything that might have been deleted in the async_req_error
call.
2009-01-28 16:18:15 +01:00
27abf6731e struct async_req doesn't really need to carry an event_context 2009-01-03 19:07:57 +01:00
ae1d6020f0 Fix setting smb_len for huge write&x calls 2008-12-19 18:15:30 +01:00
fa5f11279b Add the cli_wct_ofs routine to calculate the offset for write&x 2008-12-19 18:12:44 +01:00
13eefa7c43 Add a doxygen comment line I forgot to merge 2008-12-19 17:50:34 +01:00
1f04d07db0 Convert cli_request->outbuf to uint8_t 2008-12-19 17:47:30 +01:00
398ef0fb85 For large smbwrite&x, we need more than 64k bcc 2008-12-19 16:13:27 +01:00
98c4055bcb Add some comments
If it takes more than 10 seconds to understand the code you've written yourself
less than a year ago, it's time for comments or refactoring. I couldn't find a
way to refactor that cleanly, so add comments :-)
2008-12-19 16:13:26 +01:00
45ad3df140 Fix the padding calculation in smb_splice_chain for "bytes_padding!=0" 2008-12-19 14:53:29 +01:00
4abdd3981e Pass "bytes_alignment" up through cli_request_send
This parameter makes smb_spice_chain add padding before the bytes field
2008-12-19 14:53:29 +01:00
2fe7d5936a Prefer network writes over reads
If we really want to keep the pipe busy, we need to write everything we have as
early as possible, giving the kernel the chance to get rid of the buffers
quickly :-)
2008-12-19 13:46:52 +01:00
ed25c6c287 Add a "bytes_padding" parameter to smb_splice_chain
For example open&x and write&x needs the bytes to be aligned relative to the
SMB header. In particular for write&x we should not have to move stuff around.
2008-12-08 22:09:33 +01:00
f0bb53dd0f Factor out smb_splice_chain(), to be used by chain_reply() in smbd 2008-12-08 22:09:33 +01:00
16bbfc2262 Fixed "argument differ in signedness" warning on linux 2008-10-14 17:31:07 -07:00
decd04d946 Ensure we handle signals correctly during the async calls.
Jeremy.
2008-10-09 15:40:00 -07:00
eeac8d4fbe Remove a cast -- thanks metze 2008-09-17 17:45:17 +02:00
ffbc38abe1 Factor out validate_smb_crypto
(This used to be commit 37fcc9dc46)
2008-09-12 23:09:17 +02:00
ced409b5f7 Fix "make test" -- gna...
(This used to be commit c1d3ae80b5)
2008-09-12 22:29:56 +02:00
d892b1c886 remove a pointless empty line
(This used to be commit fba250ece4)
2008-09-12 21:42:34 +02:00
f8f1679bc4 Add a paranoia check on incoming PDUs
(This used to be commit 8b81b85200)
2008-09-12 21:42:34 +02:00
2a93452994 Move setting the mid field in req->outbuf from _cork to _uncork
The async trans calls need this, as for secondary trans calls they have to
modify the MID from what cli_request_chain() gave us.
(This used to be commit c85de4b7b5)
2008-09-09 17:37:34 +02:00
6ba8c105c5 Add utility function cli_in_chain()
This gives a hint whether a function is called from within the middle of a
chain. In particular the trans calls don't really like this.
(This used to be commit 4252b32db5)
2008-09-09 17:37:34 +02:00
60255c3b2e Protect against a closed socket
(This used to be commit d6cb5fdafb)
2008-09-05 12:33:48 +02:00
f912ac962a Do proper error handling if the socket is closed
(This used to be commit e5a27773f9)
2008-09-05 12:33:48 +02:00
f294f51bf0 Remove cli_request_get()
req->private_data==NULL at this point is definitely a bug.
(This used to be commit ce3dc9f616)
2008-08-28 18:22:49 +02:00
bb0fc9cfce Add cli_request->recv_helper
Necessary for requests with multiple replies
(This used to be commit cb2e338eb3)
2008-08-28 18:15:59 +02:00
b054f14111 Activate code to enable chained requests
Add the CHAIN1 torture test
(This used to be commit 82992d74a9)
2008-08-28 18:15:59 +02:00
65dcdf9c32 This adds the code to allow chained requests in libsmb/
This is not compiled yet, but it makes the patches much easier to read if it is
add in bulk.
(This used to be commit b4c539ba04)
2008-08-28 18:15:58 +02:00
77d1b29e25 Move "struct cli_request" from client.h to async_smb.h
Also add some comments
(This used to be commit 2ecc311f78)
2008-08-28 17:53:37 +02:00
128524930d Add cli_pull_reply
Along the lines of cli_request_send this abstracts away the smb-level buffer
handling when parsing replies we got from the server.
(This used to be commit 253134d3aa)
2008-08-28 17:53:37 +02:00
2650207d4a Remove cli->event_ctx, pass it explicitly
Storing the event_context as permanent state in struct cli_state creates more
complex code than necessary IMO.
(This used to be commit debb37f703)
2008-08-28 17:53:37 +02:00
58aa97c0d9 Refactoring: Add the routine cli_request_send()
cli_request_send() is supposed to bundle all generic SMB-header handling. This
makes cli_request_new static to async_smb.c.
(This used to be commit 7e73dd4e76)
2008-08-28 17:53:36 +02:00
b48ba00dc6 Prevent NT_STATUS 0xF1000000 errors from appearing when
dos errors are used and there is no error.  It should
be mapped directly to NT_STATUS_OK.  smbclient to older
servers didn't work.
(This used to be commit 78f009b7ef)
2008-08-14 11:22:46 +02:00
464f74df2f Move inbuf handling to before the PDU handling
In an error case, correctly discard the offending PDU
(This used to be commit 0aa195b5d6)
2008-03-08 22:02:33 +01:00
1ea0a5d0cd Add infrastructure to support async SMB requests
(This used to be commit e215330135)
2008-03-06 13:28:23 +01:00