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

76078 Commits

Author SHA1 Message Date
Stefan Metzmacher
abca5f17c3 s3:libsmb: detect lock_read and write_unlock support
metze
2011-09-15 12:12:25 +02:00
Stefan Metzmacher
14e8ef14a0 s3:libsmb: move cli->*braw_supported to cli->conn.smb1.server.*braw
This is currently unused, but we might use it in future.

metze
2011-09-15 12:12:25 +02:00
Stefan Metzmacher
596aa96d17 s3:libsmb: move cli->sec_mode to cli->conn.smb1.server.security_mode
metze
2011-09-15 12:12:24 +02:00
Stefan Metzmacher
8f44105cc4 s3:libsmb: move cli->max_mux to cli->conn.smb1.server.max_mux
metze
2011-09-15 12:12:24 +02:00
Stefan Metzmacher
768581eee5 s3:libsmb: move cli->max_xmit to cli->conn.smb1.max_xmit
And keep cli->conn.smb1.client.max_xmit and
cli->conn.smb1.server.max_xmit.

metze
2011-09-15 12:12:24 +02:00
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
d727fcc867 libcli/auth: add some const to SMBNTencrypt_hash() and SMBNTencrypt()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep 14 19:49:24 CEST 2011 on sn-devel-104
2011-09-14 19:49:24 +02:00
Stefan Metzmacher
5879358437 s4:wrepl_server: return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:19 +02:00
Stefan Metzmacher
e6a2affe89 s4:libcli/wrepl: return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:19 +02:00
Stefan Metzmacher
af2e107d49 s4:lib/messaging: let irpc 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
afabf12251 s4:librpc/rpc: return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:18 +02: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
Rusty Russell
cb064f28f9 tdb2: remove bogus leftover .orig file.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Sep 14 06:06:41 CEST 2011 on sn-devel-104
2011-09-14 06:06:41 +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
84a4289b52 tdb_compat: change offset of CLEAR_IF_FIRST lock.
This makes it match tdb1, which mean it will Just Work as TDB2 gets
tdb1 format support.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Sep 14 02:21:29 CEST 2011 on sn-devel-104
2011-09-14 02:21:29 +02:00
Rusty Russell
72c4074c65 tdb_compat: support tdb_reopen/tdb_reopen_all for TDB2
This matters with the clear-if-first support: we need to re-establish
those locks at this point.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 08:13:28 +09:30
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