kai/samba-autobuild/.git
9 years agosmbd: Fix a typo
Volker Lendecke [Mon, 23 Mar 2015 14:38:35 +0000 (14:38 +0000)]
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb-tools: Use a broadcast to connected nodes for "reloadnodes"
Martin Schwenke [Wed, 25 Feb 2015 00:43:10 +0000 (11:43 +1100)]
ctdb-tools: Use a broadcast to connected nodes for "reloadnodes"

There is no reason to serialise these or even handle remote nodes
first.  Using a broadcast is more efficient and is less code.

Update expected test results to reflect changed order of messages.

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): Mon Mar 23 15:04:00 CET 2015 on sn-devel-104

9 years agoctdb-tests: Add unit tests for "reloadnodes" sanity checking
Martin Schwenke [Wed, 4 Feb 2015 03:57:03 +0000 (14:57 +1100)]
ctdb-tests: Add unit tests for "reloadnodes" sanity checking

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Sanity check changes before processing "reloadnodes"
Martin Schwenke [Fri, 30 Jan 2015 09:14:26 +0000 (20:14 +1100)]
ctdb-tools: Sanity check changes before processing "reloadnodes"

"ctdb reloadnodes" currently does no sanity checking of the nodes
file.  This can cause chaos if a line is deleted from the nodes file
rather than commented out.  It also repeatedly produces a spurious
warning for each deleted node, even if the node was deleted a long
time ago.

Instead compare the nodemap with the contents of the local nodes file
to sanity check before attempting any reloads.  Note that this is
still imperfect if the nodes files are inconsistent across nodes but
it is better.  Also ensure that any nodes that are to be deleted are
already disconnected.  Avoid trying to talk to deleted nodes.

The current implementation is a bit unfortunate when it comes to
deleting nodes.  The most obvious alternative to the above complexity
would be to reloadnodes on the specified node first, then fetch the
node map (in which newly deleted nodes would be marked as such) and
then handle the remote nodes.  However, the implementation of
reloadnodes is asynchronous and it only actions the reload after 1
second.  This is presumably to avoid the recovery master noticing the
inconsistency between nodemaps and triggering a recovery before all
nodes have had their nodemaps updated.

Note that this recovery can still occur if the check is done at an
inconvenient time.  A better long term approach might be to quiesce
the recovery master checks while reloadnodes is in progress.

Update a unit test to reflect the change.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Add "ctdb reloadnodes" unit tests
Martin Schwenke [Tue, 17 Mar 2015 09:12:22 +0000 (20:12 +1100)]
ctdb-tests: Add "ctdb reloadnodes" unit tests

A basic test and some for cross-node consistency checking.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Add cross-node file comparison to "reloadnodes"
Martin Schwenke [Tue, 24 Feb 2015 05:13:46 +0000 (16:13 +1100)]
ctdb-tools: Add cross-node file comparison to "reloadnodes"

This compares the nodes file on the current node with that on all
nodes.  If any are different then do not reload nodes.

If any nodes files can't be fetched then do not reload nodes.  This
could be because some nodes are running an older version without this
feature.  This is unsupported: why make a major cluster
reconfiguration while a cluster is half upgraded?

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Test stub for ctrl_getnodesfile()
Martin Schwenke [Tue, 24 Feb 2015 05:13:09 +0000 (16:13 +1100)]
ctdb-tests: Test stub for ctrl_getnodesfile()

Also stub support for CTDB_CONTROL_GET_NODES_FILE

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: New control CTDB_CONTROL_GET_NODES_FILE
Martin Schwenke [Fri, 20 Feb 2015 10:19:01 +0000 (21:19 +1100)]
ctdb-daemon: New control CTDB_CONTROL_GET_NODES_FILE

This is like CTDB_CONTROL_GET_NODEMAP but it loads from the nodes file
instead of the daemon.

Also new client function ctdb_ctrl_getnodesfile()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: "reloadnodes" should only run against current node
Martin Schwenke [Wed, 28 Jan 2015 00:54:39 +0000 (11:54 +1100)]
ctdb-tools: "reloadnodes" should only run against current node

It should not be possible to specify "-n <othernode>", unless
<othernode> is the current node.  To support this, add new function
assert_current_node_only().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Remove unused struct pnn_node and function read_pnn_node_file()
Martin Schwenke [Tue, 24 Feb 2015 00:18:34 +0000 (11:18 +1100)]
ctdb-tools: Remove unused struct pnn_node and function read_pnn_node_file()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Reimplement read_natgw_nodes_file() using ctdb_read_nodes_file()
Martin Schwenke [Tue, 24 Feb 2015 00:17:20 +0000 (11:17 +1100)]
ctdb-tools: Reimplement read_natgw_nodes_file() using ctdb_read_nodes_file()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Reimplement read_nodes_file() using ctdb_get_nodes_file()
Martin Schwenke [Mon, 23 Feb 2015 11:05:36 +0000 (22:05 +1100)]
ctdb-tools: Reimplement read_nodes_file() using ctdb_get_nodes_file()

Update the implementation of "ctdb xpnn" and "ctdb listnodes"
accordingly.  Update associated tests too.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Move ctdb_read_nodes_file() to utilities
Martin Schwenke [Sat, 21 Feb 2015 19:49:04 +0000 (06:49 +1100)]
ctdb-daemon: Move ctdb_read_nodes_file() to utilities

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Factor out node parsing code
Martin Schwenke [Tue, 17 Feb 2015 04:35:07 +0000 (15:35 +1100)]
ctdb-daemon: Factor out node parsing code

New function ctdb_read_nodes_file() reads a nodes file into a node
map, which is a useful intermediate format.  This function should
replace the node reading code in the ctdb CLI tool.  It will also be
useful for sanity checking of nodes files across the cluster.

New function convert_node_map_to_list() converts a node map to a node
array (and associated node count).  This fills in the details that
aren't present in the node map.  This may also useful as a separate
function later if node list reloading stages the data after a sanity
check - the approach is not yet finalised.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Store node addresses as ctdb_sock_addr rather than strings
Martin Schwenke [Fri, 20 Feb 2015 00:47:23 +0000 (11:47 +1100)]
ctdb-daemon: Store node addresses as ctdb_sock_addr rather than strings

Every time a nodemap is contructed the node IP addresses all need to
be parsed.  This isn't very productive use of CPU.

Instead, parse each string once when the nodes file is loaded.  This
results in much simpler code.

This code also removes the use of ctdb_address.  Duplicating the port
is pointless without an abstraction layer around ctdb_address.  If
CTDB gets an incompatible transport in the future then add an
abstraction layer.

Note that the infiniband code is not updated.  Compilation of the
infiniband code is already broken.  Fixing it will be a separate,
properly tested effort.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

9 years agoctdb-common: Drop ctdb context from ctdb_parse_address()
Martin Schwenke [Sun, 22 Feb 2015 23:34:33 +0000 (10:34 +1100)]
ctdb-common: Drop ctdb context from ctdb_parse_address()

Having it require a CTDB context stops ctdb_parse_address() from being
used in more generic code.  Just use the existing talloc context for
memory allocations.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Remove function ctdb_add_deleted_node()
Martin Schwenke [Tue, 10 Feb 2015 09:50:05 +0000 (20:50 +1100)]
ctdb-daemon: Remove function ctdb_add_deleted_node()

Just add a flags parameter to ctdb_add_nodes() and use the same code.
Less is more.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Set node PNN in one place
Martin Schwenke [Tue, 17 Feb 2015 04:21:15 +0000 (15:21 +1100)]
ctdb-daemon: Set node PNN in one place

This is currently set in 2 places.  One of them makes the node loading
code difficult to refactor.  Also, when the surrounding code in either
place is touched then it might get broken.

This only needs to be done once at startup, not on every reload.  So
do it once in a very obvious way, sacrificing a few CPU cycles for
some added clarity.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Move VNN map initialisation out of node loading
Martin Schwenke [Tue, 17 Feb 2015 01:34:41 +0000 (12:34 +1100)]
ctdb-daemon: Move VNN map initialisation out of node loading

Each node reload unnecessarily and incorrectly resets the VNN map,
causing a potentially unnecessary recovery.  When nodes are reloaded
any newly deleted nodes should already be disconnected and any newly
added nodes should also be disconnected.  This means that reloading
the nodes file should not cause a change in the VNN map.

The current implementation also leaks memory every time the nodes are
reloaded.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Fix error return for ctdb_client_async_control_stub()
Martin Schwenke [Tue, 17 Mar 2015 09:14:08 +0000 (20:14 +1100)]
ctdb-tests: Fix error return for ctdb_client_async_control_stub()

It should be -1 even without a failure callback registered.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Add asserts to ensure that pointers are set
Martin Schwenke [Tue, 17 Mar 2015 00:03:52 +0000 (11:03 +1100)]
ctdb-tests: Add asserts to ensure that pointers are set

These can be unset if a NODEMAP, IFACES or VNNMAP section is missing.
Affected functions would then dereference a NULL pointer and the test
program would crash.  Adding some helpful messages makes the problem
easier to diagnose when writing tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agotorture: Fix the usage of the MEMORY credential cache.
Andreas Schneider [Thu, 26 Feb 2015 16:03:44 +0000 (17:03 +0100)]
torture: Fix the usage of the MEMORY credential cache.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Mar 21 02:03:34 CET 2015 on sn-devel-104

9 years agokdc-db-glue: Remove unused code.
Andreas Schneider [Wed, 25 Feb 2015 10:57:23 +0000 (11:57 +0100)]
kdc-db-glue: Remove unused code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agokdc-db-glue: Do not allocate memory for the principal
Andreas Schneider [Wed, 25 Feb 2015 10:56:34 +0000 (11:56 +0100)]
kdc-db-glue: Do not allocate memory for the principal

The function we are calling already allocate memory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agokdc-db-glue: Fix memory cleanup to avoid crashes.
Andreas Schneider [Wed, 25 Feb 2015 10:55:43 +0000 (11:55 +0100)]
kdc-db-glue: Fix memory cleanup to avoid crashes.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agokdc-db-glue: Fix function format of samba_kdc_message2entry()
Andreas Schneider [Wed, 25 Feb 2015 10:54:52 +0000 (11:54 +0100)]
kdc-db-glue: Fix function format of samba_kdc_message2entry()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agokdc-db-glue: Fix a NULL pointer dereference.
Andreas Schneider [Wed, 25 Feb 2015 10:52:45 +0000 (11:52 +0100)]
kdc-db-glue: Fix a NULL pointer dereference.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: bad idea to free parent mem_ctx when sub function got a failure.
Günther Deschner [Tue, 10 Feb 2015 13:38:22 +0000 (14:38 +0100)]
s4-kdc/db_glue: bad idea to free parent mem_ctx when sub function got a failure.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/pac_glue: only include required headers.
Günther Deschner [Thu, 8 May 2014 13:49:17 +0000 (15:49 +0200)]
s4-kdc/pac_glue: only include required headers.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/pac_glue: use ENCTYPE_ARCFOUR_HMAC just like in db_glue.
Günther Deschner [Thu, 8 May 2014 13:20:59 +0000 (15:20 +0200)]
s4-kdc/pac_glue: use ENCTYPE_ARCFOUR_HMAC just like in db_glue.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db-glue: use krb5_copy_data_contents in samba_kdc_message2entry_keys().
Günther Deschner [Mon, 12 May 2014 15:45:26 +0000 (17:45 +0200)]
s4-kdc/db-glue: use krb5_copy_data_contents in samba_kdc_message2entry_keys().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/pac_glue: use krb5_copy_data_contents in samba_make_krb5_pac().
Günther Deschner [Mon, 12 May 2014 15:45:14 +0000 (17:45 +0200)]
s4-kdc/pac_glue: use krb5_copy_data_contents in samba_make_krb5_pac().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use KRB5_PW_SALT instead of hdb type.
Günther Deschner [Thu, 8 May 2014 12:32:47 +0000 (14:32 +0200)]
s4-kdc/db_glue: use KRB5_PW_SALT instead of hdb type.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use smb_krb5_principal_get_type() to access private members
Günther Deschner [Thu, 8 May 2014 10:21:43 +0000 (12:21 +0200)]
s4-kdc/db_glue: use smb_krb5_principal_get_type() to access private members

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use KRB5_KEY_TYPE to access private key members.
Günther Deschner [Thu, 8 May 2014 08:50:21 +0000 (10:50 +0200)]
s4-kdc/db_glue: use KRB5_KEY_TYPE to access private key members.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use time_t directly instead of KerberosTime.
Günther Deschner [Thu, 8 May 2014 08:49:00 +0000 (10:49 +0200)]
s4-kdc/db_glue: use time_t directly instead of KerberosTime.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use krb5_principal_get_comp_string() to access members of private...
Günther Deschner [Thu, 8 May 2014 08:44:09 +0000 (10:44 +0200)]
s4-kdc/db_glue: use krb5_principal_get_comp_string() to access members of private structs.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use krb5_princ_size() instead of inspecting private structs.
Günther Deschner [Thu, 8 May 2014 08:25:07 +0000 (10:25 +0200)]
s4-kdc/db_glue: use krb5_princ_size() instead of inspecting private structs.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use smb_krb5_principal_get_realm().
Günther Deschner [Thu, 8 May 2014 08:10:49 +0000 (10:10 +0200)]
s4-kdc/db_glue: use smb_krb5_principal_get_realm().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:kdc/db-glue: pass a valid principal from samba_kdc_seq() to samba_kdc_message2entry()
Stefan Metzmacher [Fri, 20 Mar 2015 14:29:30 +0000 (15:29 +0100)]
s4:kdc/db-glue: pass a valid principal from samba_kdc_seq() to samba_kdc_message2entry()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agos4-kdc/db_glue: use smb_krb5_principal_set_realm().
Günther Deschner [Thu, 8 May 2014 08:09:17 +0000 (10:09 +0200)]
s4-kdc/db_glue: use smb_krb5_principal_set_realm().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use krb5_copy_principal().
Günther Deschner [Wed, 7 May 2014 15:14:14 +0000 (17:14 +0200)]
s4-kdc/db_glue: use krb5_copy_principal().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use smb_krb5_make_principal().
Günther Deschner [Wed, 7 May 2014 14:47:52 +0000 (16:47 +0200)]
s4-kdc/db_glue: use smb_krb5_make_principal().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: use smb_krb5_keyblock_init_contents().
Günther Deschner [Wed, 7 May 2014 14:46:31 +0000 (16:46 +0200)]
s4-kdc/db_glue: use smb_krb5_keyblock_init_contents().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: no need to include kdc/kdc-glue.h header here.
Günther Deschner [Wed, 7 May 2014 17:58:39 +0000 (19:58 +0200)]
s4-kdc/db_glue: no need to include kdc/kdc-glue.h header here.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: no need to NULL entry_ex->entry.generation.
Günther Deschner [Wed, 7 May 2014 14:56:06 +0000 (16:56 +0200)]
s4-kdc/db_glue: no need to NULL entry_ex->entry.generation.

The whole entry_ex->entry struct is initialized already.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: remove unused hdb_entry_ex from samba_kdc_seq().
Günther Deschner [Wed, 7 May 2014 14:37:25 +0000 (16:37 +0200)]
s4-kdc/db_glue: remove unused hdb_entry_ex from samba_kdc_seq().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/db_glue: fix Debug messages.
Günther Deschner [Wed, 7 May 2014 14:11:51 +0000 (16:11 +0200)]
s4-kdc/db_glue: fix Debug messages.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-kdc/pac-glue: use kerberos_free_data_contents().
Günther Deschner [Wed, 7 May 2014 09:50:52 +0000 (11:50 +0200)]
s4-kdc/pac-glue: use kerberos_free_data_contents().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-libnet: only build python_dckeytab when heimdal is available.
Günther Deschner [Tue, 29 Apr 2014 23:19:53 +0000 (01:19 +0200)]
s4-libnet: only build python_dckeytab when heimdal is available.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-rpc_server: only build backup_key rpc service when Heimdal is available.
Günther Deschner [Fri, 25 Apr 2014 13:21:17 +0000 (15:21 +0200)]
s4-rpc_server: only build backup_key rpc service when Heimdal is available.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-dsdb/samdb: use abstract functions for MIT compatibility.
Günther Deschner [Fri, 25 Apr 2014 12:17:10 +0000 (14:17 +0200)]
s4-dsdb/samdb: use abstract functions for MIT compatibility.

This involves switching to krb5_data, smb_krb5_get_pw_salt and
smb_krb5_create_key_from_string.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3-winbind: Correct debug message for starting winbind.
Andreas Schneider [Tue, 27 Jan 2015 15:32:48 +0000 (16:32 +0100)]
s3-winbind: Correct debug message for starting winbind.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agodlz_bind9: Fix keytab location.
Andreas Schneider [Thu, 26 Feb 2015 17:17:18 +0000 (18:17 +0100)]
dlz_bind9: Fix keytab location.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoYouCompleteMe: Add missing path.
Andreas Schneider [Thu, 26 Feb 2015 16:10:28 +0000 (17:10 +0100)]
YouCompleteMe: Add missing path.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:torture/libnetapi: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 22:10:26 +0000 (23:10 +0100)]
s4:torture/libnetapi: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 20 23:23:55 CET 2015 on sn-devel-104

9 years agos4:torture/libnetapi: avoid compiler warning
Stefan Metzmacher [Wed, 18 Mar 2015 22:10:01 +0000 (23:10 +0100)]
s4:torture/libnetapi: avoid compiler warning

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/winbind: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 22:08:33 +0000 (23:08 +0100)]
s4:torture/winbind: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/winbind: avoid compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 22:08:02 +0000 (23:08 +0100)]
s4:torture/winbind: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/wscript_build: remove allow_warnings=True for torture_rpc
Stefan Metzmacher [Wed, 18 Mar 2015 22:04:09 +0000 (23:04 +0100)]
s4:torture/wscript_build: remove allow_warnings=True for torture_rpc

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/rpc: avoid compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 22:03:48 +0000 (23:03 +0100)]
s4:torture/rpc: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/wscript_build: remove allow_warnings=True for TORTURE_RAW
Stefan Metzmacher [Wed, 18 Mar 2015 21:53:00 +0000 (22:53 +0100)]
s4:torture/wscript_build: remove allow_warnings=True for TORTURE_RAW

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/raw: avoid compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 21:52:32 +0000 (22:52 +0100)]
s4:torture/raw: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/wscript_build: remove allow_warnings=True for TORTURE_NDR
Stefan Metzmacher [Wed, 18 Mar 2015 21:46:13 +0000 (22:46 +0100)]
s4:torture/wscript_build: remove allow_warnings=True for TORTURE_NDR

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/ndr: #if 0 unused code
Stefan Metzmacher [Wed, 18 Mar 2015 21:45:17 +0000 (22:45 +0100)]
s4:torture/ndr: #if 0 unused code

This avoids compiler warnings, but keep the code arround to be activated later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/smb2: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 21:39:33 +0000 (22:39 +0100)]
s4:torture/smb2: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture/smb2: avoid compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 21:39:11 +0000 (22:39 +0100)]
s4:torture/smb2: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoldb:wscript: remove allow_warnings=True for ldb_sample
Stefan Metzmacher [Wed, 18 Mar 2015 21:17:06 +0000 (22:17 +0100)]
ldb:wscript: remove allow_warnings=True for ldb_sample

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoldb:tests/sample_module: don't be lazy and use ldb_msg_copy_shallow/ldb_build_add_req
Stefan Metzmacher [Wed, 18 Mar 2015 21:17:06 +0000 (22:17 +0100)]
ldb:tests/sample_module: don't be lazy and use ldb_msg_copy_shallow/ldb_build_add_req

If we want to modify the the passed request on its way down the module chain,
we should use the proper way and use ldb_msg_copy_shallow() and ldb_build_add_req().

This way we don't alter the callers const structure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:auth/gensec_cyrus_sasl: allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 21:03:59 +0000 (22:03 +0100)]
s4:auth/gensec_cyrus_sasl: allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:auth/gensec_cyrus_sasl: remove compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 21:03:59 +0000 (22:03 +0100)]
s4:auth/gensec_cyrus_sasl: remove compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:auth/gensec_gssapi: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 20:52:12 +0000 (21:52 +0100)]
s4:auth/gensec_gssapi: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:auth/gensec_gssapi: remove compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 20:52:12 +0000 (21:52 +0100)]
s4:auth/gensec_gssapi: remove compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoauth/kerberos: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 20:49:32 +0000 (21:49 +0100)]
auth/kerberos: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoauth/kerberos: avoid compiler warnings
Stefan Metzmacher [Wed, 18 Mar 2015 20:49:05 +0000 (21:49 +0100)]
auth/kerberos: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:lib/tls: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 20:43:00 +0000 (21:43 +0100)]
s4:lib/tls: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:lib/tls: add tls_cert_generate() prototype to tls.h
Stefan Metzmacher [Wed, 18 Mar 2015 20:42:19 +0000 (21:42 +0100)]
s4:lib/tls: add tls_cert_generate() prototype to tls.h

This avoids compiler warnings...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/samr: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 15:12:11 +0000 (16:12 +0100)]
s4:rpc_server/samr: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/samr: use the same logic in *info_DomInfo7() as in info_DomGeneralInfor...
Stefan Metzmacher [Wed, 18 Mar 2015 15:07:43 +0000 (16:07 +0100)]
s4:rpc_server/samr: use the same logic in *info_DomInfo7() as in info_DomGeneralInformation()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/samr: handle ROLE_AUTO explicit to avoid a compiler warning
Stefan Metzmacher [Wed, 18 Mar 2015 15:07:03 +0000 (16:07 +0100)]
s4:rpc_server/samr: handle ROLE_AUTO explicit to avoid a compiler warning

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/samr: remove unused variables
Stefan Metzmacher [Wed, 18 Mar 2015 09:23:39 +0000 (10:23 +0100)]
s4:rpc_server/samr: remove unused variables

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/drsuapi: remove allow_warnings=True
Stefan Metzmacher [Wed, 18 Mar 2015 09:15:47 +0000 (10:15 +0100)]
s4:rpc_server/drsuapi: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/drsuapi: fix const warning in writespn_check_spn()
Stefan Metzmacher [Wed, 18 Mar 2015 09:15:47 +0000 (10:15 +0100)]
s4:rpc_server/drsuapi: fix const warning in writespn_check_spn()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/drsuapi: remove unused variable in dcesrv_drsuapi_DsWriteAccountSpn()
Stefan Metzmacher [Wed, 18 Mar 2015 09:15:47 +0000 (10:15 +0100)]
s4:rpc_server/drsuapi: remove unused variable in dcesrv_drsuapi_DsWriteAccountSpn()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:rpc_server/drsuapi: fix warnings in dcesrv_drsuapi_DsGetDomainControllerInfo_1()
Stefan Metzmacher [Wed, 18 Mar 2015 09:15:47 +0000 (10:15 +0100)]
s4:rpc_server/drsuapi: fix warnings in dcesrv_drsuapi_DsGetDomainControllerInfo_1()

'default' is already handled in an earlier switch statement,
so this won't be reached but avoids a warning.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:rpc_server/wscript_build: remove allow_warnings=True from RPC_SPOOLSS
Stefan Metzmacher [Wed, 18 Mar 2015 09:03:41 +0000 (10:03 +0100)]
s3:rpc_server/wscript_build: remove allow_warnings=True from RPC_SPOOLSS

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:rpc_server/spoolss: make use of SPOOLSS_JOB_CONTROL_NOOP
Stefan Metzmacher [Wed, 18 Mar 2015 09:03:08 +0000 (10:03 +0100)]
s3:rpc_server/spoolss: make use of SPOOLSS_JOB_CONTROL_NOOP

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agospoolss.idl: add SPOOLSS_JOB_CONTROL_NOOP = 0
Stefan Metzmacher [Wed, 18 Mar 2015 09:01:27 +0000 (10:01 +0100)]
spoolss.idl: add SPOOLSS_JOB_CONTROL_NOOP = 0

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:wscript_build: remove allow_warnings=True from LIBNET_DSSYNC
Stefan Metzmacher [Wed, 18 Mar 2015 08:51:49 +0000 (09:51 +0100)]
s3:wscript_build: remove allow_warnings=True from LIBNET_DSSYNC

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:libnet: remove unused variables
Stefan Metzmacher [Wed, 18 Mar 2015 08:51:16 +0000 (09:51 +0100)]
s3:libnet: remove unused variables

Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agolibcli/auth: add forward declaration for struct wkssvc_PasswordBuffer
Stefan Metzmacher [Wed, 18 Mar 2015 08:50:44 +0000 (09:50 +0100)]
libcli/auth: add forward declaration for struct wkssvc_PasswordBuffer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolibcli/auth: add some const to netlogon_creds_server_{init,step_check}()
Stefan Metzmacher [Thu, 19 Mar 2015 15:26:03 +0000 (16:26 +0100)]
libcli/auth: add some const to netlogon_creds_server_{init,step_check}()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoctdb-tests: Avoid early exits in scripts that appear on tail of a pipe
Amitay Isaacs [Fri, 20 Mar 2015 03:36:51 +0000 (14:36 +1100)]
ctdb-tests: Avoid early exits in scripts that appear on tail of a pipe

When executing a shell script code "foo | bar", if "bar" terminates early,
then "foo" can get I/O error when writing to stdout.

The tdbtool stub did not wait to read anything from stdin when it is
expected to.  This would cause tests to fail randomly under load when
tdbtool process exited early.

Similarly, debug function read from stdin only under certain conditions
(higher debug and when not reading from tty).  Otherwise, exited early.

Thanks to Andrew Bartlett for noticing the problem and Catalyst Cloud
(http://catalyst.net.nz/cloud) for providing resources to test fixes.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Mar 20 16:26:37 CET 2015 on sn-devel-104

9 years agoctdb-scripts: Simplify 00.ctdb event script
Amitay Isaacs [Thu, 19 Mar 2015 14:30:55 +0000 (01:30 +1100)]
ctdb-scripts: Simplify 00.ctdb event script

Avoid extra which commands.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agobackupkey: Use ndr_pull_struct_blob_all()
Andrew Bartlett [Fri, 20 Mar 2015 01:32:00 +0000 (14:32 +1300)]
backupkey: Use ndr_pull_struct_blob_all()

This avoids bad decrypts from falling down to later code and getting
the error code wrong, by strictly requiring the NDR parse to use all the
data.  A bad decyrpt is very unlikely to get the length correct, and
so fall down to the other checks.

This should fix:
UNEXPECTED(failure): samba4.rpc.backupkey with seal.backupkey.server_wrap_decrypt_wrong_r2(ad_dc_ntvfs)
REASON: Exception: Exception: ../source4/torture/rpc/backupkey.c:1926: r.out.result was WERR_INVALID_ACCESS, expected WERR_INVALID_PARAM: decrypt should fail with WERR_INVALID_PARAM

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11174
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
9 years agolibcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with implementation
Thomas Schulz [Mon, 16 Mar 2015 17:21:46 +0000 (10:21 -0700)]
libcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with implementation

I have been building 4.2.0 with the GNU C compiler but I decided to see
how it works with the Sun C 5.11 compiler. The Sun compiler complains
about a identifier being redeclared in libcli/auth/netlogon_creds_cli.c

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

Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agodsdb-tests: Give more helpful information about attribute differences
Andrew Bartlett [Thu, 19 Mar 2015 05:35:05 +0000 (18:35 +1300)]
dsdb-tests: Give more helpful information about attribute differences

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3: lib: libsmbclient: If reusing a server struct, check every cli->timout milisecond...
Jeremy Allison [Wed, 18 Mar 2015 21:15:16 +0000 (14:15 -0700)]
s3: lib: libsmbclient: If reusing a server struct, check every cli->timout miliseconds if it's still valid before use.

Uses an cli_echo() call to do so.

Based on code from <shargagan@novell.com>

Bug 11079 - libsmbclient not checking the cached connection alive status before re-using it from connection cache

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Mar 20 13:48:26 CET 2015 on sn-devel-104

9 years agos3: libcli: smb1: Ensure we correctly finish a tevent req if the writev fails in...
Jeremy Allison [Thu, 19 Mar 2015 17:40:56 +0000 (10:40 -0700)]
s3: libcli: smb1: Ensure we correctly finish a tevent req if the writev fails in the SMB1 case.

We haven't added the req to the pending array yet, as SMB1 requests can
be one-way (no reply needed). So if we error out after the writev, but
before we add to the pending array we must rember to terminate our current
tevent req with a tevent_req_nterror call.

Fixes bug 11173 - SMB1 Server disconnect can cause timeout on client write error.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Mar 20 05:08:25 CET 2015 on sn-devel-104

9 years agoselftest: mark the samba4.blackbox.dbcheck test as flapping.
Michael Adam [Thu, 19 Mar 2015 15:59:42 +0000 (16:59 +0100)]
selftest: mark the samba4.blackbox.dbcheck test as flapping.

This causes frequent autobuild failures recently as follows:

[1730(16550)/1735 at 2h7m43s] samba4.blackbox.dbcheck(ad_dc_ntvfs)
UNEXPECTED(failure): samba4.blackbox.dbcheck(ad_dc_ntvfs).dbcheck(ad_dc_ntvfs:local)
REASON: Exception: Exception: Checking 6799 objects
ERROR: wrong dn[CN=DrsDelObjUser_1426756150,CN=Deleted Objects,DC=samba,DC=example,DC=com] name='DrsDelObjUser_1426756150
DEL:77ec48cb-06cc-4157-a565-770720c30929' new_dn[CN=DrsDelObjUser_1426756150

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)

Has been seen flapping since quite some time:

https://git.samba.org/autobuild.flakey/2012-06-22-0340/samba.stdout
https://git.samba.org/autobuild.flakey/2012-06-25-2339/samba.stdout
https://git.samba.org/autobuild.flakey/2012-07-02-1741/samba.stdout
https://git.samba.org/autobuild.flakey/2012-07-31-1344/samba.stdout
https://git.samba.org/autobuild.flakey/2012-09-24-1331/samba.stdout
https://git.samba.org/autobuild.flakey/2012-11-21-0933/samba.stdout
https://git.samba.org/autobuild.flakey/2012-12-02-0140/samba.stdout
https://git.samba.org/autobuild.flakey/2012-12-11-1933/samba.stdout
...
https://git.samba.org/autobuild.flakey/2014-08-20-1715/samba.stdout
https://git.samba.org/autobuild.flakey/2014-09-29-0222/samba.stdout
https://git.samba.org/autobuild.flakey/2014-12-13-1119/samba.stdout
https://git.samba.org/autobuild.flakey/2015-03-19-0529/samba.stdout
https://git.samba.org/autobuild.flakey/2015-03-19-0828/samba.stdout
https://git.samba.org/autobuild.flakey/2015-03-19-1128/samba.stdout

Possibly related to the failure of tombstone_ranimation,
drs.delete_object, and blackbox.samba_tool_demote.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 19 20:43:32 CET 2015 on sn-devel-104