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

98746 Commits

Author SHA1 Message Date
Richard Sharpe
1ef68eb680 Convert all uint32/16/8 to _t in source3/rpcclient.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-12 01:32:12 +02:00
Richard Sharpe
1e77678648 Convert all uses of uint32/16/8 to _t in source3/torture.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-12 01:32:12 +02:00
Richard Sharpe
250df86ac0 Change all uses of uint32 to uint32_t in vfs.h. This is part of a general cleanup if people approve. This time around get both vfs.h and vfs.c and all instances of uint8, uint16 and uint32.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-12 01:32:12 +02:00
Amitay Isaacs
9b6865475e ctdb-daemon: Remove obsolete IPv4 only controls
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-12 01:32:11 +02:00
Amitay Isaacs
4f4e6ebace ctdb-daemon: Remove older data structure that supports only IPv4 addresses
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-12 01:32:11 +02:00
Martin Schwenke
c75f297ac3 ctdb-daemon: Fix typo in debug message
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sun May 10 06:10:21 CEST 2015 on sn-devel-104
2015-05-10 06:10:21 +02:00
Martin Schwenke
d30b529ccc ctdb-daemon: Initialise eventscript status earlier
Don't initialise it after ctdb_event_script_callback_v() may have
short-circuited.  This can stop ctdb_event_script_args() from ever
terminating.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:14 +02:00
Martin Schwenke
070964dbcf ctdb-daemon: Make ctdb_event_script_args() terminate if no scripts
status.done is never set to true unless event_script_callback() is
invoked.  The short-circuit in ctdb_event_script_callback_v() means
that this doesn't happen.  CTDB can't work very well without 00.ctdb
(for tunable initialisation and the like) but it shouldn't get stuck.

So call the callback when there are no scripts in
event_script_callback().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:14 +02:00
Martin Schwenke
6808b0aa6a ctdb-daemon: Drop interface monitoring
This is done by 10.interace where the monitor event fails when there
is a missing interface.  The in-daemon interface checking adds no
value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:14 +02:00
Martin Schwenke
a2c64a4810 ctdb-common: Reimplement external tracing using ctdb_set_helper()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
c927ec928c ctdb-scripts: Drop update of public address configuration from config.tdb
This isn't used or documented anywhere.

2 differing points of view:

* This is a very good idea but it should probably be generalised to
  cover more configuration items.  This would end up like the Samba
  registry configuration and would use a tool to support setting
  configuration values.

* If people really want to update configuration while a node is down
  then they should fix the configuration before bringing up that node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
7ee57b8d7c ctdb-recoverd: Short circuit takeover run if no nodes are RUNNING
If all nodes are still in, say, FIRST_RECOVERY runstate, then the logs
contain unfortunate noise like:

  recoverd:Failed to find node to cover ip 10.0.2.131

This avoids that by adding an early exit that avoids running
takeover_run_core() when there are no nodes in the
CTDB_RUNSTATE_RUNNING.

To support this add the runstate to the ipflags structure.  There are
clearly other ways of hacking this but this seems the simplest.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
91f99ddfb3 ctdb-recoverd: Remove redundant condition when checking recovery lock
It isn't possible to hold the recovery lock without having a lock file
set.

This is part of a goal to generalise the recovery lock mechanism to
just use a helper program, which may use a lock file or may use
something else.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
a45ab7d1fe ctdb-recoverd: Simplify using TALLOC_FREE()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
2c72c9de48 ctdb-recoverd: Drop redundant condition in election handler
Election packets from the current node are ignored at the beginning of
the function, so this does not need to be checked.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
c75fdf208f ctdb-recoverd: Remove unused memory context variable
It is set, memory is allocated but it is never used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
e6f99fcba3 ctdb-daemon: Broadcast IP rellocation request from monitor code
No need to just send it to the recovery master.

This reduces the need for main daemon code to know which node is the
recovery master.  The end goal is for the main daemon to not need to
know which node is the recovery master - this information would be
stored in the recovery daemon (and subsequently a separate cluster
management daemon).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
4b4ba77f4a ctdb-recoverd: Replace unnecessary use of ctdb->recovery_master
Databases are only pulled by the recovery master, so it can compare
with current node PNN.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
6415edfa26 ctdb-recoverd: Rename some local variables to avoid conflict with convention
rec is always a (struct ctdb_recoverd *)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
36fc620898 ctdb_recoverd: Move num_lmasters calculation to near where it is used
Unless this node is the recovery master then this is not needed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
1fd2d3886c ctdb-recoverd: Make num_lmasters a local variable
It isn't used anywhere else and is always re-initialised to 0.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
385e9326ea ctdb-recoverd: Remove unused struct members num_active and num_connected
They are initialised and updated but the values are never used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
7fb84fc19b ctdb-tests: Test stub for ctdb_get_capabilities()
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
eb206f5d30 ctdb-daemon: Remove unused capabilities field from struct ctdb_node
Update the ctdb tool test stub code to cope.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
c3d6678dbc ctdb-recoverd: Use capabilities API
Simplify update_capabilities() using the capabilities API and store
the capabilities in new field rec->caps rather than scattered around
ctdb->nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Martin Schwenke
7a42bcaeae ctdb-client: Add API for retrieving and checking capabilities
ctdb_get_capabilities() gets capabilities from all connected nodes
into an array.  ctdb_get_node_capabilities() gets capabilities for a
particular node from array.  ctdb_node_has_capabilities() returns true
if given node has all of the given capabilities.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-05-10 03:22:13 +02:00
Ralph Boehme
fe93f7d677 vfs_fruit: comment fix: the options are documented
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  8 21:27:45 CEST 2015 on sn-devel-104
2015-05-08 21:27:45 +02:00
Ralph Boehme
1b8a0e6a26 vfs_fruit: add option "nfs_aces" that controls the NFS ACEs stuff
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11213

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-08 18:38:14 +02:00
Stefan Metzmacher
684c711665 smbd: Offer SMB 3.1.1 by default.
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May  8 15:49:32 CEST 2015 on sn-devel-104
2015-05-08 15:49:32 +02:00
Stefan Metzmacher
8a56fab24d s3:smb2_negprot: add support for negotiating SMB 3.1.0 and SMB 3.1.1
Note: SMB 3.1.0 was used in a early preview versions of Windows 10.
Was later superseded by 3.1.1.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
4481fea86a s3:smb2_sesssetup.c: For SMB >= 3.1, derive crypto keys from preauth
This protects the full connection setup including
a posteriori verification of the negotiate messages,
by signing the final session setup response with a signing key
derived from the preauth hash and the authentication session key.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
08845ad616 s3:smb2_negprot.c: add support SMB 3.1 negotiate contexts
Used for:
- preauthentication validation
- negotiation of ciphers for sigingn and encryprtion

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
d944585419 s3:smb2_server: allow SMB2_HDR_FLAG_PRIORITY_MASK for SMB >= 3.1.1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
f424f8d1c2 smbd: offer SMB 3.0.2 by default.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
02b223ced3 s3:smb2_negprot: add support for negotiating SMB 3.0.2
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
df78b16658 s3:smb2_read: pass in_flags to smbd_smb2_read_send()
For now we still ignore the flags.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
d19517e7a4 s3:smb2_write: add simplified support for SMB2_WRITEFLAG_WRITE_UNBUFFERED
TODO: we should add alignment checks.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
b1ea74af4c s3:smb2_create: treat the SVHDX_OPEN_DEVICE_CONTEXT in smb2_create (not supported)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
4770edec62 libcli/smb: SMB 3.0.2: define SVHDX_OPEN_DEVICE_CONTEXT
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
e85be925cc libcli/smb: SMB 3.0.2: define FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
a11aa8cf51 libcli/smb: SMB 3.0.2: define FSCTL_SVHDX_SYNC_TUNNEL_REQUEST
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
9aaeb67084 libcli/smb: SMB 3.0.2: define SMB2_WRITEFLAG_WRITE_UNBUFFERED
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
a8c3d94a6b libcli/smb: SMB 3.0.2: define SMB2_READFLAG_READ_UNBUFFERED
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
79a7ecba14 s3:torture: handle PROTOCOL_SMB3_11
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
e97858433e libcli/smb: add support for SMB >= 3.1.1 io priorities
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
6ce14a9a8b libcli/smb: add define for SMB 3.1.1 SMB2_HDR_FLAG_PRIORITY_MASK and helper macros
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Stefan Metzmacher
a554f02bc1 libcli/smb: add PROTOCOL_SMB3_11 and SMB3_DIALECT_REVISION_311
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
c29ff00fe4 libcli/smb: don't alter state->smb2.hdr when getting STATUS_PENDING
We need to make sure smb2cli_req_get_sent_iov() returns what was sent
over the wire. This is required in order to correctly perform
the preauth calculation for SMB >= 3.1.

We keep separate variables for the cancel information we got
from a STATUS_PENDING response.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:27 +02:00
Michael Adam
d3ed269074 libcli: add new NTSTATUS codes from SMB 3.1
NT_STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP
NT_STATUS_SMB_BAD_CLUSTER_DIALECT

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:27 +02:00
Michael Adam
fae184e805 libcli: add missing printable form of NT_STATUS_VHD_SHARED
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-08 13:00:27 +02:00