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

63 Commits

Author SHA1 Message Date
Volker Lendecke
53486f00e9 smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-02-26 03:02:07 +01:00
Jeremy Allison
eb05766a8c Revert "s3: smbd: signing. Ensure we respond correctly to an SMB2 negprot with SMB2_NEGOTIATE_SIGNING_REQUIRED."
Even though the MS-SMB2 spec says so, Windows doesn't behave
like this.

This reverts commit 1cea6e5b6f.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
2015-02-23 22:32:48 +01:00
Jeremy Allison
1cea6e5b6f s3: smbd: signing. Ensure we respond correctly to an SMB2 negprot with SMB2_NEGOTIATE_SIGNING_REQUIRED.
Bug 11103:  - Samba does not set the required flags in the SMB2/SMB3 Negotiate Protocol Response when signing required by client

https://bugzilla.samba.org/show_bug.cgi?id=11103

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <smfrench@gmail.com>
2015-02-19 20:42:07 +01:00
Jeremy Allison
556bf2ee00 s3:smb2_negprot: announce support for SMB2.1 leases.
We only do this with "smb2 leases = yes"
and the default values for "oplocks = yes"
and "kernel oplocks = no".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-12-04 05:45:10 +01:00
Stefan Metzmacher
b4604590b0 s3:smb2_negprot: remember xconn->smb2.server.cipher
For now we always use SMB2_ENCRYPTION_AES128_CCM or 0.
0 is the indication that we don't support encryption on the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-16 19:30:04 +02:00
Stefan Metzmacher
760f23a8e2 s3:smb2_negprot: allow really large io sizes up to allmost 16MB
The default is still 8MB (as on Windows 2012 *).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Michael Adam
d7d70c0d3c smbd:smb2: improve smbd_smb2_protocol_dialect_match(), removing code duplication
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-09-27 10:17:05 +02:00
Stefan Metzmacher
e9fb54c1ec s3:smbd: pass smbXsrv_connection to negprot_spnego()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
888ddd171a s3:smb2_negprot: remove NBT_HDR_SIZE from smbd_smb2_first_negprot()
This will simplify future features like multi-channel and rdma.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
c9e171ff72 s3:smb2_*: make use of smb2req->xconn where possible
We need to use the connection that is used by the current request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
3a622c785c s3:smb2_server: pass smbXsrv_connection to smbd_smb2_first_negprot()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:12 +02:00
Stefan Metzmacher
36e3484260 s3:smb2_server: move sconn->smb2.*credits* to xconn->smb2.credits.*
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
4f3f889dcd s3:smb2_negprot: remove unused variable 'conn' we already have 'xconn'...
We don't need two helper variables for the same thing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
e79b011434 s3:smb2_server: use xconn->smb2.server.max_* instead of sconn->smb2.max_*
We don't need this twice...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
ce76a40956 s3:smb2_server: move sconn->smb2.negprot_2ff to xconn->smb2.allow_2ff
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
1000e424fc s3:smb2_negprot: allow "smb max {read,write,trans}" up to 8MiB
This matches Windows 2012R2.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-11 02:32:08 +02:00
Ira Cooper
6221937aca s3: Refactor smbd_smb2_request_process_negprot
Breakout smb2_protocol_dialect_match to support future work in
fsctl_validate_neg_info.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-06-23 11:59:10 +02:00
Stefan Metzmacher
59c185bf54 s3:smb2_negprot: make use of smbd_smb2_generate_outbody()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-05 13:59:22 -08:00
Garming Sam
fc111c7875 param: rename lp function and variable from "srv_minprotocol" to "server_min_protocol"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:15 -08:00
Garming Sam
64dc4b59f8 param: rename lp function and variable from "srv_maxprotocol" to "server_max_protocol"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:15 -08:00
Stefan Metzmacher
5d721de7fd s3:smb2_negprot: set the 'remote_proto' value
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 09:11:20 +01:00
Jeremy Allison
49a335731a Revert "Fix bug #9222 - smbd ignores the "server signing = no" setting for SMB2."
This reverts commit dfd3c31a3f.

As Metze pointed out:

From MS-SMB2 section 2.2.4:

SMB2_NEGOTIATE_SIGNING_ENABLED

When set, indicates that security signatures are enabled
on the server. The server MUST set this bit, and the client MUST return
STATUS_INVALID_NETWORK_RESPONSE if the flag is missing.

I'll submit a documentation bug to fix #9222 that way.
2012-10-03 12:50:42 -07:00
Jeremy Allison
dfd3c31a3f Fix bug #9222 - smbd ignores the "server signing = no" setting for SMB2.
Still sign if client request is signed, just don't negotiate it in
negprot or sessionsetup.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct  3 00:59:42 CEST 2012 on sn-devel-104
2012-10-03 00:59:42 +02:00
Volker Lendecke
e0de443af8 s3: Slightly simplify smbd_smb2_request_process_negprot
Remove a nested if-statement
2012-09-25 22:41:51 +02:00
Stefan Metzmacher
45471f4d8f s3:smb2_negprot: annouce/negotiate SMB3 encryption support
metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
e9a21e5c8b s3:smb2_negprot: make use of SMBD_SMB2_* macros
metze
2012-08-05 20:55:39 +02:00
Stefan Metzmacher
a67daa3aa6 s3:smb2_negprot: return the current system time in the SMB2 NEGPROT response
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 26 11:56:02 CEST 2012 on sn-devel-104
2012-07-26 11:56:02 +02:00
Stefan Metzmacher
5b7f5d02b5 s3:smb2_negprot: support SMB2_CAP_LARGE_MTU on everything but port 139
In future we'll have other transports like RDMA.
This makes NBT (tcp port 139) special instead of port 445.

metze
2012-06-29 00:14:56 +02:00
Jeremy Allison
6cef2a613c Fix warning: variable ‘in_start_time’ set but not used. 2012-06-19 10:27:23 -07:00
Stefan Metzmacher
b3235d483d s3:smbd: introduce struct smbXsrv_connection
This will represent a transport connection for SMB 1 or 2
in the server. smbd_server_connection will slowly be moved
to the SMB_VFS layer to satisfy the existing modules,
but it will hopefully be protocol independend in future.

metze
2012-05-12 01:01:34 +02:00
Stefan Metzmacher
c8a3c0e0f7 s3:smb2_negprot: setup the protocol at the end of the negprot with a real dialect
metze
2012-05-12 01:01:34 +02:00
Stefan Metzmacher
1512ec7772 s3:smb2_negprot: add support for PROTOCOL_SMB3_00
metze
2012-05-06 14:50:39 +02:00
Jeremy Allison
981e9776f8 Ensure the right tsocket.h is included.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Mar 10 03:47:04 CET 2012 on sn-devel-104
2012-03-10 03:47:04 +01:00
Christian Ambach
bd0ad2bbb5 s3:smb2_server: announce LargeMTU for SMB2.1
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Christian Ambach
880f64b556 s3:smb2_server use the correct variables for max read/write
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Andrew Bartlett
c318c94170 s3-param: Align lp_{max,min}protocol with lib/param names
This adds an alisas to ensure that both our loadparm systems know all
the names.

I would like to move to the 'server ..' name as canonical, and this
will be raised on the list.

Andrew Bartlett
2012-02-27 07:36:05 +01:00
Stefan Metzmacher
460fc521cf s3:smb2_negprot: add support for PROTOCOL_SMB2_24
metze
2011-12-22 15:58:45 +01:00
Stefan Metzmacher
005798fa0b s3:smb2_negprot: add support for SMB2_22
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Nov 20 16:46:45 CET 2011 on sn-devel-104
2011-11-20 16:46:45 +01:00
Stefan Metzmacher
caa134672c s3:smbd: make use of SMB_SIGNING_* constants
metze
2011-11-03 16:55:13 +01:00
Stefan Metzmacher
40ea66c5dd s3:smb2_server: remember the max_{trans,read,write} sizes we negotiated (bug #8473)
We should enforce the negotiated max sizes instead of the
lp_smb2_max_*() sizes.

metze
2011-10-13 01:59:05 +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
7ec3a35d2a s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_negprot.c
metze
2011-09-07 10:38:03 +02:00
Stefan Metzmacher
012c9d06a9 s3:smb2_server: add basic support for SMB 2.1
This adds support for the 2 stage negprot, from SMB 1 to SMB 2.1.

Support for this of for now and "max protocol = SMB2" still maps
to "max protocol = SMB2_02" PROTOCOL_SMB2_02.

In order to activate smb2.1, you need to use "max protocol = SMB2_10".

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Sep  5 19:30:58 CEST 2011 on sn-devel-104
2011-09-05 19:30:58 +02:00
Stefan Metzmacher
1c8e8c7e7b s3:smb2_server: return NOT_SUPPORTED if we don't find a common dialect with the client
metze
2011-09-05 18:01:07 +02:00
Stefan Metzmacher
e603929b98 s3:smb2_server: max_trans, max_read and max_write are limited to 64 kilobytes
Only if SMB2_CAP_LARGE_MTU is supported we should announce larger limits.

metze
2011-09-05 18:01:07 +02:00
Stefan Metzmacher
aca920b27c s3:smbd: use PROTOCOL_SMB2_02 instead PROTOCOL_SMB2
metze
2011-07-12 08:18:00 +02:00
Volker Lendecke
c981d4fa12 s3: Safely mark our sconn as smb2 if we have that protocol
Otherwise smbd will crash at an unclean exit. Without this conn_close_all will
do a close_cnum() on all connection_struct's. In smb2, those are talloc
children of the smbd_smb2_tcon's. sconn is talloc_free'ed after the
conn_close_all, but the smbd_smb2_tcon destructor will still reference
tcon->compat_conn, referencing then free'ed (and null'ed out) memory.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon May 30 22:49:53 CEST 2011 on sn-devel-104
2011-05-30 22:49:53 +02:00
Volker Lendecke
1c407da7c3 s3: Fix a typo
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu May  5 16:10:35 CEST 2011 on sn-devel-104
2011-05-05 16:10:35 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Jeremy Allison
8cba4a0c96 Move the addition of the 16 byte guid out of spnego_gen_negTokenInit() and
into negprot_spnego() where it belongs (it's not an SPNEGO operation).
Add a TALLOC_CTX for callers of negprot_spnego(). Closer to unifying all
the gen_negTokenXXX calls.

Jeremy.
2010-07-19 16:45:16 -07:00