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

67 Commits

Author SHA1 Message Date
Günther Deschner
6c8d802391 s3-libsmb: move smb encryption structs into own header.
Guenther
2011-03-16 10:11:16 +01:00
Volker Lendecke
02a74fd36d s3: Add async cli_session_request
This does not do the redirects, but I think that might be obsolete anyway
2010-12-22 16:39:15 +01:00
Volker Lendecke
e25ee6af8f s3: Make winbind recover from a signing error
When winbind sees a signing error on the smb connection to a DC (for whatever
reason, our bug, network glitch, etc) it should recover properly. The "old"
code in clientgen.c just closed the socket in this case. This is the right
thing to do, this connection is spoiled anyway. The new, async code did not do
this so far, which led to the code in winbindd_cm.c not detect that we need to
reconnect.
2010-11-18 14:48:18 +00:00
Günther Deschner
c7fe04abc7 s3-build: only include async headers where needed.
Guenther
2010-09-20 13:54:42 -07:00
Jim McDonough
0ec0095d1a s3-libsmbclient Convert dos error codes to NTstatus in async libsmbclient.
DOS error codes were being lost with the conversion to async
libsmbclient.  If we're passing around NTSTATUS internally,
let's just convert it when we get it.

DOS ACCESS_DENIED on nautilus was not prompting for other credentials,
because it was not being mapped.
2010-08-19 15:49:31 -04:00
Jeremy Allison
d447184ca8 If the timeout has been set to zero, don't register an end time.
The caller doesn't want a timeout.

Jeremy.
2010-03-30 13:45:53 -07:00
Volker Lendecke
9ad1b4cda0 s3: Fix the CHAIN1 torture test
I've tried to solve this just within cli_smb_recv(), but I could not find a way
to sanely determine when we are receiving the last entry in the chain just from
looking at the blob. This solves it in an a bit more brutal way...
2010-02-28 18:49:59 +01:00
Volker Lendecke
299d9c409d s3: Explicitly handle inbuf in cli_smb_oplock_break_waiter_done 2010-02-22 23:23:18 +01:00
Volker Lendecke
d122bfc064 s3: Add a talloc_move for the inbuf to cli_smb_recv 2010-02-22 23:23:18 +01:00
Volker Lendecke
65914ed819 s3: Avoid calling cli_alloc_mid twice in cli_smb_req_iov_send
I hate macros....
2010-02-21 20:42:39 +01:00
Björn Jacke
38be40f63c s3:async_smb: remove unused variable 2010-01-26 00:19:10 +01:00
Volker Lendecke
3f25fb5677 s3: NT_STATUS_MORE_PROCESSING_REQUIRED is a valid sesssetup return value 2010-01-03 11:38:22 +01:00
Volker Lendecke
47bee67c05 s3: Restore correct timeouts for SMB requests 2009-12-22 16:07:58 +01:00
Volker Lendecke
528c150d55 s3: Remove a pointless else branch 2009-12-22 14:08:08 +01:00
Volker Lendecke
b6f446ca35 s3: Move smb_splice_chain to smbd/process.c, its only user 2009-12-22 13:54:43 +01:00
Volker Lendecke
a8e02b591b Add "err_on_readability" to writev_send
A socket where the other side has closed only becomes readable. To catch
errors early when sitting in a pure writev, we need to also test for
readability.
2009-05-24 13:47:29 +02:00
Volker Lendecke
f140bf2e65 Fix broken pipe handling
Metze is right: If we have *any* error at the socket level, we just can
not continue.

Also, apply some defensive programming: With this async stuff someone else
might already have closed the socket.
2009-05-18 07:13:04 +02:00
Bo Yang
aa70e44cd0 s3: tevent_req_poll() loops forever when pipe is broken
Signed-off-by: Bo Yang <boyang@samba.org>
2009-05-19 01:13:36 +08:00
Stefan Metzmacher
b9f3a78169 s3:libsmb: move read_smb_send/recv() static in async_smb.c
metze
2009-05-13 18:27:50 +02:00
Stefan Metzmacher
ca6ec5ecd7 s3:libsmb: let cli_smb_chain_send() also return NTSTATUS
metze
2009-05-13 18:27:50 +02:00
Bo Yang
6ff09b323e s3:libsmb: return NT_STATUS_CONNECTION_INVALID if the fd is -1
This way we can destinguish between requests which failed
because the connection broke after they were triggered
and the requests which are started on an already broken
connection.

This also moves the check to cli_smb_req_iov_send()
where it really belongs.

metze
2009-05-13 18:27:41 +02:00
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