metze/samba/wip.git
7 years agoutil: Fix the documentation of push_utf8_talloc()
Andreas Schneider [Wed, 7 Sep 2016 13:15:00 +0000 (15:15 +0200)]
util: Fix the documentation of push_utf8_talloc()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agodbcheck: assert uSNChanged values in release-4-5-0-pre1
Garming Sam [Thu, 8 Sep 2016 04:34:51 +0000 (16:34 +1200)]
dbcheck: assert uSNChanged values in release-4-5-0-pre1

This shows that dbcheck doesn't change the replPropertyMetadata when
fixing the links on these objects.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Sep  8 14:39:19 CEST 2016 on sn-devel-144

7 years agotests: Skip a test for reveal internals for passing Windows
Garming Sam [Thu, 8 Sep 2016 03:45:56 +0000 (15:45 +1200)]
tests: Skip a test for reveal internals for passing Windows

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests: Check that USN bumps when modifying a linked attr
Garming Sam [Thu, 8 Sep 2016 05:04:29 +0000 (17:04 +1200)]
tests: Check that USN bumps when modifying a linked attr

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agodbcheck: Make it clearer about temporary output
Garming Sam [Thu, 8 Sep 2016 03:29:35 +0000 (15:29 +1200)]
dbcheck: Make it clearer about temporary output

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotombstone-expunge: Assert than an expunge does not bump the USN
Garming Sam [Thu, 8 Sep 2016 03:27:42 +0000 (15:27 +1200)]
tombstone-expunge: Assert than an expunge does not bump the USN

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests: Assert vanishing links doesn't bump USN
Garming Sam [Thu, 8 Sep 2016 02:40:08 +0000 (14:40 +1200)]
tests: Assert vanishing links doesn't bump USN

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Skip bump of USN when vanishing forward links
Garming Sam [Thu, 8 Sep 2016 02:40:40 +0000 (14:40 +1200)]
rpmd: Skip bump of USN when vanishing forward links

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Add a TODO regarding the additional work performed
Garming Sam [Thu, 8 Sep 2016 02:46:06 +0000 (14:46 +1200)]
rpmd: Add a TODO regarding the additional work performed

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Remove the seq_num check for skipping additional work
Garming Sam [Thu, 8 Sep 2016 02:42:01 +0000 (14:42 +1200)]
rpmd: Remove the seq_num check for skipping additional work

We will need this in a later patch.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agorpmd: Add the ldb error string to a debug
Garming Sam [Thu, 8 Sep 2016 02:46:38 +0000 (14:46 +1200)]
rpmd: Add the ldb error string to a debug

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotorture: Remove unnecessary whitespace
Garming Sam [Thu, 8 Sep 2016 01:33:11 +0000 (13:33 +1200)]
torture: Remove unnecessary whitespace

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agoctdb-scripts: Optimise tickle_tcp_connections()
Martin Schwenke [Tue, 8 Sep 2015 01:29:25 +0000 (11:29 +1000)]
ctdb-scripts: Optimise tickle_tcp_connections()

Pipe the connections to "ctdb tickle" on stdin to avoid having to fork
so many "ctdb tickle" processes.  This maintains the current level of
verbosity at the price of some extra memory usage.

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): Thu Sep  8 10:45:42 CEST 2016 on sn-devel-144

7 years agoctdb-scripts: Optimise update_tickles()
Martin Schwenke [Mon, 23 Mar 2015 08:37:35 +0000 (19:37 +1100)]
ctdb-scripts: Optimise update_tickles()

Use addtickle and deltickle with stdin.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Allow "addtickle" and "deltickle" stubs to read from stdin
Martin Schwenke [Mon, 7 Sep 2015 07:24:26 +0000 (17:24 +1000)]
ctdb-tests: Allow "addtickle" and "deltickle" stubs to read from stdin

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: CID 1125635 Dereference null return value (NULL_RETURNS)
Martin Schwenke [Fri, 2 Sep 2016 03:23:36 +0000 (13:23 +1000)]
ctdb-tests: CID 1125635 Dereference null return value (NULL_RETURNS)

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: CID 1125617 String not null terminated (STRING_NULL)
Martin Schwenke [Fri, 2 Sep 2016 01:56:02 +0000 (11:56 +1000)]
ctdb-tools: CID 1125617 String not null terminated (STRING_NULL)

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Compare interface pointers instead of using strcmp(3)
Martin Schwenke [Thu, 25 Aug 2016 01:48:36 +0000 (11:48 +1000)]
ctdb-daemon: Compare interface pointers instead of using strcmp(3)

If the interfaces have different names then they are different
interfaces.

Also, move assignment of new_name just above where is is first used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Use ctdb_find_iface() instead of duplicating logic
Martin Schwenke [Thu, 25 Aug 2016 01:41:11 +0000 (11:41 +1000)]
ctdb-daemon: Use ctdb_find_iface() instead of duplicating logic

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-deamon: Rename vnn_has_interface_with_name() to vnn_has_interface()
Martin Schwenke [Wed, 24 Aug 2016 10:41:49 +0000 (20:41 +1000)]
ctdb-deamon: Rename vnn_has_interface_with_name() to vnn_has_interface()

Now takes a pointer to an interface structure and does direct pointer
comparisons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Drop redundant uses of ctdb_find_iface()
Martin Schwenke [Wed, 24 Aug 2016 10:38:03 +0000 (20:38 +1000)]
ctdb-daemon: Drop redundant uses of ctdb_find_iface()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Make vnn->iface a list of new struct vnn_interface
Martin Schwenke [Wed, 24 Aug 2016 08:21:51 +0000 (18:21 +1000)]
ctdb-daemon: Make vnn->iface a list of new struct vnn_interface

To keep this change small, this leaves behind some redundant calls to
ctdb_find_iface() and similar.  They will be cleaned up later.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Change ctdb_add_local_iface() to return struct ctdb_interface
Martin Schwenke [Wed, 24 Aug 2016 06:59:46 +0000 (16:59 +1000)]
ctdb-daemon: Change ctdb_add_local_iface() to return struct ctdb_interface

This will allow a change to the way interfaces are handled in a VNN.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Move interface addition into interface parsing
Martin Schwenke [Wed, 24 Aug 2016 06:55:15 +0000 (16:55 +1000)]
ctdb-daemon: Move interface addition into interface parsing

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Drop some uses of CTDB_NO_MEMORY{,_FATAL}()
Martin Schwenke [Wed, 24 Aug 2016 06:49:30 +0000 (16:49 +1000)]
ctdb-daemon: Drop some uses of CTDB_NO_MEMORY{,_FATAL}()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Consolidate interface checking with interface parsing
Martin Schwenke [Sat, 20 Aug 2016 10:34:33 +0000 (20:34 +1000)]
ctdb-daemon: Consolidate interface checking with interface parsing

There's no point parsing the interfaces twice, especially since it
doesn't improve error handling.

This also removes a use of strdup(3)/free(3), which is not generally
used in our code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Replace some uses of CTDB_NO_MEMORY_FATAL()
Martin Schwenke [Sat, 20 Aug 2016 10:29:04 +0000 (20:29 +1000)]
ctdb-daemon: Replace some uses of CTDB_NO_MEMORY_FATAL()

Also add a missing out-of-memory check for vnn->ifaces.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Move and improve public IP duplicate checking
Martin Schwenke [Sat, 20 Aug 2016 10:21:34 +0000 (20:21 +1000)]
ctdb-daemon: Move and improve public IP duplicate checking

This also moves the interface validation down, making more obvious
that it can be consolidated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Drop use of strdup(3) and free(3) when releasing IP
Martin Schwenke [Sat, 20 Aug 2016 10:02:44 +0000 (20:02 +1000)]
ctdb-daemon: Drop use of strdup(3) and free(3) when releasing IP

If anything should be used here it should be talloc functions.
However, this is a remnant from when ctdb_sys_find_ifname() was used
here and, for some reason, it used strdup(3).

In this case the interface string doesn't actually need to be copied.
The only use of it is when ctdb_event_script_callback_v() uses it with
the format string in a call to talloc_vasprintf().  In the same
context the IP address isn't copied.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agolib: call_backtrace() is no more
Volker Lendecke [Tue, 6 Sep 2016 09:46:39 +0000 (11:46 +0200)]
lib: call_backtrace() is no more

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep  8 03:51:34 CEST 2016 on sn-devel-144

7 years agolibrpc: add clusapi_ResourceControlCode to IDL.
Günther Deschner [Wed, 11 May 2016 12:18:02 +0000 (14:18 +0200)]
librpc: add clusapi_ResourceControlCode to IDL.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: also test CLUSCTL_CLUSTER_CHECK_VOTER_DOWN.
Günther Deschner [Fri, 6 May 2016 23:24:28 +0000 (01:24 +0200)]
s4-torture: also test CLUSCTL_CLUSTER_CHECK_VOTER_DOWN.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for CreateGroupEnum.
Günther Deschner [Tue, 3 May 2016 23:34:20 +0000 (01:34 +0200)]
s4-torture: add test for CreateGroupEnum.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibrpc: add ClusterResTypeEnumType to IDL.
Günther Deschner [Tue, 3 May 2016 22:40:10 +0000 (00:40 +0200)]
librpc: add ClusterResTypeEnumType to IDL.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for CreateResTypeEnum().
Günther Deschner [Tue, 3 May 2016 22:39:48 +0000 (00:39 +0200)]
s4-torture: add test for CreateResTypeEnum().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: test CLUSCTL_GROUP_GET_FLAGS GroupControl.
Günther Deschner [Tue, 3 May 2016 15:38:29 +0000 (17:38 +0200)]
s4-torture: test CLUSCTL_GROUP_GET_FLAGS GroupControl.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibrpc: add CLUS_RESOURCE_CLASS_INFO to IDL
Günther Deschner [Tue, 3 May 2016 15:18:40 +0000 (17:18 +0200)]
librpc: add CLUS_RESOURCE_CLASS_INFO to IDL

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add test for clusapi_CreateGroupResourceEnum
Günther Deschner [Tue, 3 May 2016 10:59:24 +0000 (12:59 +0200)]
s4-torture: add test for clusapi_CreateGroupResourceEnum

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibrpc: add ClusterGroupEnumType enum to IDL.
Günther Deschner [Tue, 3 May 2016 10:58:07 +0000 (12:58 +0200)]
librpc: add ClusterGroupEnumType enum to IDL.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: add new tests for clusapi resourcetypes.
Günther Deschner [Tue, 3 May 2016 09:19:38 +0000 (11:19 +0200)]
s4-torture: add new tests for clusapi resourcetypes.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: Fix logic errors in node and group control clusapi tests.
Günther Deschner [Mon, 2 May 2016 15:53:38 +0000 (17:53 +0200)]
s4-torture: Fix logic errors in node and group control clusapi tests.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agolibrpc: add clusapi_ResourceTypeControlCode enum.
Günther Deschner [Mon, 2 May 2016 15:07:04 +0000 (17:07 +0200)]
librpc: add clusapi_ResourceTypeControlCode enum.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4-torture: test multiple different cluster control codes.
Günther Deschner [Mon, 2 May 2016 12:53:13 +0000 (14:53 +0200)]
s4-torture: test multiple different cluster control codes.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agopidl: fix field2name wireshark dissector test.
Günther Deschner [Tue, 6 Sep 2016 20:37:12 +0000 (22:37 +0200)]
pidl: fix field2name wireshark dissector test.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Sep  7 16:05:26 CEST 2016 on sn-devel-144

7 years agopidl: Keep case from fieldnames.
Günther Deschner [Wed, 11 May 2016 13:41:02 +0000 (15:41 +0200)]
pidl: Keep case from fieldnames.

Change-Id: I5626cfa0487cc88eb65cc349c05ae1762bc953f4
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-on: https://code.wireshark.org/review/16720
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agos4:torture:smb2 prefer torture_comment() to printf().
Günther Deschner [Mon, 22 Feb 2016 14:40:50 +0000 (15:40 +0100)]
s4:torture:smb2 prefer torture_comment() to printf().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4:torture:smb2:acls: prefer torture_comment() to printf().
Günther Deschner [Mon, 22 Feb 2016 15:27:44 +0000 (16:27 +0100)]
s4:torture:smb2:acls: prefer torture_comment() to printf().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4:torture:smb2:scan: prefer torture_comment() to printf().
Günther Deschner [Mon, 22 Feb 2016 15:06:51 +0000 (16:06 +0100)]
s4:torture:smb2:scan: prefer torture_comment() to printf().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4:torture:smb2:getinfo: prefer torture_comment() to printf().
Günther Deschner [Mon, 22 Feb 2016 14:51:06 +0000 (15:51 +0100)]
s4:torture:smb2:getinfo: prefer torture_comment() to printf().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4:torture:smb2:maxwrite: compile maxwrite test at least.
Günther Deschner [Fri, 26 Feb 2016 16:25:58 +0000 (17:25 +0100)]
s4:torture:smb2:maxwrite: compile maxwrite test at least.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4-torture: reformat TORTURE_SMB2 wscript_build list.
Günther Deschner [Fri, 26 Feb 2016 16:15:32 +0000 (17:15 +0100)]
s4-torture: reformat TORTURE_SMB2 wscript_build list.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4:torture:smb2:maxwrite: prefer torture_comment() to printf().
Günther Deschner [Mon, 22 Feb 2016 14:46:24 +0000 (15:46 +0100)]
s4:torture:smb2:maxwrite: prefer torture_comment() to printf().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agosource4/torture/rpc/testjoin.c: prefer torture_comment() over printf().
Günther Deschner [Mon, 22 Feb 2016 16:39:19 +0000 (17:39 +0100)]
source4/torture/rpc/testjoin.c: prefer torture_comment() over printf().

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4:torture:smb2:connect: prefer torture_comment() to printf().
Günther Deschner [Mon, 22 Feb 2016 14:30:26 +0000 (15:30 +0100)]
s4:torture:smb2:connect: prefer torture_comment() to printf().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
7 years agos4-torture: cleanup torture_suite_add_ndr_pull_validate_test API.
Günther Deschner [Mon, 25 Jul 2016 14:37:19 +0000 (16:37 +0200)]
s4-torture: cleanup torture_suite_add_ndr_pull_validate_test API.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Sep  7 09:28:13 CEST 2016 on sn-devel-144

7 years agos3-spoolss: fix _spoolss_GetPrinterDataEx by moving the keyname lengthcheck.
Günther Deschner [Thu, 1 Sep 2016 17:55:40 +0000 (19:55 +0200)]
s3-spoolss: fix _spoolss_GetPrinterDataEx by moving the keyname lengthcheck.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Sep  7 03:00:14 CEST 2016 on sn-devel-144

7 years agos4-torture: test GetPrinterData with server handle and 0 keylength.
Günther Deschner [Thu, 1 Sep 2016 17:54:46 +0000 (19:54 +0200)]
s4-torture: test GetPrinterData with server handle and 0 keylength.

This is what e.g. Windows 10 does a lot.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopidl: support HRESULT as return code in wireshark autogenerated dissectors.
Günther Deschner [Mon, 28 Sep 2015 05:28:28 +0000 (07:28 +0200)]
pidl: support HRESULT as return code in wireshark autogenerated dissectors.

Guenther

Change-Id: I68b7c579c5a519e429d2f4c2b3f63247e02f24e3
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-on: https://code.wireshark.org/review/16718
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agotevent: fix confused documentation
Michael Adam [Mon, 5 Sep 2016 15:33:38 +0000 (17:33 +0200)]
tevent: fix confused documentation

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep  6 23:16:34 CEST 2016 on sn-devel-144

7 years agoidmap_script: add missing "IDTOSID" argument to the script command line.
Björn Baumbach [Fri, 26 Aug 2016 15:16:51 +0000 (17:16 +0200)]
idmap_script: add missing "IDTOSID" argument to the script command line.

According to the documentation the commands should look like
"IDTOSID UID xxxx" instead of "UID xxxx".

This fixes changes of commit b4239ca096738f553b0f9d7fa6aaa4219b72ef7f:
    idmap_script: Parallelize script calls

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  6 19:32:57 CEST 2016 on sn-devel-144

7 years agotests/dns_forwarder: Fail out with an assertion instead OOB error
Garming Sam [Thu, 9 Jun 2016 01:52:38 +0000 (03:52 +0200)]
tests/dns_forwarder: Fail out with an assertion instead OOB error

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue Sep  6 15:41:54 CEST 2016 on sn-devel-144

7 years agotests/dns_forwarder: Check that the subprocess is still living
Garming Sam [Thu, 7 Jul 2016 04:58:27 +0000 (16:58 +1200)]
tests/dns_forwarder: Check that the subprocess is still living

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agotests/dns_forwarder: Wait for port for 15 seconds
Garming Sam [Mon, 5 Sep 2016 22:48:57 +0000 (10:48 +1200)]
tests/dns_forwarder: Wait for port for 15 seconds

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agosamba-tool: Remove --use-xattrs support without --use-ntvfs
Andrew Bartlett [Sun, 4 Sep 2016 09:33:30 +0000 (21:33 +1200)]
samba-tool: Remove --use-xattrs support without --use-ntvfs

The only reasonable use --use-xattrs=no should be used is in selftest,
and there is no need for that or --use-xattrs=auto without
--use-ntvfs, all systems we support in production for the AD DC have
xattrs, as using smbd needs posix ACLs.

This also removes the option entirely if NTVFS support is omitted from
the build.

I would prefer to get rid of the option, but currently selftest relies
on the default of --use-xattrs=auto, and we first should get rid of
that auto-detection, which will then mean we need --use-xattrs=no
specified wherever we specify --use-ntvfs.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue Sep  6 04:21:42 CEST 2016 on sn-devel-144

7 years agowafsamba: add -Werror=format-security to the developer build
Stefan Metzmacher [Fri, 2 Sep 2016 15:23:28 +0000 (17:23 +0200)]
wafsamba: add -Werror=format-security to the developer build

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep  5 20:23:00 CEST 2016 on sn-devel-144

7 years agoselftest: detect older tshark version
Uri Simchoni [Mon, 5 Sep 2016 05:52:52 +0000 (08:52 +0300)]
selftest: detect older tshark version

Detect older versions of tshark, which do not recognize
the -Y option, and skip the kerberos enc type tests

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep  5 16:31:58 CEST 2016 on sn-devel-144

7 years agocopyright: Add the missing notices for garbage collect tombstones
Bob Campbell [Sun, 4 Sep 2016 23:24:19 +0000 (11:24 +1200)]
copyright: Add the missing notices for garbage collect tombstones

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Sep  5 08:14:26 CEST 2016 on sn-devel-144

7 years agodsdb: refactor part of garbage_collect_tombstones into new function
Bob Campbell [Sun, 4 Sep 2016 22:48:13 +0000 (10:48 +1200)]
dsdb: refactor part of garbage_collect_tombstones into new function

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agoscript/release.sh: use 8 byte gpg key ids
Stefan Metzmacher [Fri, 2 Sep 2016 06:47:56 +0000 (08:47 +0200)]
script/release.sh: use 8 byte gpg key ids

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 Sep  2 22:05:33 CEST 2016 on sn-devel-144

7 years agogensec/spnego: work around missing server mechListMIC in SMB servers
Stefan Metzmacher [Thu, 1 Sep 2016 06:08:23 +0000 (08:08 +0200)]
gensec/spnego: work around missing server mechListMIC in SMB servers

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Fri Sep  2 18:10:44 CEST 2016 on sn-devel-144

7 years agokcc: Fix a -Werror,-Wformat-security error
Volker Lendecke [Fri, 2 Sep 2016 07:17:33 +0000 (09:17 +0200)]
kcc: Fix a -Werror,-Wformat-security error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep  2 13:54:45 CEST 2016 on sn-devel-144

7 years agos4-dsdb: Change debug level for replication
Andreas Schneider [Wed, 24 Aug 2016 09:33:16 +0000 (11:33 +0200)]
s4-dsdb: Change debug level for replication

Most of the time it is spamming the logs, so increase the level to debug
for most messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep  2 05:06:00 CEST 2016 on sn-devel-144

7 years agokrb5_wrap: Remove extra parentheses causing compile error
Anoop C S [Thu, 1 Sep 2016 05:55:32 +0000 (11:25 +0530)]
krb5_wrap: Remove extra parentheses causing compile error

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Sep  1 21:02:54 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Add a test to ensure that CTDB works with no eventscripts
Martin Schwenke [Mon, 29 Aug 2016 06:52:45 +0000 (16:52 +1000)]
ctdb-tests: Add a test to ensure that CTDB works with no eventscripts

This only tests something on local daemons, since the configuration
can't be easily manipulated on a real cluster.

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

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): Thu Sep  1 17:15:06 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Conditionally use temporary config file for local daemons
Martin Schwenke [Mon, 29 Aug 2016 06:49:07 +0000 (16:49 +1000)]
ctdb-tests: Conditionally use temporary config file for local daemons

If there's configuration in the environment then daemons_start()
should use a temporary configuration file with that appended.

This means that global overrides don't (harmlessly) build up in the
configuration file during each test and individual tests can override
configuration when calling daemons_start() directly.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Factor out function config_from_environment()
Martin Schwenke [Mon, 29 Aug 2016 06:05:33 +0000 (16:05 +1000)]
ctdb-tests: Factor out function config_from_environment()

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Don't steal control structure before synchronous reply
Martin Schwenke [Tue, 30 Aug 2016 22:29:13 +0000 (08:29 +1000)]
ctdb-daemon: Don't steal control structure before synchronous reply

If *async_reply isn't set then the calling code will reply to the
control and free the control structure.  In some places the control
structure pointer is stolen onto state before a synchronous exit due
to an error condition.  The error handling then frees state and
returns an error.  The calling code will access-after-free when trying
to reply to the control.

To make this easier to understand, the convention is that any
(immediate) error results in a synchronous reply to the control via an
error return code AND *async_reply not being set.  In this case the
control structure pointer should never be stolen onto state.  State is
never used for a synchronous reply, it is only ever used by a
callback.

Also initialise state->c to NULL so that any premature call to a
callback (e.g. in an immediate error path) is more obvious.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Handle failure immediately, do housekeeping later
Martin Schwenke [Fri, 26 Aug 2016 06:38:56 +0000 (16:38 +1000)]
ctdb-daemon: Handle failure immediately, do housekeeping later

The callback should never be called before an immediate return.  The
callback might reply to a control and the caller of
ctdb_event_script_callback_v() may not have assigned/stolen the
pointer to control structure into the private data.  Therefore,
calling the callback can dereference an uninitialised pointer to the
control structure when attempting to reply.

An event script isn't being run until the child has been forked.  So
update relevant state and set the destructor after this.

If the child can't be forked then free the state and return with an
error.  The callback will not be called and the caller will process
the error correctly.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Schedule running of callback if there are no event scripts
Martin Schwenke [Fri, 26 Aug 2016 06:29:47 +0000 (16:29 +1000)]
ctdb-daemon: Schedule running of callback if there are no event scripts

The callback should never be called before an immediate return.  The
callback might reply to a control and the caller of
ctdb_event_script_callback_v() may not have assigned/stolen the
pointer to control structure into the private data.  Therefore,
calling the callback can dereference an uninitialised pointer to the
control structure when attempting to reply.

ctdb_event_script_callback_v() must succeed when there are no event
scripts.  On success the caller will mark the call as asynchronous and
expect the callback to be called.  Given that it can't be called
before return then it needs to be scheduled.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoRemove unused python selftest
Douglas Bagnall [Tue, 23 Aug 2016 00:11:59 +0000 (12:11 +1200)]
Remove unused python selftest

It doesn't work, isn't changing, and causes a little bit of extra
confusion.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Sep  1 13:29:46 CEST 2016 on sn-devel-144

7 years agogc_tombstones: Typo fix
Garming Sam [Thu, 1 Sep 2016 02:26:53 +0000 (14:26 +1200)]
gc_tombstones: Typo fix

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglasbagnall@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Sep  1 09:38:47 CEST 2016 on sn-devel-144

7 years agodsdb: Do not check isDeleted as a possible link
Andrew Bartlett [Thu, 1 Sep 2016 02:17:27 +0000 (14:17 +1200)]
dsdb: Do not check isDeleted as a possible link

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agolib/ldb-samba: Add test for DSDB_MATCH_FOR_EXPUNGE match rule
Andrew Bartlett [Thu, 1 Sep 2016 01:34:12 +0000 (13:34 +1200)]
lib/ldb-samba: Add test for DSDB_MATCH_FOR_EXPUNGE match rule

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: Add comments to dsdb_garbage_collect_tombstones()
Andrew Bartlett [Thu, 1 Sep 2016 01:23:11 +0000 (13:23 +1200)]
dsdb: Add comments to dsdb_garbage_collect_tombstones()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agosamba-tool: Run samba-tool domain tombstones expunge in a transaction
Andrew Bartlett [Thu, 1 Sep 2016 00:13:40 +0000 (12:13 +1200)]
samba-tool: Run samba-tool domain tombstones expunge in a transaction

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoselftest: Add test for 'samba-tool tombstones expunge'
Andrew Bartlett [Wed, 31 Aug 2016 05:07:29 +0000 (17:07 +1200)]
selftest: Add test for 'samba-tool tombstones expunge'

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: Use a date comparison in the search to avoid returning all deleted objects
Andrew Bartlett [Mon, 29 Aug 2016 22:30:51 +0000 (10:30 +1200)]
dsdb: Use a date comparison in the search to avoid returning all deleted objects

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: Expose ldb error string to dsdb_garbage_collect_tombstones() callers
Andrew Bartlett [Mon, 29 Aug 2016 22:22:47 +0000 (10:22 +1200)]
dsdb: Expose ldb error string to dsdb_garbage_collect_tombstones() callers

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agosamba-tool: Add command-line tool to trigger tombstone expunge
Andrew Bartlett [Mon, 29 Aug 2016 06:36:19 +0000 (18:36 +1200)]
samba-tool: Add command-line tool to trigger tombstone expunge

This allows us to carefully test the garbage collection of tombstoned objects
without running the full server and waiting for the timer to expire

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopython: Add binding for dsdb_garbage_collect_tombstones()
Andrew Bartlett [Mon, 18 Jul 2016 01:11:10 +0000 (13:11 +1200)]
python: Add binding for dsdb_garbage_collect_tombstones()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: Expand garbage_collect_tombstones to expunge links also
Andrew Bartlett [Mon, 18 Jul 2016 01:17:52 +0000 (13:17 +1200)]
dsdb: Expand garbage_collect_tombstones to expunge links also

This requires a significant rework, as we can no longer
do a one-level search and hope to find most of the deleted
objects.  Therefore we fall back to a full scan, but less often.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: move tombstone lifetime calculation out of dsdb_garbage_collect_tombstones()
Andrew Bartlett [Mon, 29 Aug 2016 07:02:39 +0000 (19:02 +1200)]
dsdb: move tombstone lifetime calculation out of dsdb_garbage_collect_tombstones()

This will allow it to be specified by the caller when we add python bindings

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: Rework more KCC service-specific details out of dsdb_garbage_collect_tombstones()
Andrew Bartlett [Mon, 29 Aug 2016 06:56:10 +0000 (18:56 +1200)]
dsdb: Rework more KCC service-specific details out of dsdb_garbage_collect_tombstones()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: Rework kcc_deleted() into dsdb_garbage_collect_tombstones()
Andrew Bartlett [Mon, 18 Jul 2016 01:10:23 +0000 (13:10 +1200)]
dsdb: Rework kcc_deleted() into dsdb_garbage_collect_tombstones()

This is so that in a future commit, we can wrap this in python and allow it to be called
from outside the samba server processs.

This requires that we rework the callers and internals to avoid reference to
private data structures of the KCC service.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agokcc: Move kcc/kcc_deleted.c into kcc/garbage_collect_tombstones.c
Andrew Bartlett [Sun, 17 Jul 2016 23:53:50 +0000 (11:53 +1200)]
kcc: Move kcc/kcc_deleted.c into kcc/garbage_collect_tombstones.c

This is in preperation for a python binding for this function

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Fix comment on ldb_register_extended_match_rule
Andrew Bartlett [Mon, 29 Aug 2016 06:20:45 +0000 (18:20 +1200)]
ldb: Fix comment on ldb_register_extended_match_rule

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb-samba: Add new extended match rule DSDB_MATCH_FOR_EXPUNGE
Andrew Bartlett [Mon, 29 Aug 2016 06:20:18 +0000 (18:20 +1200)]
ldb-samba: Add new extended match rule DSDB_MATCH_FOR_EXPUNGE

This allows us to find links that need to be expunged
without passing the whole DB up in the search response.

While each message still needs to be examined, this code
only has to do memory allocation for entries with links

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopydsdb: Raise TypeError for type errors, rather than incorrectly raising an LdbError
Andrew Bartlett [Wed, 24 Aug 2016 23:28:32 +0000 (11:28 +1200)]
pydsdb: Raise TypeError for type errors, rather than incorrectly raising an LdbError

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoselftest: Correct name of samba4.blackbox.dbcheck.release-4-5-0-pre1
Andrew Bartlett [Tue, 30 Aug 2016 23:39:24 +0000 (11:39 +1200)]
selftest: Correct name of samba4.blackbox.dbcheck.release-4-5-0-pre1

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agotevent: Fix some typos
Volker Lendecke [Wed, 31 Aug 2016 14:12:33 +0000 (16:12 +0200)]
tevent: Fix some typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep  1 05:48:38 CEST 2016 on sn-devel-144