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

38410 Commits

Author SHA1 Message Date
Stefan Metzmacher
b02d27ae05 s3:libsmb: move cli->smb1.mid to cli->conn.smb1.mid
metze
2011-09-15 12:12:23 +02:00
Stefan Metzmacher
595f0020d4 s3:libsmb: move cli->capabilities to cli->conn.smb1.capabilities
And keep cli->conn.smb1.client.capabilities and
cli->conn.smb1.server_capabilities.

metze
2011-09-15 12:12:23 +02:00
Stefan Metzmacher
74a581afe5 s3:libsmb: move cli->protocol to cli->conn.protocol
metze
2011-09-15 12:12:22 +02:00
Stefan Metzmacher
17c6e0abae s3:libsmb: don't set cli->protocol in cli_state_create()
This is done in cli_negprot_done(), when we know the protocol.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Sep 15 11:57:18 CEST 2011 on sn-devel-104
2011-09-15 11:57:17 +02:00
Stefan Metzmacher
3f00cce9b3 s3:libsmb: pass max_protocol to cli_negprot()
metze
2011-09-15 10:25:17 +02:00
Stefan Metzmacher
4f7be46d99 s3:libsmb: add basic max_protocol support in cli_negprot()
metze
2011-09-15 10:25:17 +02:00
Stefan Metzmacher
7f40b606c4 s3:libsmb: use local variables in cli_state_create()
We don't need to keep use_spnego, use_level_II_oplocks, force_dos_errors
and force_ascii within struct cli_state.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Sep 15 10:12:17 CEST 2011 on sn-devel-104
2011-09-15 10:12:17 +02:00
Stefan Metzmacher
74a6fb349f s3:libsmb: use CAP_EXTENDED_SECURITY instead of cli->use_spnego
cli->capabilities contains the negotiated capabilities.

metze
2011-09-15 08:33:13 +02:00
Stefan Metzmacher
dd836aac9d s3:libsmb: make use of SMB_CAP_BOTH/CLIENT_MASK in cli_session_setup_capabilities()
This matches a w2k3 client.

metze
2011-09-15 08:33:13 +02:00
Stefan Metzmacher
1d8bdab1c4 s3:libsmb: calculate the negotiated SMB1 capabilities in cli_negprot_done()
We calculate the negotiated capabilities based on the mask for:
 - client only flags
 - flags used in both directions
 - server only flags

metze
2011-09-15 08:33:13 +02:00
Stefan Metzmacher
a8836cae91 s3:include: add some masks for SMB1 CAP_* flags
The flags are devided into 3 sections:
- client only flags
- flags used in both directions
- server only flags

metze
2011-09-15 08:33:12 +02:00
Stefan Metzmacher
91cba0235f s3:libsmb: calculate all SMB1 capabilities we want to support for the connection
We should do this at startup in cli_state_create()
and later calculate the negotiated capabilities in
cli_negprot_done().

metze
2011-09-15 08:33:12 +02:00
Stefan Metzmacher
3162d86528 s3:libsmb: no need to reset capabilities in cli_session_setup_lanman2()
This is only used cli->protocol < PROTOCOL_NT1, in which case
cli_negprot_done() has already reset cli->capabilities.

metze
2011-09-15 08:33:12 +02:00
Stefan Metzmacher
d87ef021ab s3:libsmb: make sure we always set cli->capabilities at the end of cli_negprot_done()
If the server doesn't support PROTOCOL_NT1 we should reset the negotiated
capabilities to 0.

metze
2011-09-15 08:33:11 +02:00
Richard Sharpe
7982819f61 Add a missing include file to two VFS modules
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Sep 15 02:56:36 CEST 2011 on sn-devel-104
2011-09-15 02:56:36 +02:00
Jeremy Allison
cc6f0231c9 Finish commit 8745c70d by Michael Adam.
If you're going to move winbindd_cache.tdb to the state_path, do it *everywhere*.

Found by Ira Cooper <ira@wakeful.net>.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Sep 15 00:43:04 CEST 2011 on sn-devel-104
2011-09-15 00:43:04 +02:00
Stefan Metzmacher
ff52be06e5 s3:libsmb: remove unused cli->is_samba
s3:libsmb: remove unused cli->is_samba

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 13:12:52 -07:00
Stefan Metzmacher
3c6808d5ed s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes
s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 13:12:16 -07:00
Stefan Metzmacher
73cc454af0 s3:client.h: remove unused defines
s3:client.h: remove unused defines

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 13:10:45 -07:00
Stefan Metzmacher
6626c836f3 s3:libsmb: let cli_write_max_bufsize() return the max number of possible bytes
s3:libsmb: let cli_write_max_bufsize() return the max number of possible bytes

We now return what's possible on the wire.

Which is 0x1FFFF - data_offset if CAP_LARGE_WRITEX is given by
the server (without signing) or 0xFFFFFF - data_offset
if CIFS_UNIX_LARGE_READ_CAP is available (without signing/sealing).
Otherwise we return max_xmit - data_offset.

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 13:09:36 -07:00
Stefan Metzmacher
4c9b1841ed s3:libsmb: let cli_read_max_bufsize() return the max number of possible bytes
s3:libsmb: let cli_read_max_bufsize() return the max number of possible bytes

We now return what's possible on the wire.

Which is 0xFFFF if CAP_LARGE_READX is given by the server
or 0xFFFFFF - data_offset if CIFS_UNIX_LARGE_READ_CAP
is available (without signing/sealing). Otherwise we return
max_xmit - data_offset.

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 12:57:33 -07:00
Stefan Metzmacher
f8c26c16b8 s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients.
Windows 2008 R2 (and others) ignore the high bits for the read size.

Unless we're using the unix extentions and the client
uses CIFS_UNIX_LARGE_READ_CAP, we should also ignore
the high bits.

But we still need to support old "smbclient" binaries
and have to check if the client is "Samba".

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 12:37:02 -07:00
Stefan Metzmacher
555c626af8 s3:smbd: remember the client unix capabilities on the connection
metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-09-14 12:37:02 -07:00
Jeremy Allison
f261ac1932 Fix bug #8453 - smbclient segfaults when dialect option -m is used for legacy dialects
Ensure we have valid pointers.
2011-09-14 11:59:22 -07:00
Stefan Metzmacher
cd02281c2d s3:winbindd: let wbint handles return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:18 +02:00
Stefan Metzmacher
8602e8a536 s3:rpc_server: let rpcint handles return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:17 +02:00
Stefan Metzmacher
cc5f973884 s3:rpc_client: return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places
and don't mix NT_STATUS_INVALID_CONNECTION and NT_STATUS_CONNECTION_INVALID.

metze
2011-09-14 18:03:17 +02:00
Stefan Metzmacher
a6e8167e4a s3:libsmb: return NT_STATUS_CONNECTION_DISCONNECTED instead of NT_STATUS_CONNECTION_INVALID
We should return the same in all places.

metze
2011-09-14 18:03:17 +02:00
Stefan Metzmacher
e80f79a1fb s3:torture/run_oplock4: don't set cli->use_level_II_oplocks
Doing this after the session setup is pointless,
as that's the only place where we tell the server we support
level II oplocks.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep 14 17:23:46 CEST 2011 on sn-devel-104
2011-09-14 17:23:46 +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
Günther Deschner
af7653c034 s3-libnet: add missing newlines in debug statement.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Sep 14 15:52:10 CEST 2011 on sn-devel-104
2011-09-14 15:52:10 +02:00
Stefan Metzmacher
abb24bf8e8 s3:smbd: make use of better SMB signing negotiation
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep 14 09:41:02 CEST 2011 on sn-devel-104
2011-09-14 09:41:02 +02:00
Stefan Metzmacher
c682472fdf s3:libsmb: make use of new advanded SMB signing
metze
2011-09-14 08:09:15 +02:00
Stefan Metzmacher
0a6d0f8eda s3:smb_signing: add support for easier negotiation of SMB signing
We don't make use of it yet, but it will follow.

metze
2011-09-14 08:09:15 +02:00
Stefan Metzmacher
f205e4cada s3:smbd: echo FLAGS2_SMB_SECURITY_SIGNATURES* and the signature field in the reply
This matches what windows is doing.

metze
2011-09-14 08:09:15 +02:00
Jeremy Allison
fbbfdbd648 Fix bug #8229 - git patch attached against 3.6.0-rc2 to fix 'widelinks' regression intro'd in 3.2
Add "allow insecure widelinks" to re-enable the ability (requested
by some sites) to have "widelinks = yes" and "unix extensions = yes".

Based on an original patch by Linda Walsh <samba@tlinx.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Sep 14 03:55:45 CEST 2011 on sn-devel-104
2011-09-14 03:55:45 +02:00
Rusty Russell
26ce47ecc0 util_tdb: return -1/0 from lock_with_timeout functions.
Keeps the tdb2 API change (which returns error codes, rather than -1)
localized.  The function returns -1 down the other path, so make it
consistent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 08:13:28 +09:30
Rusty Russell
5e0f62c3c2 dbwrap_tdb: handle tdb2 return values properly.
TDB2 versions of tdb_parse_record etc return an error code, not -1.
Turn those into -1/0 in dbwrap_tdb to insulate the rest of the code
from that change.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 08:13:28 +09:30
Rusty Russell
376511ed4d tdb_compat: adapt to tdb2 API change.
Add the ecode arg to all the log functions, and log it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 07:13:13 +09:30
Stefan Metzmacher
a26fe036fe s3:smb2cli: split cli->smb2.gss_blob from cli->secblob
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Sep 13 23:34:13 CEST 2011 on sn-devel-104
2011-09-13 23:34:13 +02:00
Stefan Metzmacher
15179852ea s3:net_time: make use of cli_state_server_time_zone() and cli_state_server_time()
metze
2011-09-13 21:53:08 +02:00
Stefan Metzmacher
7ba2bc35a3 s3:libsmb: make use of cli_state_server_time_zone()
metze
2011-09-13 21:53:07 +02:00
Stefan Metzmacher
d62f1e1e19 s3:libsmb: add cli_state_server_time()
metze
2011-09-13 21:53:07 +02:00
Stefan Metzmacher
4154b374d6 s3:libsmb: add cli_state_server_time_zone()
metze
2011-09-13 20:50:16 +02:00
Stefan Metzmacher
43976bdece s3:libsmb: make use of cli_state_server_session_key()
metze
2011-09-13 20:49:27 +02:00
Stefan Metzmacher
7ec961d987 s3:libsmb: add cli_state_server_session_key()
metze
2011-09-13 20:49:27 +02:00
Stefan Metzmacher
fa5475ea9e s3:libsmb: make use of cli_state_security_mode()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Sep 13 19:45:01 CEST 2011 on sn-devel-104
2011-09-13 19:45:01 +02:00
Stefan Metzmacher
faab79e28e s3:winbindd_cm: make use of cli_state_security_mode()
metze
2011-09-13 18:12:23 +02:00
Stefan Metzmacher
9a855dd5d9 s3:auth_server: make use of cli_state_security_mode()
metze
2011-09-13 18:12:23 +02:00
Stefan Metzmacher
fbd5cb5835 s3:libsmb: add cli_state_security_mode()
metze
2011-09-13 18:12:23 +02:00