sfrench/samba-autobuild/.git
7 years agolib: Avoid includes.h in bitmap.c
Volker Lendecke [Sat, 26 Nov 2016 14:55:38 +0000 (15:55 +0100)]
lib: Avoid includes.h in bitmap.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoselftest: Do not include system krb5.conf in selftest
Andreas Schneider [Thu, 1 Dec 2016 07:18:58 +0000 (08:18 +0100)]
selftest: Do not include system krb5.conf in selftest

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
7 years agos3:libads: Include system /etc/krb5.conf if we use MIT Kerberos
Andreas Schneider [Wed, 23 Nov 2016 13:40:42 +0000 (14:40 +0100)]
s3:libads: Include system /etc/krb5.conf if we use MIT Kerberos

The system /etc/krb5.conf defines some defaults like:

    default_ccache_name = KEYRING:persistent:%{uid}

We need to respect that so should include it in our own created
krb5.conf file.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
7 years agos3:param: Add an 'include system krb5 conf' option
Andreas Schneider [Wed, 23 Nov 2016 13:39:47 +0000 (14:39 +0100)]
s3:param: Add an 'include system krb5 conf' option

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
7 years agoctdb-tests: Use a separate directory for each local daemon
Martin Schwenke [Thu, 24 Nov 2016 05:37:26 +0000 (16:37 +1100)]
ctdb-tests: Use a separate directory for each local daemon

Separate directory contains configuration file, PID file, public
addresses file, socket, databases and log file.

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): Fri Dec  2 04:19:18 CET 2016 on sn-devel-144

7 years agoctdb-ipalloc: Optimise check to see if IP is available on a node
Martin Schwenke [Fri, 18 Nov 2016 05:08:13 +0000 (16:08 +1100)]
ctdb-ipalloc: Optimise check to see if IP is available on a node

Use a "bitmap" of available IPs for each IP address instead of walking
the list of available IP addresses.

For ctdb/tests/takeover/lcp2.030.sh, this improves the time taken on
my laptop from:

  real 0m11.997s
  user 0m11.960s
  sys 0m0.000s

to

  real 0m8.571s
  user 0m8.544s
  sys 0m0.000s

So, when assigning all 900 IP addresses the improvement is about 25%.

For the no-op case (where all IPs are already assigned to nodes), the
extra setup adds a small fraction of a second for 900 IPs.
Intermediate cases result in intermediate improvements.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Exit early if there are trailing command-line arguments
Martin Schwenke [Sun, 27 Nov 2016 22:51:48 +0000 (09:51 +1100)]
ctdb-daemon: Exit early if there are trailing command-line arguments

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Don't call ctdb_local_node_got_banned() on flag changes
Martin Schwenke [Tue, 8 Nov 2016 05:37:24 +0000 (16:37 +1100)]
ctdb-daemon: Don't call ctdb_local_node_got_banned() on flag changes

This function is currently called twice each time a node is banned.

ctdb_local_node_got_banned() is already called from the banning code,
either due to a received banning control or a node banning itself.
Given that other nodes can't set a node's BANNED flag, a node can only
be banned via the above mechanisms, so drop the redundant call.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agos3-libads: Fix canonicalization support with MIT Kerberos
Andreas Schneider [Mon, 15 Feb 2016 11:09:59 +0000 (12:09 +0100)]
s3-libads: Fix canonicalization support with MIT Kerberos

This allows to authenticate using user@DOMAIN against an AD DC.

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

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 Dec  2 00:23:02 CET 2016 on sn-devel-144

7 years agos3: libsmb: Setting the LIBSMBCLIENT_NO_CCACHE environment variable doesn't turn...
Jeremy Allison [Wed, 30 Nov 2016 18:25:53 +0000 (10:25 -0800)]
s3: libsmb: Setting the LIBSMBCLIENT_NO_CCACHE environment variable doesn't turn off credential cache use.

Signed-off-by: Jeremy Allison <jra@samba.org>
7 years agoreplace: Include libgen.h if available
Amitay Isaacs [Thu, 1 Dec 2016 01:12:47 +0000 (12:12 +1100)]
replace: Include libgen.h if available

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Dec  1 18:08:54 CET 2016 on sn-devel-144

7 years agosmbd: avoid extra churn on a debug print
Uri Simchoni [Thu, 1 Dec 2016 04:29:34 +0000 (06:29 +0200)]
smbd: avoid extra churn on a debug print

Remove the user / group name in debug-printing of a
POSIX-ACL-derived ACE.

Obtaining the user name might result an extra lookup
to the domain. In a typical case, a user raises logging
level to 10 to troubleshoot an issue, so connectivity
problems are likely to exist. In that case we won't want
the extra debug printing to create more issues.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agoperf: Add simple tests for the open/close a database case
Andrew Bartlett [Mon, 17 Oct 2016 21:39:00 +0000 (10:39 +1300)]
perf: Add simple tests for the open/close a database case

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec  1 09:40:20 CET 2016 on sn-devel-144

7 years agoKCC: unconnected graph test
Clive Ferreira [Thu, 3 Nov 2016 23:31:09 +0000 (12:31 +1300)]
KCC: unconnected graph test

Uses a unconnected 5 DC single site database to test Douglas Bagnalls
patch which corrected a mix up between a str and an object which caused
infinite recursion and a method call on a None type.

This test patch originally triggered an edge case bug. This bug is
triggered by code to create additional edges which normally never ran.
In normal cases, the leftover connections made during a join would
prevent these additional edges from being created.

Signed-off-by: Clive Ferreira <cliveferreira@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoKCC: avoid infinite recursion when edgelist contains self
Douglas Bagnall [Wed, 2 Nov 2016 03:49:49 +0000 (16:49 +1300)]
KCC: avoid infinite recursion when edgelist contains self

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoKCC: Graphnode.add_edge_from expects dn strings, not objects
Douglas Bagnall [Wed, 2 Nov 2016 03:48:50 +0000 (16:48 +1300)]
KCC: Graphnode.add_edge_from expects dn strings, not objects

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: new ldb version 1.1.29 ldb-1.1.29
Andrew Bartlett [Mon, 28 Nov 2016 01:05:41 +0000 (14:05 +1300)]
ldb: new ldb version 1.1.29

 - new OID LDB_CONTROL_RECALCULATE_RDN_OID
 - honour LDB_CONTROL_RECALCULATE_RDN_OID in rdn_modify
 - fix handling of @ATTRIBUTES containing * in rdn_modify
 - improve startup performance on AD DC databases
  - These have lots of index attributes and attributes specified

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Add test for behaviour of rdn_name
Andrew Bartlett [Wed, 30 Nov 2016 23:11:46 +0000 (12:11 +1300)]
ldb: Add test for behaviour of rdn_name

Cover a wildcard in @ATTRIBUTES and the normal case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Cope with a->name being *
Andrew Bartlett [Tue, 29 Nov 2016 03:20:07 +0000 (16:20 +1300)]
ldb: Cope with a->name being *

The default schema when loaded from the DB will have a name of *, not NULL.

This feature is rarely used, and was incompatible with the rdn_name module
until now.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb:rdn_name: add support for LDB_CONTROL_RECALCULATE_RDN_OID on ldb_modify()
Stefan Metzmacher [Thu, 10 Nov 2016 17:03:26 +0000 (18:03 +0100)]
ldb:rdn_name: add support for LDB_CONTROL_RECALCULATE_RDN_OID on ldb_modify()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb:rdn_name: normalize rdn_name in rdn_rename_callback()
Stefan Metzmacher [Thu, 10 Nov 2016 13:01:21 +0000 (14:01 +0100)]
ldb:rdn_name: normalize rdn_name in rdn_rename_callback()

We already do that on 'add'.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: load @ATTRIBUTES faster by sorting once, not at each insertion
Andrew Bartlett [Wed, 19 Oct 2016 00:24:36 +0000 (13:24 +1300)]
ldb: load @ATTRIBUTES faster by sorting once, not at each insertion

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Add helper function ldb_schema_attribute_fill_with_syntax()
Andrew Bartlett [Thu, 20 Oct 2016 03:01:42 +0000 (16:01 +1300)]
ldb: Add helper function ldb_schema_attribute_fill_with_syntax()

This will allow us to avoid calling ldb_schema_attribute_add_with_syntax()
in a tight loop.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Reduce per-attribute memory allocation during @ATTRIBUTES load
Andrew Bartlett [Fri, 14 Oct 2016 02:42:53 +0000 (15:42 +1300)]
ldb: Reduce per-attribute memory allocation during @ATTRIBUTES load

This means we do just a few allocations, not multiple per configured attribute (there can be 1000s)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Reduce scope of allocation and de-allocation of @ATTRIBUTES
Andrew Bartlett [Fri, 14 Oct 2016 02:35:46 +0000 (15:35 +1300)]
ldb: Reduce scope of allocation and de-allocation of @ATTRIBUTES

This memory does not need to be around long-term

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb: Add helper function ldb_schema_attribute_remove_flagged()
Andrew Bartlett [Thu, 20 Oct 2016 03:04:04 +0000 (16:04 +1300)]
ldb: Add helper function ldb_schema_attribute_remove_flagged()

This helps us avoid keeping a list of attributes to later remove on @ATTRIBUTES reload

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoldb:controls: add LDB_CONTROL_RECALCULATE_RDN_OID
Stefan Metzmacher [Thu, 10 Nov 2016 17:01:47 +0000 (18:01 +0100)]
ldb:controls: add LDB_CONTROL_RECALCULATE_RDN_OID

This will be used by 'samba-tool dbcheck' to fix the rdn attribute name.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(Patch reduced by Andrew Bartlett to only allocate the OID)

7 years agoldb: Avoid individual memory allocations when searching for indexlist
Andrew Bartlett [Mon, 24 Oct 2016 21:56:43 +0000 (10:56 +1300)]
ldb: Avoid individual memory allocations when searching for indexlist

This reduces the talloc_free() cost when the ldb is terminated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agodsdb: specify attributes when loading schema
Andrew Bartlett [Fri, 14 Oct 2016 02:43:46 +0000 (15:43 +1300)]
dsdb: specify attributes when loading schema

The LDB code performs better when the required attributes are listed, even when it is almost
all the attributes

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopidl: Make static struct api_struct also const
Andrew Bartlett [Sun, 20 Nov 2016 22:58:07 +0000 (11:58 +1300)]
pidl: Make static struct api_struct also const

This moves the table to read-only memory

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopidl: Change *_get_pipe_fns() to return const struct api_struct *
Andrew Bartlett [Sun, 20 Nov 2016 22:57:48 +0000 (11:57 +1300)]
pidl: Change *_get_pipe_fns() to return const struct api_struct *

This will allow the table to be made static const in the next commit

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agos4-rpc_server: Use an initialised static const struct in dcerpc_server_remote_init
Andrew Bartlett [Sun, 20 Nov 2016 22:42:30 +0000 (11:42 +1300)]
s4-rpc_server: Use an initialised static const struct in dcerpc_server_remote_init

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agos4-rpc_server: Use a type-safe struct signature in dcerpc_register_ep_server
Andrew Bartlett [Sun, 20 Nov 2016 22:39:16 +0000 (11:39 +1300)]
s4-rpc_server: Use a type-safe struct signature in dcerpc_register_ep_server

This is much safer than void *, and the void * feature appears no longer
to be needed after 31ded4901b4529ad2e49871502cab5ecba71483a

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopidl: Use a static const initialised struct in dcerpc_server_$name_init(void)
Andrew Bartlett [Sun, 20 Nov 2016 22:38:24 +0000 (11:38 +1300)]
pidl: Use a static const initialised struct in dcerpc_server_$name_init(void)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agotorture: Remove access to LSARPC via \\pipe\netlogon in rpc.netlogon for ManyGetDCNam...
Andrew Bartlett [Wed, 9 Nov 2016 01:22:33 +0000 (14:22 +1300)]
torture: Remove access to LSARPC via \\pipe\netlogon in rpc.netlogon for ManyGetDCName test

This exploited the fact that we had \\pipe\lsass in both netlogon.idl and lsarpc.idl

To do this, we reset the binding to a new endpoint and reset the association group.

We add a new test specifically for this "feature" that we can knownfail if we
break it to add other new functionality.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agos4/rpc_server: Show what RPC interfaces are listening on which TCP port
Andrew Bartlett [Tue, 18 Oct 2016 23:45:05 +0000 (12:45 +1300)]
s4/rpc_server: Show what RPC interfaces are listening on which TCP port

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agotalloc: Add tests for talloc_parent() after realloc() of the parent
Andrew Bartlett [Sun, 27 Nov 2016 22:47:41 +0000 (11:47 +1300)]
talloc: Add tests for talloc_parent() after realloc() of the parent

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agotalloc: clarify that talloc_magic never includes the bits in TALLOC_FLAG_MASK
Andrew Bartlett [Tue, 22 Nov 2016 21:26:14 +0000 (10:26 +1300)]
talloc: clarify that talloc_magic never includes the bits in TALLOC_FLAG_MASK

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agotalloc: add ASCII art to describe parent/child arrangement
Andrew Bartlett [Mon, 28 Nov 2016 01:44:40 +0000 (14:44 +1300)]
talloc: add ASCII art to describe parent/child arrangement

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoFix typo
Alexis La Goutte [Wed, 26 Oct 2016 20:18:09 +0000 (22:18 +0200)]
Fix typo

Fix (minor) typo found in wireshark with lintian tools
https://code.wireshark.org/review/#/c/18485/

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopython: Add py3compat.h
Petr Viktorin [Tue, 28 Jun 2016 15:58:04 +0000 (17:58 +0200)]
python: Add py3compat.h

This adds a shared header file with macros that enable compatibility
between Python 2 and 3.
The macros are the ones used in ldb/tdb, with some additions
that make sense when the header is shared among several modules.
See the module for a summary of contents.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopython: samba.subunit.run: Fix Python 3 compatibility.
Lumir Balhar [Wed, 19 Oct 2016 11:32:59 +0000 (13:32 +0200)]
python: samba.subunit.run: Fix Python 3 compatibility.

Usage of function _test_id() which generates test id in bytes breaks
Python 3 compatibility. After fix, this function is not used any more.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopython: selftesthelpers: Add possibility for planning tests for
Lumir Balhar [Wed, 19 Oct 2016 18:51:47 +0000 (20:51 +0200)]
python: selftesthelpers: Add possibility for planning tests for
'extra_python' (Python 3).

This change allows us to mark modules which are Python 3 compatible
with the keyword argument `py3_compatible`. Then, if building with
Python 3 is configured using --extra-python, `planpythontestsuite`
will plan an extra Python test for each marked module.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agopython: wscript_build: Prepare build environment for Python 3 porting
Lumir Balhar [Wed, 19 Oct 2016 18:26:22 +0000 (20:26 +0200)]
python: wscript_build: Prepare build environment for Python 3 porting

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agojoin.py: Attempt to allocate a RID Set during the join
Andrew Bartlett [Mon, 31 Oct 2016 03:48:33 +0000 (16:48 +1300)]
join.py: Attempt to allocate a RID Set during the join

If we are joining the RID Manager, then we should get a RID Set, but
otherwise we should accept failure with the right error code

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoselftest: Ensure vampiredc has a full copy of localdc before we start
Andrew Bartlett [Wed, 30 Nov 2016 04:09:44 +0000 (17:09 +1300)]
selftest: Ensure vampiredc has a full copy of localdc before we start

Otherwise we may fail tests because we are still pulling in the full replica
from localdc during the tests.  This may block RID allocation in particular.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoselftest: Rework child process cleanup
Andrew Bartlett [Wed, 30 Nov 2016 01:18:46 +0000 (14:18 +1300)]
selftest: Rework child process cleanup

We now:
 - call gdb_backtrace on the stuck pid to determine why it is stuck
 - cleanup faster as we catch the process exit
   (by not waiting until 1 second after the exit for waitpid() to return -1)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agoselftest/gdb_*: make use of 'mktemp'
Stefan Metzmacher [Wed, 23 Nov 2016 11:26:18 +0000 (12:26 +0100)]
selftest/gdb_*: make use of 'mktemp'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
7 years agolibrpc: cab: Fix ndr_size_cab_file() to detect integer wrap.
Jeremy Allison [Wed, 30 Nov 2016 17:23:52 +0000 (09:23 -0800)]
librpc: cab: Fix ndr_size_cab_file() to detect integer wrap.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Dec  1 05:53:43 CET 2016 on sn-devel-144

7 years agolibrpc: cab: Integer wrap protection for ndr_count_cfdata().
Jeremy Allison [Wed, 30 Nov 2016 17:19:43 +0000 (09:19 -0800)]
librpc: cab: Integer wrap protection for ndr_count_cfdata().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agosmbclient: fix string formatting in print command
Douglas Bagnall [Tue, 1 Nov 2016 01:18:38 +0000 (14:18 +1300)]
smbclient: fix string formatting in print command

At one time, the variables lname and rname were char arrays, but now they
are pointers. When they were arrays, sizeof(rname) was the length of the
array, but now it gives the size of the pointer which is not what we want.

In the case where the filename is -, rname was alloced as size 1, which
could never fit the name it wanted to have contain ("stdin-<pid>").

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbd/service_stream: connection processing flag is not really bool
Douglas Bagnall [Wed, 30 Nov 2016 01:56:16 +0000 (14:56 +1300)]
smbd/service_stream: connection processing flag is not really bool

The warning is:

../source4/smbd/service_stream.c: In function ‘stream_io_handler’:
../source4/smbd/service_stream.c:94:18: warning: increment of a boolean expression [-Wbool-operation]
  conn->processing++;
                    ^~
../source4/smbd/service_stream.c:100:18: warning: decrement of a boolean expression [-Wbool-operation]
  conn->processing--;
                    ^~

while the code in question looks like:

conn->processing++;
if (flags & TEVENT_FD_WRITE) {
conn->ops->send_handler(conn, flags);
} else if (flags & TEVENT_FD_READ) {
conn->ops->recv_handler(conn, flags);
}
conn->processing--;

If this is never going to be nested, processing can be bool and the ++
and -- can be true/false assignments. But it seems possible that these
might be nested so it is better to go the other way.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Dec  1 00:28:05 CET 2016 on sn-devel-144

7 years agolib/registry/regf: better initialise nk_block
Douglas Bagnall [Wed, 30 Nov 2016 01:19:39 +0000 (14:19 +1300)]
lib/registry/regf: better initialise nk_block

We were initialising a uint32_t[5] block with memset(..., 5) when we
surely meant memset(..., 5 * sizeof(uint32_t)) or some equivalent.

Thanks go to gcc-7 and -Wmemset-elt-size. The warning looks like this:

../source4/lib/registry/regf.c: In function ‘reg_create_regf_file’:
../source4/lib/registry/regf.c:2095:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(nk.unk3, 0, 5);
    ^~~~~~

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoldb: Fix an unused variable warning
Volker Lendecke [Mon, 21 Nov 2016 20:41:51 +0000 (21:41 +0100)]
ldb: Fix an unused variable warning

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoldb: Fix typos
Volker Lendecke [Mon, 21 Nov 2016 20:40:21 +0000 (21:40 +0100)]
ldb: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agotdb: version 1.3.12 tdb-1.3.12
Stefan Metzmacher [Wed, 30 Nov 2016 15:05:28 +0000 (16:05 +0100)]
tdb: version 1.3.12

* Bug 12455 - tdb mutexes don't work on FreeBSD

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Nov 30 20:02:28 CET 2016 on sn-devel-144

7 years agoparam: fix lp_parameter_value_is_valid() for parametric options
Ralph Wuerthner [Mon, 28 Nov 2016 09:42:33 +0000 (10:42 +0100)]
param: fix lp_parameter_value_is_valid() for parametric options

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Nov 30 04:00:54 CET 2016 on sn-devel-144

7 years agotdb: Fix mutexes on FreeBSD
Volker Lendecke [Mon, 21 Nov 2016 20:00:01 +0000 (21:00 +0100)]
tdb: Fix mutexes on FreeBSD

susv4 on mmap has the following snippet:

> The state of synchronization objects such as mutexes, semaphores,
> barriers, and conditional variables placed in shared memory mapped
> with MAP_SHARED becomes undefined when the last region in any process
> containing the synchronization object is unmapped.

This means we can't keep the mutex mmap area unmapped at any point
in time.

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

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): Tue Nov 29 23:59:52 CET 2016 on sn-devel-144

7 years agotdb: Only mmap the mutex area if not already mmap'ed
Volker Lendecke [Mon, 21 Nov 2016 19:58:08 +0000 (20:58 +0100)]
tdb: Only mmap the mutex area if not already mmap'ed

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agotdb: NULL out tdb->mutexes in tdb_mutex_munmap
Volker Lendecke [Mon, 21 Nov 2016 19:56:55 +0000 (20:56 +0100)]
tdb: NULL out tdb->mutexes in tdb_mutex_munmap

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoctdb-common: Drop CTDB's copy of sys_read() and sys_write()
Martin Schwenke [Tue, 29 Nov 2016 01:55:06 +0000 (12:55 +1100)]
ctdb-common: Drop CTDB's copy of sys_read() and sys_write()

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): Tue Nov 29 11:22:40 CET 2016 on sn-devel-144

7 years agoctdb-lock-helper: Drop include of ctdb_private.h
Martin Schwenke [Tue, 29 Nov 2016 01:54:00 +0000 (12:54 +1100)]
ctdb-lock-helper: Drop include of ctdb_private.h

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agolib/util: Make sys_rw available to CTDB
Martin Schwenke [Tue, 29 Nov 2016 01:21:33 +0000 (12:21 +1100)]
lib/util: Make sys_rw available to CTDB

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agontlm_auth4: Remove it
Volker Lendecke [Tue, 22 Nov 2016 00:54:08 +0000 (01:54 +0100)]
ntlm_auth4: Remove it

This had install=False for rather exactly 4 years now. If someone wants to
start working on it again, we can always dig it up from the git history.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 29 02:18:37 CET 2016 on sn-devel-144

7 years agoctdb-daemon: Mark RecoverPDBBySeqNum tunable deprecated
Amitay Isaacs [Fri, 18 Nov 2016 04:09:26 +0000 (15:09 +1100)]
ctdb-daemon: Mark RecoverPDBBySeqNum tunable deprecated

Persistent databases are now always recovered by sequence number, so
there is no need for this tunable.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Nov 25 08:13:59 CET 2016 on sn-devel-144

7 years agoctdb-daemon: Remove unused code cmdline.[ch]
Amitay Isaacs [Fri, 18 Nov 2016 03:57:47 +0000 (14:57 +1100)]
ctdb-daemon: Remove unused code cmdline.[ch]

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-daemon: Consolidate command line options to ctdbd
Amitay Isaacs [Fri, 18 Nov 2016 03:52:38 +0000 (14:52 +1100)]
ctdb-daemon: Consolidate command line options to ctdbd

This inserts the code from ctdb_cmdline_init() function directly in
main(), so common/cmdline.[ch] can be removed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-tests: Remove unused test code
Amitay Isaacs [Fri, 18 Nov 2016 03:27:35 +0000 (14:27 +1100)]
ctdb-tests: Remove unused test code

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos4-torture: Add LZX compressed cabinet test
Günther Deschner [Fri, 23 Sep 2016 15:19:59 +0000 (17:19 +0200)]
s4-torture: Add LZX compressed cabinet test

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Nov 25 00:17:02 CET 2016 on sn-devel-144

7 years agos4-torture: Add MSZIP compressed cabinet test
Günther Deschner [Fri, 23 Sep 2016 15:19:25 +0000 (17:19 +0200)]
s4-torture: Add MSZIP compressed cabinet test

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4-torture: Add a validation test for uncompressed Cabinet files
Günther Deschner [Fri, 23 Sep 2016 15:20:30 +0000 (17:20 +0200)]
s4-torture: Add a validation test for uncompressed Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos4-torture: Introduce Cabinet ndr testsuite
Günther Deschner [Fri, 23 Sep 2016 15:18:12 +0000 (17:18 +0200)]
s4-torture: Introduce Cabinet ndr testsuite

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: Add ndr_cab_get_compression() for Cabinet compression evaluation
Günther Deschner [Mon, 19 Sep 2016 22:20:18 +0000 (00:20 +0200)]
librpc: Add ndr_cab_get_compression() for Cabinet compression evaluation

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: Add autogenerated file offset calculation for Cabinet files
Günther Deschner [Sat, 24 Sep 2016 00:51:20 +0000 (02:51 +0200)]
librpc: Add autogenerated file offset calculation for Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: Add autogenerated total cabinet size for Cabinet files
Günther Deschner [Tue, 20 Sep 2016 23:46:54 +0000 (01:46 +0200)]
librpc: Add autogenerated total cabinet size for Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: Add autogenerated checksum calculation for Cabinet files
Günther Deschner [Thu, 15 Sep 2016 22:15:30 +0000 (00:15 +0200)]
librpc: Add autogenerated checksum calculation for Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agolibrpc: Introduce cab.idl
Günther Deschner [Thu, 15 Sep 2016 11:36:35 +0000 (13:36 +0200)]
librpc: Introduce cab.idl

This allows processing of Windows Cabinet files (required for the MS-PAR
print protocol implementation)

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpcclient: Add AsyncCorePrinterDriverInstalled command
Günther Deschner [Tue, 22 Nov 2016 11:07:23 +0000 (12:07 +0100)]
s3-rpcclient: Add AsyncCorePrinterDriverInstalled command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpcclient: Add rpcclient IRemoteWinspool commands
Günther Deschner [Tue, 15 Jan 2013 14:22:43 +0000 (15:22 +0100)]
s3-rpcclient: Add rpcclient IRemoteWinspool commands

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3-rpc_cli: Support the use of the object_uuid in rpc_cli interfaces
Günther Deschner [Wed, 23 Jan 2013 09:34:12 +0000 (10:34 +0100)]
s3-rpc_cli: Support the use of the object_uuid in rpc_cli interfaces

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoWHATSNEW: document new inherit owner option
Uri Simchoni [Wed, 10 Aug 2016 05:38:59 +0000 (08:38 +0300)]
WHATSNEW: document new inherit owner option

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Thu Nov 24 20:23:46 CET 2016 on sn-devel-144

7 years agoWHATSNEW: document kerberos encryption types
Uri Simchoni [Wed, 10 Aug 2016 05:38:30 +0000 (08:38 +0300)]
WHATSNEW: document kerberos encryption types

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
7 years agodocs: fix funny typo in smb.conf manpage wrt Samba's FSRVP server.
Günther Deschner [Thu, 24 Nov 2016 11:16:51 +0000 (12:16 +0100)]
docs: fix funny typo in smb.conf manpage wrt Samba's FSRVP server.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 24 16:30:13 CET 2016 on sn-devel-144

7 years agoselftest: Fix timestamps on FreeBSD 11
Volker Lendecke [Wed, 23 Nov 2016 12:54:39 +0000 (13:54 +0100)]
selftest: Fix timestamps on FreeBSD 11

FreeBSD's date does not print the %, and \? does not catch that

Tested this manually:

$ echo 'time: 2016-11-23 12:52:19.123456Z'| sed 's/\..*NZ$/.000000Z/'
time: 2016-11-23 12:52:19.123456Z
$ echo 'time: 2016-11-23 12:52:19.%6NZ'| sed 's/\..*NZ$/.000000Z/'
time: 2016-11-23 12:52:19.000000Z
$ echo 'time: 2016-11-23 12:52:19.6NZ'| sed 's/\..*NZ$/.000000Z/'
time: 2016-11-23 12:52:19.000000Z
$ echo 'time: 2016-11-23 12:52:19.NZ'| sed 's/\..*NZ$/.000000Z/'
time: 2016-11-23 12:52:19.000000Z
$

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): Thu Nov 24 00:42:55 CET 2016 on sn-devel-144

7 years agos3/dump_core: Honour pipe symbol (|) in system-wide core_pattern under linux
Anoop C S [Wed, 16 Nov 2016 08:55:13 +0000 (08:55 +0000)]
s3/dump_core: Honour pipe symbol (|) in system-wide core_pattern under linux

From man core(5):

"Since  kernel  2.6.19, Linux supports an alternate syntax for the
/proc/sys/kernel/core_pattern file.  If the first character of this
file is a pipe symbol (|), then the remainder of the line is interpreted
as a user-space program to be executed."

Discarding this symbol would result in misleading logs for smbd/nmbd/winbindd.
For example even if core_pattern contains '|', smbd logs would suggest the
following:

...
dumping core in /var/log/samba/cores/smbd
...

and coredump may or may not get created at that location depending on which
helper binary is being used for handling coredumps.

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agoldb: version 1.1.28 ldb-1.1.28
Volker Lendecke [Sat, 12 Nov 2016 14:14:34 +0000 (14:14 +0000)]
ldb: version 1.1.28

* Fix the build with installed ldb-devel 1.1.27
  We depend on LDB_UNPACK_DATA_FLAG_NO_VALUES_ALLOC.

* Some build fixes.

* More performance improvements.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Nov 23 20:48:31 CET 2016 on sn-devel-144

7 years agopyldb: protect PyErr_LDB_ERROR_IS_ERR_RAISE() with do {} while(0)
Stefan Metzmacher [Tue, 8 Nov 2016 08:18:52 +0000 (09:18 +0100)]
pyldb: protect PyErr_LDB_ERROR_IS_ERR_RAISE() with do {} while(0)

This should avoid the following warning:

 CID 1394274:  Control flow issues  (DEADCODE)
 Execution cannot reach this statement: ";".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agos3-net: use SMB_SIGNING_DEFAULT in connect_to_service()
Günther Deschner [Fri, 18 Nov 2016 17:17:52 +0000 (18:17 +0100)]
s3-net: use SMB_SIGNING_DEFAULT in connect_to_service()

For non IPC$ connections we get NT_STATUS_REVISION_MISMATCH otherwise when using
the connection.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Nov 23 16:52:38 CET 2016 on sn-devel-144

7 years agoparam: validate value in lp_canonicalize_parameter_with_value()
Michael Adam [Wed, 23 Nov 2016 10:14:54 +0000 (11:14 +0100)]
param: validate value in lp_canonicalize_parameter_with_value()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoparam: use early return in lp_canonicalize_parameter_with_value()
Michael Adam [Wed, 23 Nov 2016 10:12:42 +0000 (11:12 +0100)]
param: use early return in lp_canonicalize_parameter_with_value()

This reduces the indentation and streamlines the flow.
View with "git show -w" to see it's mostly indentation change.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoparam: add lp_parameter_value_is_valid() function
Ralph Wuerthner [Mon, 21 Nov 2016 13:56:52 +0000 (14:56 +0100)]
param: add lp_parameter_value_is_valid() function

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonet conf: fix error message
Ralph Wuerthner [Tue, 22 Nov 2016 10:20:22 +0000 (11:20 +0100)]
net conf: fix error message

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
7 years agosamba_dnsupdate: Raise after the error count is incremented
Garming Sam [Mon, 25 Jul 2016 23:34:05 +0000 (11:34 +1200)]
samba_dnsupdate: Raise after the error count is incremented

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 Nov 22 05:59:40 CET 2016 on sn-devel-144

7 years agosamba_dnsupdate: cmd._run doesn't have Exceptions
Garming Sam [Tue, 26 Jul 2016 21:40:09 +0000 (09:40 +1200)]
samba_dnsupdate: cmd._run doesn't have Exceptions

It returns a return code of -1 instead.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agodoc: Add doxygen for functions in srv_keytab.c
Garming Sam [Thu, 15 Sep 2016 04:04:12 +0000 (16:04 +1200)]
doc: Add doxygen for functions in srv_keytab.c

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10882

7 years agos4-auth: Don't check for NULL saltPrincipal if it doesn't need it
Garming Sam [Wed, 7 Sep 2016 00:18:29 +0000 (12:18 +1200)]
s4-auth: Don't check for NULL saltPrincipal if it doesn't need it

This check causes 4.1 domains to be unable to change their DNS backend
correctly as they do not have the saltPrincipal value stored.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10882
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
7 years agoselftest: Ensure we catch errors from samba-tool domain tombstones expunge
Andrew Bartlett [Sun, 6 Nov 2016 22:58:04 +0000 (11:58 +1300)]
selftest: Ensure we catch errors from samba-tool domain tombstones expunge

The previous code would overwrite $? before the return, so always returned 0

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297

7 years agodbcheck: Correct message for orphaned backlinks
Andrew Bartlett [Sun, 6 Nov 2016 22:04:03 +0000 (11:04 +1300)]
dbcheck: Correct message for orphaned backlinks

The backlink name is in attrname, not in link_name

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297

7 years agodbcheck: Be more careful with link checks
Andrew Bartlett [Mon, 24 Oct 2016 21:10:34 +0000 (10:10 +1300)]
dbcheck: Be more careful with link checks

Here we are more careful when checking links, flagging errors only
when a non-deleted forward link appears incorrect.  In particular, we
trust the GUID more than we trust the name, as otherwise we can get
caught out if there is a swap of names, (the link should follow the
swap, staying on the same target GUID).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297

7 years agoselftest: Add test for link and deleted link behaviour in dbcheck
Andrew Bartlett [Sun, 6 Nov 2016 22:39:53 +0000 (11:39 +1300)]
selftest: Add test for link and deleted link behaviour in dbcheck

The other dbcheck tests were getting over-complex, so we start a new test
here based on tombestone-expunge.sh, as we are looking at very similar
problems

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297