1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

96 Commits

Author SHA1 Message Date
Bo Yang
05379f0125 s3: return proper error code in cli_smb_req_send
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-13 18:47:00 +08:00
Jeremy Allison
ad9d64ee1b Clean up assignments to iov_base, ensure it's always cast to void *. This should quieten some warnings with picky compilers on the buildfarm.
Jeremy.
2009-05-12 11:45:37 -07:00
Bo Yang
f8cc0e88fb s3: fix crash in winbindd 2009-04-29 09:50:41 +08:00
Volker Lendecke
64ce0e4645 Add async oplock waiter 2009-04-06 21:32:08 +02:00
Volker Lendecke
cb120b4df6 Never hand out 0xffff as a mid
This is used for oplock replies
2009-04-06 21:32:07 +02:00
Volker Lendecke
64067f9204 Remove async_req based async libsmb infrastructure 2009-04-06 21:32:07 +02:00
Volker Lendecke
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
Stefan Metzmacher
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
Bo Yang
808928c24b Fix crash in async_smb.c 2009-03-20 09:56:15 +01:00
Volker Lendecke
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00
Volker Lendecke
b99859b948 Make is_andx_req non-static 2009-01-31 11:09:39 +01:00
Volker Lendecke
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
Volker Lendecke
27abf6731e struct async_req doesn't really need to carry an event_context 2009-01-03 19:07:57 +01:00
Volker Lendecke
ae1d6020f0 Fix setting smb_len for huge write&x calls 2008-12-19 18:15:30 +01:00
Volker Lendecke
fa5f11279b Add the cli_wct_ofs routine to calculate the offset for write&x 2008-12-19 18:12:44 +01:00
Volker Lendecke
13eefa7c43 Add a doxygen comment line I forgot to merge 2008-12-19 17:50:34 +01:00
Volker Lendecke
1f04d07db0 Convert cli_request->outbuf to uint8_t 2008-12-19 17:47:30 +01:00
Volker Lendecke
398ef0fb85 For large smbwrite&x, we need more than 64k bcc 2008-12-19 16:13:27 +01:00
Volker Lendecke
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
Volker Lendecke
45ad3df140 Fix the padding calculation in smb_splice_chain for "bytes_padding!=0" 2008-12-19 14:53:29 +01:00
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
f0bb53dd0f Factor out smb_splice_chain(), to be used by chain_reply() in smbd 2008-12-08 22:09:33 +01:00
Tim Prouty
16bbfc2262 Fixed "argument differ in signedness" warning on linux 2008-10-14 17:31:07 -07:00
Jeremy Allison
decd04d946 Ensure we handle signals correctly during the async calls.
Jeremy.
2008-10-09 15:40:00 -07:00
Volker Lendecke
eeac8d4fbe Remove a cast -- thanks metze 2008-09-17 17:45:17 +02:00
Volker Lendecke
ffbc38abe1 Factor out validate_smb_crypto
(This used to be commit 37fcc9dc46)
2008-09-12 23:09:17 +02:00
Volker Lendecke
ced409b5f7 Fix "make test" -- gna...
(This used to be commit c1d3ae80b5)
2008-09-12 22:29:56 +02:00
Volker Lendecke
d892b1c886 remove a pointless empty line
(This used to be commit fba250ece4)
2008-09-12 21:42:34 +02:00
Volker Lendecke
f8f1679bc4 Add a paranoia check on incoming PDUs
(This used to be commit 8b81b85200)
2008-09-12 21:42:34 +02:00
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
60255c3b2e Protect against a closed socket
(This used to be commit d6cb5fdafb)
2008-09-05 12:33:48 +02:00
Volker Lendecke
f912ac962a Do proper error handling if the socket is closed
(This used to be commit e5a27773f9)
2008-09-05 12:33:48 +02:00
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Volker Lendecke
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
Jim McDonough
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
Volker Lendecke
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
Volker Lendecke
1ea0a5d0cd Add infrastructure to support async SMB requests
(This used to be commit e215330135)
2008-03-06 13:28:23 +01:00