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

199 Commits

Author SHA1 Message Date
Stefan Metzmacher
d6e7a76461 s3:smb2_server: clear sequence window if we got the lowest sequence id
Otherwise we'll never consume sequence id '0'.

metze
2012-06-29 00:14:53 +02:00
Stefan Metzmacher
bd6d415cae s3:smb2_server: fix calculation of the next bitmap_offset
metze
2012-06-29 00:14:52 +02:00
Stefan Metzmacher
d1ee774ed0 s3:smb2_server: remove unused and confusing DEFAULT_SMB2_MAX_CREDIT_BITMAP_FACTOR
metze
2012-06-29 00:14:52 +02:00
Stefan Metzmacher
925994e42e s3:smb2_server: call smbd_smb2_request_validate() also in smbd_smb2_first_negprot()
We need to consume message_id 0, for SMB1 negprot starts.

metze
2012-06-29 00:14:51 +02:00
Stefan Metzmacher
0b8eac9b79 s3:smb2_server: start the connection with one credit granted to the client
metze
2012-06-29 00:14:51 +02:00
Stefan Metzmacher
d2e1058f42 s3:smb2_sesssetup: implement dynamic re-authentication and expire sessions
metze
2012-06-25 20:55:06 +02:00
Stefan Metzmacher
463b308f16 s3:smbd: make use of smbXsrv_tcon and smbXsrv_session for smb2
The removes the protocol specific smbd_smb2_session and
smbd_smb2_tcon.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

metze
2012-06-25 20:55:06 +02:00
Stefan Metzmacher
02d206ee64 s3:smb2_sesssetup: make use of the smbXsrv_session infrastructure
We still have smbd_smb2_session as primary structure,
but that will went away once we got rid of smbd_smb2_tcon.

metze
2012-06-25 20:55:06 +02:00
Stefan Metzmacher
8cca7b09ad s3:smb2_server: remember the request_time on an incoming request
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 15 09:17:33 CEST 2012 on sn-devel-104
2012-06-15 09:17:32 +02:00
Christian Ambach
a5ddc2da10 s3:smb2_server: fix a compiler warning
Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Mar 14 16:06:48 CET 2012 on sn-devel-104
2012-03-14 16:06:48 +01:00
Volker Lendecke
a28a740f58 s3: Fix a 64-bit warning
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar 10 15:27:09 CET 2012 on sn-devel-104
2012-03-10 15:27:09 +01:00
Jeremy Allison
97e1652125 Fix up Christian Ambach's multi-credit code - the CreditCharge field is a 16-bit int read, not a 32-bit one. 2012-03-09 16:48:16 -08:00
Christian Ambach
6e8e3c4613 s3:smb2_server validate message ids with largemtu
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:16 -08:00
Christian Ambach
eec5ece6f5 s3:smb2_server add function to verify creditcharge
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Christian Ambach
8b25bc80c9 s3:smb2_server fix a typo 2012-03-02 21:47:09 -08:00
Stefan Metzmacher
615c41ce12 libcli/smb/smb2_signing: pass down 'protocol' to smb2_signing_[sign|check]_pdu()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Feb 27 14:26:32 CET 2012 on sn-devel-104
2012-02-27 14:26:32 +01:00
Jeremy Allison
21528da9cd Fix a bunch of "unused variable" warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
2012-02-18 06:22:40 +01:00
Stefan Metzmacher
763fe4216b s3:smb2_server: use sconn->ev_ctx instead of sconn->smb2.event_ctx
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Dec 12 16:08:59 CET 2011 on sn-devel-104
2011-12-12 16:08:59 +01:00
Stefan Metzmacher
1ce9c0ea32 s3:smbd: remember the event context on smbd_server_connection
metze
2011-12-12 14:35:42 +01:00
Jeremy Allison
65566dfa86 Ensure we correctly calculate reply credits over all returned
SMB2 replies, and do as Windows does and return the total in the
last SMB2 reply. Fixes an issue found by Christian M Ambach <christian.ambach@de.ibm.com>
(and thanks to Christian for the initial patch this was based on).
2011-11-15 22:44:25 +01:00
Stefan Metzmacher
88dd90d928 s3:smb2_server: pass explicit defer_times to smbd_smb2_request_pending_queue()
metze
2011-11-15 17:14:13 +01:00
Stefan Metzmacher
693cb77b2f s3:smb2_server: always send STATUS_PENDING responses, but delayed by 0.5 milliseconds
In future we'll pass the delay from the caller.

metze
2011-11-15 17:14:13 +01:00
Stefan Metzmacher
ffbd1ed279 s3:smb2_server: grant credits in async interim responses (bug #8357)
The first fix for bug #8357 intruduced a regression, so that we no
longer grant credits for real async interim responses with
STATUS_PENDING.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov  9 11:56:29 CET 2011 on sn-devel-104
2011-11-09 11:56:29 +01:00
David Disseldorp
8fb9e087e3 s3:smb2_server: remove unused outhdr variables 2011-11-02 15:15:28 +01:00
Stefan Metzmacher
91648aeb64 s3:smb2_server: FLAG_CHAINED means we always use the last session_id and tid
metze
2011-10-31 19:39:02 +01:00
Stefan Metzmacher
8d07d7148b s3:smb2_server: don't reset the tid and session id in the out hdr of compound requests
Windows also leaves tid (0xFFFFFFFF) and session id (0xFFFFFFFFFFFFFFFF)
as the client requested them.

metze
2011-10-31 19:39:02 +01:00
Stefan Metzmacher
c7d3b6b2c3 s3:smb2_server: echo the SMB2_HDR_CREDIT_CHARGE and SMB2_HDR_SIGNATURE fields
Windows just echos back the given values by default.

metze
2011-10-31 19:39:02 +01:00
David Disseldorp
18482957da s3-smb2_server: SMB2_OP_IOCTL doesn't require at least 1 dyn byte
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-09-29 13:14:21 +02:00
Stefan Metzmacher
ea00f0e452 s3:smb2_server: SMB2_OP_CANCEL requests don't have to be signed
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Sep 29 02:58:41 CEST 2011 on sn-devel-104
2011-09-29 02:58:41 +02:00
Stefan Metzmacher
5494856294 s3:smbd: disconnect the socket if we got an unexpected request
If we got a SMB2_OP_NEGPROT after the protocol is already negotiated
or if we got a non SMB2_OP_NEGPROT before the protocol was negotiated
we should close the connection (as windows does).

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Sep 23 12:30:50 CEST 2011 on sn-devel-104
2011-09-23 12:30:50 +02:00
Stefan Metzmacher
02d83d8fd4 s3:smbd: don't call smbd_terminate_connection in smb2_validate_message_id() (bug #8476)
Only return false and the caller will terminate the connection.

metze
2011-09-23 11:00:04 +02:00
Jeremy Allison
d50fa9c21e Fix bug #8476 - Samba asserts when SMB2 client breaks the crediting rules.
Just drop the connection, not SMB_ASSERT.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Sep 22 19:41:31 CEST 2011 on sn-devel-104
2011-09-22 19:41:31 +02:00
Stefan Metzmacher
563fa741f6 s3:smb2_server: SMB2_OP_GETINFO doesn't require at least 1 dyn byte
metze
2011-09-14 15:53:36 +02:00
Stefan Metzmacher
6985a1378b s3:smb2_server: add smbd_smb2_request_verify_sizes()
metze
2011-09-07 10:38:02 +02:00
Jeremy Allison
786fe9fab2 Fix bug 8429 - Compound SMB2 requests on an IPC connection can corrupt the reply stream.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Aug 31 21:18:11 CEST 2011 on sn-devel-104
2011-08-31 21:18:11 +02:00
Jeremy Allison
726b4685aa Based on metze's fix for Bug 8407 - SMB2 server can return requests out-of-order when processing a compound request. (cherry picked from commit 19db1c98c6ba3cb5e883e16e865c44900ce17444) 2011-08-31 19:49:31 +02:00
Stefan Metzmacher
0d450d166b s3:smb2_server: keep compound_related on struct smbd_smb2_request
metze
(cherry picked from commit cda93f04eb4e7e975b192a5fd33275ec638140ac)
2011-08-31 19:49:31 +02:00
Stefan Metzmacher
42cde0480b s3:smb2_server: make sure we prefer responses over requests on the client socket
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug 12 16:46:43 CEST 2011 on sn-devel-104
2011-08-12 16:46:43 +02:00
Stefan Metzmacher
47bffb9b92 s3:smb2_server: make sure we grant credits on async read/write operations (bug #8357)
Currently we skip, the "gone async" interim response on read and write,
this caused the aio code path to grant 0 credits to the client
in the read/write responses.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Aug  7 22:23:57 CEST 2011 on sn-devel-104
2011-08-07 22:23:57 +02:00
Jeremy Allison
1d4d9194ab Secod part of bugfix for bug #8335 - file copy aborts with smb2_validate_message_id: bad message_id
Modify the credit granting algorithm to closer to what I believe
Windows does.

Split up max_credits into 1/16ths, and then scale
the requested credits by how many 16ths have been
currently granted. Less than 1/16th == grant all
requested (100%), scale down as more have been
granted. Never ask for less than 1 if the client
asked for at least 1.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul 29 20:37:42 CEST 2011 on sn-devel-104
2011-07-29 20:37:42 +02:00
Andrew Bartlett
128ae06a61 s3-auth use auth_user_info not netr_SamInfo3 in auth3_session_info
This makes auth3_session_info identical to auth_session_info

The logic to convert the info3 to a struct auth_user_info is
essentially moved up the stack from the named pipe proxy in
source3/rpc_server to create_local_token().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Jeremy Allison
fe3992541d Move smbd_smb2_request_check_tcon() smbd_smb2_request_check_session() next to their only user and make them static. Add comments.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul  8 21:01:40 CEST 2011 on sn-devel-104
2011-07-08 21:01:40 +02:00
Stefan Metzmacher
dbfb88aef3 s3:smb2_server: add some comments about change_to_user() and change_to_root_user()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul  8 13:45:46 CEST 2011 on sn-devel-104
2011-07-08 13:45:46 +02:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02:00
Jeremy Allison
8dc7029561 Fix bug #8293 - SMB2 doesn't rotate the log files often enough.
Move the num_requests field out of the smb1 struct into the generic
struct smbd_server_connection struct. Use it to count SMB2 requests
as well as SMB1 and ensure that check_log_size() is called every 50
SMB2 requests.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul  8 01:14:53 CEST 2011 on sn-devel-104
2011-07-08 01:14:53 +02:00
Stefan Metzmacher
eea210eba7 s3:smb2_server: call change_to_root_user() or smbd_smb2_request_check_tcon()
For all requests which don't operate on a tcon, we should call
change_to_root_user(), to match the SMB1 behavior.

For SMB1 we do the following operations without AS_USER:

/* 0x70 */ { "SMBtcon",reply_tcon,0},
/* 0x71 */ { "SMBtdis",reply_tdis,DO_CHDIR},
/* 0x72 */ { "SMBnegprot",reply_negprot,0},
/* 0x73 */ { "SMBsesssetupX",reply_sesssetup_and_X,0},
/* 0x74 */ { "SMBulogoffX",reply_ulogoffX, 0}, /* ulogoff doesn't give a valid TID */
/* 0x75 */ { "SMBtconX",reply_tcon_and_X,0},
...
/* 0x2b */ { "SMBecho",reply_echo,0},
...
/* 0xa4 */ { "SMBntcancel",reply_ntcancel, 0 },

For SMB2tdis we still call smbd_smb2_request_check_tcon()
as close_cnum() calls change_to_root_user() when needed.

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-07-07 14:17:17 -07:00
Stefan Metzmacher
7c96e96e98 s3:smb2_server: there's no reason to check the session id twice on a smb2_tcon request
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jul  4 17:34:13 CEST 2011 on sn-devel-104
2011-07-04 17:34:13 +02:00
Jeremy Allison
5882c75d40 Second part of fix for bug #8219 - SMB Panic from Windows 7 Client.
Pass in the correct vector to the signing algorithm in an async
response - we must start with vector[1] which has the SMB2_HDR_BODY
length, not vector[0] which is the 4 byte packet length. Also
note we're passing in 2 vectors not 3.

Metze please review.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun 29 20:09:21 CEST 2011 on sn-devel-104
2011-06-29 20:09:21 +02:00
Jeremy Allison
1fffddb238 Fix bug #8219 - SMB Panic from Windows 7 Client
Caused by referencing an uninitialized variable in the
duplicated struct smbd_smb2_request when sending a signed
intermediate reply.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun 29 04:37:28 CEST 2011 on sn-devel-104
2011-06-29 04:37:28 +02:00
Andrew Bartlett
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time
now, and removing this from dummmysmbd.c assists with library
dependencies.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Volker Lendecke
2b40899bd3 s3: Slightly simplify smbd_smb2_request_next_vector
Metze, Jeremy, please check!
2011-05-12 11:48:29 +02:00
Jeremy Allison
02af307585 More simple const fixes. 2011-05-05 23:56:07 +02:00
Volker Lendecke
82b9fa3a19 s3: Fix dup_smb2_vec3
Metze, Jeremy, please check!

Thanks,

Volker

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu May  5 13:39:40 CEST 2011 on sn-devel-104
2011-05-05 13:39:40 +02:00
Günther Deschner
50883cfeb4 s3-tevent: only include ../lib/util/tevent wrappers where needed.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
2011-04-29 14:00:30 +02:00
Günther Deschner
165521e20d s3: only include smb profiling where needed.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Apr 14 01:31:39 CEST 2011 on sn-devel-104
2011-04-14 01:31:39 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Jeremy Allison
eec50b21f6 Change "security=share" to downgrade to SMB1 from SMB2, rather than trying to fake it. 2011-01-27 15:26:47 -08:00
Volker Lendecke
d9204622e3 s3: Fix a C++ warning 2011-01-17 08:03:40 +01:00
Jeremy Allison
e8f7c60ec2 My algorithm for determining whan an incoming sequence number can be allowed is incorrect.
(I based it on the text in MS-SMB2, silly me :-). Fix it so incoming sequence numbers
can range over the entire allowable bitmap range. This fixes a repeatable
disconnect against Win7.

Jeremy.
2010-12-21 18:07:52 -08:00
Ken Harris
09aea03813 CREATE in a compound CREATE/NOTIFY sequence was being passed through set_operation_credits()
twice (ultimately perhaps because of bug 7331 involving this compound sequence and the need
to be ready for any incoming CANCEL of the NOTIFY). This had the server thinking it had
granted more credit than it actually had, which lead to zero-credits being granted in interim
NOTIFY responses.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Dec 20 20:59:55 CET 2010 on sn-devel-104
2010-12-20 20:59:55 +01:00
Jeremy Allison
a8eed184a0 Implement "use sendfile = yes" for SMB2. (cherry picked from commit 95cb7adcd03a1abbd0af395b6c96dd8e0eebd3d1)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Dec 15 02:24:08 CET 2010 on sn-devel-104
2010-12-15 02:24:08 +01:00
Jeremy Allison
f974e68213 Change crediting so that the credits are returned on the interim async response.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Dec 14 01:09:05 CET 2010 on sn-devel-104
2010-12-14 01:09:05 +01:00
Jeremy Allison
6ce365b238 We need to start off with smb2.credits_granted == 0. That way
when processing the faked up SMB2 NegProt from the SMB1 packet we
always allocate one credit on reply.

Jeremy.
2010-12-13 13:34:50 -08:00
Jeremy Allison
27a47eb9fc Remove extra unused credit arg. to smbd_smb2_request_setup_out() 2010-12-13 13:20:05 -08:00
Jeremy Allison
2ac579ca76 Add a SMB2 crediting algorithm, by default the same as Windows. Defaults to 128 credits.
Jeremy.
2010-12-10 15:46:41 -08:00
Volker Lendecke
1d3bd5b1c0 s3: Fix some uninitialized variable warnings 2010-08-30 15:57:14 +02:00
Jeremy Allison
04f021e692 Fix bug #7653 - When SMB2 is on, Windows 7 clients can not connect as guest to a share.
Fix "security = share" with SMB2 by mapping internally
to "security = user" and "map to guest = Bad User".

Jeremy.
2010-08-27 15:25:04 -07:00
Volker Lendecke
50b3ee57e2 s3: Remove smbd_server_fd from smbd_initialize_smb2 2010-08-16 22:39:17 +02:00
Ira Cooper
c0aa55d550 s3: Cleanup of the initial SMB2 counters patch.
This reorganizes smbd_smb2_request_dispatch to have a central exit point,
and use the normal profiling macros.

Signed-off-by: Jeremy Allison <jra@samba.org>
2010-07-09 16:29:39 -07:00
Ira Cooper
90b1a1d296 s3: Add SMB2 performance counters.
A performance counter was added for every base type of SMB2 op.
2010-07-07 18:06:59 -07:00
Jeremy Allison
dd2fad01fd SMB2 correctness fix. As we've already returned the credits in an interim
response, don't add more in the final return.

Jeremy.
2010-06-14 16:58:15 -07:00
Jeremy Allison
edd8940e18 Ensure we correctly setup req->subreq before testing for async. Stops crashes when
XX_send functions set async to stop interim replies being sent.

Jeremy.
2010-06-10 13:19:25 -07:00
Jeremy Allison
0c5d0e1c37 Second part of fix for 7501 - SMB2: CREATE request replies getting mangled.
Based on code from Ira Cooper <samba@ira.wakeful.net>, and also
advice on refactoring the patch into a function call. outbuf vectors
can be reallocated by smb2 processing code, so when returning interim
responses we must not make assumptions about vector size.

Jeremy
2010-06-08 17:44:05 -07:00
Ira Cooper
fd9e02d5f3 Fix for bug 7501 - SMB2: CREATE request replies getting mangled.
Code for dup_smb2_req() was duplicating the wrong vector (i, instead
of i+2) when returning a non-minimal SMB2 response.
2010-06-08 11:20:23 -07:00
Jeremy Allison
cb1590e410 Ensure we remove SMB2 cancel requests from the active queue
now we don't remove them in the talloc destructor.

Jeremy.
2010-06-02 16:57:08 -07:00
Jeremy Allison
53e4650622 Fix a crash bug found by Ira Cooper <samba@ira.wakeful.net>.
A create call comes in, goes async (on the oplock request).
At a later time (just before a cancel request is received)
it completes, and goes through smbd_smb2_request_reply() to
send the reply to the create call.

However, the output socket queue is full, so when
tstream_writev_queue_send() is called from smbd_smb2_request_reply(),
the smb2req stays on the "being processed" queue on
sconn->smb2.requests, as only when tstream_writev_queue_send() completes
is smbd_smb2_request_writev_done() get called, which will TALLOC_FREE
the smb2req (and thus take if off the queue).

The cancel comes in, gets processed and looks through the
requests on the queue, and BANG - hits the smb2req that
has already been processed and is outgoing....

Remove the request from the queue once
tstream_writev_queue_send() is called and not in the talloc
destructor function.

Jeremy.
2010-06-02 16:43:31 -07:00
Jeremy Allison
af44593555 (Finally) fix bug #7158 - SMB2 connection resets during IOZone tests from 64-bit Vista client
It turns out that the persistent handles are used by the Microsoft
redirector to index files on oplock break requests. So even if we
don't do durable handles (yet) we must set the persistent handle
on create. For now just use the same handle value as we use for
volatile.

Jeremy.
2010-05-19 19:28:26 -07:00
Jeremy Allison
c7982074a7 Keep track of credits we're giving out. Set initial credits to 1 (MS-SMB2 spec required).
Jeremy.
2010-05-18 17:11:54 -07:00
Jeremy Allison
4ad1943d29 Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them next :-).
Jeremy.
2010-05-07 01:20:26 -07:00
Jeremy Allison
4e7195be36 Update (C) for 2010.
Jeremy.
2010-04-28 14:56:12 -07:00
Jeremy Allison
f11a5d196d Don't return an intermediate reply on async on a pipe call (Windows doesn't).
Jeremy.
2010-04-27 16:07:12 -07:00
Jeremy Allison
a796542a93 Implement oplocks within SMB2. Plumb into the existing SMB1 oplock system.
Seems to work but needs more tests (to be added).

Jeremy.
2010-04-24 00:29:41 -07:00
Jeremy Allison
247273196f When sending the initial async response, this is never part of a chain.
Get the reply flags correct.

Jeremy.
2010-04-23 15:35:34 -07:00
Jeremy Allison
8f67f873ac Make deferred opens (NT_STATUS_SHARING_VIOLATION) work over SMB2.
Makes SMB2Create call re-entrant internally.
Now this infrastructure is in place, oplocks will follow shortly.
Tested with Win7 client and with W2K8R2.

Jeremy.
2010-04-22 23:52:19 -07:00
Jeremy Allison
60d3692918 Now SMB2 error messages are correctly being returned with the 1 byte data area, smbd_smb2_request_error_ex() must call smbd_smb2_request_done_ex() in order to do the padding correctly on compound replies.
Jeremy.
2010-04-19 14:35:46 -07:00
Jeremy Allison
8bf7942fa4 Ensure vectors are always allocated with consistent size. Removes one byte alloc on SMB2 error packet. Always use talloc_zero_array on out vectors - fixes valgrind errors in tevent writes.
Jeremy.
2010-04-19 14:35:39 -07:00
Jeremy Allison
cea24c4620 Remove an unused auto variable.
Jeremy.
2010-04-19 11:38:49 -07:00
Günther Deschner
0b2e5debb0 s3-smb2: fix some c++ warnings.
Guenther
2010-04-19 11:54:00 +02:00
Jeremy Allison
59fa1e1890 Final fix for #7331 - Compound async SMB 2 requests don't work right.
Don't free the cancelled SMB2 req early, let the cancelation
function take care of it. Return a NT_STATUS_CANCELLED when
we find and cancel a request. Fix our SMB2 error returns to
correctly set the structuresize to 9, and add the expected
zero byte (see section 2.2.2 in the SMB2 spec.).

This causes Samba to pass the test program in this bug report
that W2K8R2 fails (heh heh :-). This is because we always cause
compound requests to get to a cancelation point before dealing
with a cancel request.

Jeremy.
2010-04-18 20:23:54 -07:00
Jeremy Allison
1aa80f5788 Second part of fix for bug #7331 - Compound async SMB 2 requests don't work right.
Cause us to match W2K8R2 by sending an interim compound reply
followed by a async reply.

Jeremy.
2010-04-17 22:42:23 -07:00
Jeremy Allison
bf45b4f4fd First part of fix for bug #7331 - Compound async SMB 2 requests don't work right.
Gets us handling SMB2 compound async requests similar to W2K8R2
(and triggers the same client bug in the Win7 redirector). Great
thanks to Ira Cooper <samba@ira.wakeful.net> for helping with
this and to Metze for the wonderful async framework. The one
thing I need to fix to make us identical to W2K8R2 is that
when a compound request goes async at the end W2K8R2 splits
the replies up into a compound non-async reply followed by
a separate async reply. Currently we're doing the whole thing
in a compound reply.

Jeremy.
2010-04-17 21:20:17 -07:00
Jeremy Allison
146c1618e4 Don't forget to initialize *p_creds_requested.
Jeremy.
2010-04-07 10:31:43 -07:00
Jeremy Allison
3d113a6ffb Ensure we total up the correct number of creds requested in a compound request. 2010-04-06 16:31:26 -07:00
Jeremy Allison
6800fdbb81 Make smbd_lock_socket/smbd_unlock_socket recursive with a ref_count.
As these always call exit_server, make that part of the function.
Use _internal functions for the echo client.

Metze please check !

Jeremy.
2010-03-31 17:40:30 -07:00
Jeremy Allison
26891651ec Change the credential handling so that we start with maxmux creds,
and then return to the client the number of credits per operation
that they asked for. This is a more sensible algorithm than just
blindly returning "20" on every reply, although we will probably
still need more changes to this going forward.
Jeremy.
2010-02-24 16:16:30 -08:00
Stefan Metzmacher
d60f049eaf s3:smbd: implement SMB2 Cancel correctly.
metze
2009-08-17 09:25:45 +02:00
Stefan Metzmacher
168a7cb6a8 s3:smbd: allow SMB2 Cancel to have the async flag set
metze
2009-08-14 13:27:50 +02:00
Stefan Metzmacher
86ea1c4d24 s3:smbd: fix parsing of the SMB2 body
Maybe there's no dynamic part on the wire.

metze
2009-08-14 13:27:49 +02:00
Stefan Metzmacher
1df883aa39 libcli: move some common SMB and SMB2 stuff into libcli/smb/
This will hold code that's shared between source3 and source4.

metze
2009-08-12 18:28:32 +02:00