]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
9 years agoctdb-tests: Replace ctdb_transaction with transaction_loop using new client API
Amitay Isaacs [Mon, 18 Apr 2016 07:11:36 +0000 (17:11 +1000)] 
ctdb-tests: Replace ctdb_transaction with transaction_loop using new client API

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Replace ctdb_fetch_readonly_loop with fetch_readonly_loop using new clien...
Amitay Isaacs [Sat, 21 Nov 2015 11:50:59 +0000 (22:50 +1100)] 
ctdb-tests: Replace ctdb_fetch_readonly_loop with fetch_readonly_loop using new client API

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Replace ctdb_fetch_readonly_once with fetch_readonly using new client API
Amitay Isaacs [Wed, 20 Apr 2016 04:49:47 +0000 (14:49 +1000)] 
ctdb-tests: Replace ctdb_fetch_readonly_once with fetch_readonly using new client API

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Replace ctdb_fetch_one with fetch_loop using new client API
Amitay Isaacs [Fri, 20 Nov 2015 05:24:34 +0000 (16:24 +1100)] 
ctdb-tests: Replace ctdb_fetch_one with fetch_loop using new client API

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Replace ctdb_fetch with fetch_ring using new client API
Amitay Isaacs [Tue, 17 Nov 2015 21:51:41 +0000 (08:51 +1100)] 
ctdb-tests: Replace ctdb_fetch with fetch_ring using new client API

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Replace ctdb_bench with message_ring using new client API
Amitay Isaacs [Tue, 10 Nov 2015 05:00:07 +0000 (16:00 +1100)] 
ctdb-tests: Replace ctdb_bench with message_ring using new client API

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Add torture test for g_lock functions
Amitay Isaacs [Tue, 19 Apr 2016 06:18:54 +0000 (16:18 +1000)] 
ctdb-tests: Add torture test for g_lock functions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Common code to process commandline options
Amitay Isaacs [Wed, 18 Nov 2015 01:46:08 +0000 (12:46 +1100)] 
ctdb-tests: Common code to process commandline options

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Common code to wait for synchronization across cluster
Amitay Isaacs [Wed, 18 Nov 2015 01:18:14 +0000 (12:18 +1100)] 
ctdb-tests: Common code to wait for synchronization across cluster

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoWHATSNEW: Add the update for the samba kcc
Garming Sam [Thu, 30 Jun 2016 00:19:32 +0000 (12:19 +1200)] 
WHATSNEW: Add the update for the samba kcc

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 Jul 21 10:17:52 CEST 2016 on sn-devel-144

9 years agosamba_kcc: Enable the python samba_kcc
Garming Sam [Wed, 29 Jun 2016 22:54:29 +0000 (10:54 +1200)] 
samba_kcc: Enable the python samba_kcc

For any reasonably large domain, the old KCC is impractical as the dense
mesh topology causes replication pulses.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agokcc: correct a typo in the debug messages
Garming Sam [Mon, 18 Jul 2016 02:38:40 +0000 (14:38 +1200)] 
kcc: correct a typo in the debug messages

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodbcheck: Add a rule regarding replica locations
Garming Sam [Mon, 18 Jul 2016 05:06:57 +0000 (17:06 +1200)] 
dbcheck: Add a rule regarding replica locations

This fixes any RW DCs with repsFrom without the corresponding link. On
any RODC, this just reports an error (and doesn't fix it).

(the knownfail entry is also now removed)

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodbcheck/release-4-1-0rc3: Add a check regarding replica locations
Garming Sam [Wed, 20 Jul 2016 00:47:11 +0000 (12:47 +1200)] 
dbcheck/release-4-1-0rc3: Add a check regarding replica locations

This DC has repsFrom for the DNS partitions, but not the corresponding
link. This ensures that dbcheck has fixed them up. This will currently
fail without the actual changes to dbcheck coming in the following
commit.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agojoin.py: Don't add replica locations without the backend
Garming Sam [Thu, 21 Jul 2016 04:01:20 +0000 (16:01 +1200)] 
join.py: Don't add replica locations without the backend

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agojoin.py: Add Replica-Locations for DomainDNS and ForestDNS
Garming Sam [Mon, 18 Jul 2016 01:09:59 +0000 (13:09 +1200)] 
join.py: Add Replica-Locations for DomainDNS and ForestDNS

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agojoin.py: Ensure that all expressions are escaped
Garming Sam [Wed, 20 Jul 2016 01:37:47 +0000 (13:37 +1200)] 
join.py: Ensure that all expressions are escaped

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodbcheck: Replica locations can now be leftover
Garming Sam [Thu, 21 Jul 2016 03:34:13 +0000 (15:34 +1200)] 
dbcheck: Replica locations can now be leftover

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agokcc: Make more fault tolerant on DC demotion
Garming Sam [Thu, 21 Jul 2016 01:08:31 +0000 (13:08 +1200)] 
kcc: Make more fault tolerant on DC demotion

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosamba_kcc: match translate connection from old KCC for RWDC
Garming Sam [Wed, 20 Jul 2016 22:42:14 +0000 (10:42 +1200)] 
samba_kcc: match translate connection from old KCC for RWDC

This makes it so that repsTo are always regenerated on the target DCs.
This also happens elsewhere in drepl_out, but is to be removed.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agosamba_kcc: match translate connection from old KCC for RODC
Garming Sam [Tue, 5 Jul 2016 03:57:28 +0000 (15:57 +1200)] 
samba_kcc: match translate connection from old KCC for RODC

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agokcc: Prevent the KCC from doing work on the RODC
Garming Sam [Fri, 1 Jul 2016 05:02:50 +0000 (17:02 +1200)] 
kcc: Prevent the KCC from doing work on the RODC

This should never have done any real work, new code or not. This just removes
the initial KCC calls and bails out in the KCC if we actually ran it.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoselftest: Add more information when KCC fails
Garming Sam [Thu, 21 Jul 2016 01:08:56 +0000 (13:08 +1200)] 
selftest: Add more information when KCC fails

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agokcc: Make debug more scarce
Garming Sam [Sun, 3 Jul 2016 23:17:45 +0000 (11:17 +1200)] 
kcc: Make debug more scarce

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agodrepl: Fix a typo
Garming Sam [Wed, 20 Jul 2016 21:08:11 +0000 (09:08 +1200)] 
drepl: Fix a typo

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoWHATSNEW: Samba-tool speed-up
Garming Sam [Thu, 21 Jul 2016 04:30:35 +0000 (16:30 +1200)] 
WHATSNEW: Samba-tool speed-up

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agoctdb-tests: Add shellcheck test suite
Martin Schwenke [Thu, 14 Jul 2016 02:01:14 +0000 (12:01 +1000)] 
ctdb-tests: Add shellcheck test suite

CTDB has a lot of scripts and shellcheck can be useful to find dubious
scripting practices.

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 Jul 21 06:06:49 CEST 2016 on sn-devel-144

9 years agoctdb-tests: Add new test support script for script install paths
Martin Schwenke [Thu, 14 Jul 2016 01:58:51 +0000 (11:58 +1000)] 
ctdb-tests: Add new test support script for script install paths

This helps unit tests locate CTDB's scripts.  It is being created to
support some new shellcheck unit tests.

Hopefully, it can also be used to simplify some of the symlink
complexity in some other unit tests suites, such as eventscripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2006 (legacy `..`)
Martin Schwenke [Thu, 14 Jul 2016 02:58:31 +0000 (12:58 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2006 (legacy `..`)

SC2006: Use $(..) instead of legacy `..`.

Make the obvious changes to $(...) but convert some to $((...)).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2124 (string=array)
Martin Schwenke [Thu, 14 Jul 2016 02:28:17 +0000 (12:28 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2124 (string=array)

SC2124: Assigning an array to a string!
        Assign as array, or use * instead of @ to concatenate.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2155 (declare, assign)
Martin Schwenke [Thu, 14 Jul 2016 02:27:05 +0000 (12:27 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2155 (declare, assign)

SC2155: Declare and assign separately to avoid masking return values.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2059 ($ in printf format)
Martin Schwenke [Thu, 14 Jul 2016 02:08:04 +0000 (12:08 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2059 ($ in printf format)

SC2059: Don't use variables in the printf format string.
        Use printf "..%s.." "$foo".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid chellcheck warning SC2012 (ls for file list)
Martin Schwenke [Wed, 13 Jul 2016 01:50:58 +0000 (11:50 +1000)] 
ctdb-scripts: Avoid chellcheck warning SC2012 (ls for file list)

SC2012: Use find instead of ls to better handle non-alphanumeric filenames.

Make this cope better with unexpected whitespace.

Unfortunately, this results in shellcheck warning:

  SC2035: Use ./*.tdb.* so names with dashes won't become options.

No!  Then stat(1) will print ./file.tdb.X.  We want the basenames and
we know the filenames don't start with dashes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2012 (ls for file list)
Martin Schwenke [Tue, 12 Jul 2016 20:53:21 +0000 (06:53 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2012 (ls for file list)

SC2012: Use find instead of ls to better handle non-alphanumeric filenames.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2038 (find without -print0)
Martin Schwenke [Tue, 12 Jul 2016 03:27:08 +0000 (13:27 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2038 (find without -print0)

SC2038: Use -print0/-0 or -exec + to allow for non-alphanumeric filenames.

The suggested options aren't POSIX-compliant.  This is more portable.

Base filenames can't have whitespace so rework to avoid problems with
whitespace in directory name.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2039 (non-portable ulimit options)
Martin Schwenke [Tue, 12 Jul 2016 02:15:12 +0000 (12:15 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2039 (non-portable ulimit options)

SC2039: In POSIX sh, ulimit -c/-n is not supported.

Have shellcheck suppress the warnings.  If -n is not supported then
don't set CTDB_MAX_OPEN_FILES.  If packaging for a platform where -c
is not supported then remove this code and associated documentation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2039 (test -nt operator)
Martin Schwenke [Tue, 12 Jul 2016 01:57:55 +0000 (11:57 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2039 (test -nt operator)

SC2039: In POSIX sh, -nt is not supported.

This script is specific to the Linux NFS implementation.  The -nt
operator is well supported in Linux shells (e.g. dash, bash, ksh).
The alternatives (e.g. using stat(1)) would result in less readable
code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2094 (read/write same file)
Martin Schwenke [Mon, 11 Jul 2016 10:53:56 +0000 (20:53 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2094 (read/write same file)

SC2094: Make sure not to read and write the same file in the same pipeline.

The semantics here are unclear, so use a separate flock file in each
case for clarity.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2039 (echo -n)
Martin Schwenke [Wed, 6 Jul 2016 20:41:27 +0000 (06:41 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2039 (echo -n)

SC2039: In POSIX sh, echo flags are not supported.

echo -n is well supported but the changes are simple.

Improve some logic, replace some instances with printf.  Who knew
printf was in POSIX?

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2039 (type command)
Martin Schwenke [Wed, 6 Jul 2016 10:43:29 +0000 (20:43 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2039 (type command)

SC2039: In POSIX sh, 'type' is not supported.

type is commonly supported and is more portable than which(1).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C)
Martin Schwenke [Wed, 6 Jul 2016 10:40:23 +0000 (20:40 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C)

SC2015: Note that A && B || C is not if-then-else. C may run when A is
true.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warnings SC2119, SC2120 (function arguments)
Martin Schwenke [Wed, 6 Jul 2016 10:25:57 +0000 (20:25 +1000)] 
ctdb-scripts: Avoid shellcheck warnings SC2119, SC2120 (function arguments)

SC2119: Use FUNC "$@" if function's $1 should meanscript's $1.
SC2120: FUNC references arguments, but none are ever passed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2002 (useless cat)
Martin Schwenke [Wed, 6 Jul 2016 10:17:26 +0000 (20:17 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2002 (useless cat)

SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2017 (arithmetic precision)
Martin Schwenke [Wed, 6 Jul 2016 10:14:03 +0000 (20:14 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2017 (arithmetic precision)

SC2017: Increase precision by replacing a/b*c with a*c/b.

This code intentionally rounds to an even value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC1004 (backslash in quotes)
Martin Schwenke [Wed, 6 Jul 2016 10:09:07 +0000 (20:09 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC1004 (backslash in quotes)

SC1004: You don't break lines with \ in single quotes, it results in
literal backslash-linefeed.

These don't hurt, since awk can cope with the continuations.  However,
they don't add anything.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2154 (unassigned variables)
Martin Schwenke [Wed, 6 Jul 2016 07:41:55 +0000 (17:41 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2154 (unassigned variables)

SC2154: VAR is referenced but not assigned.

Change ctdb_setup_service_state_dir(), ctdb_get_pnn() and
ctdb_get_ip_address() to print the value so it can be assigned to a
variable.  The performance gain from avoiding the sub-shells when
calling these functions is close to zero.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warnings SC2046, SC2086 (double-quoting)
Martin Schwenke [Wed, 6 Jul 2016 07:31:51 +0000 (17:31 +1000)] 
ctdb-scripts: Avoid shellcheck warnings SC2046, SC2086 (double-quoting)

SC2046: Quote this to prevent word splitting.
SC2086: Double quote to prevent globbing and word splitting.

Add some quoting where it makes sense.  Use shellcheck directives for
false-positives.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2034 (unused variables)
Martin Schwenke [Wed, 6 Jul 2016 07:16:44 +0000 (17:16 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2034 (unused variables)

SC2034: VAR appears unused. Verify it or export it.

Drop some variables that are unnecessarily used.  Use shellcheck
directive for false-positives.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2004 ($ in arithmetic)
Martin Schwenke [Wed, 6 Jul 2016 06:50:30 +0000 (16:50 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2004 ($ in arithmetic)

SC2004: $/${} is unnecessary on arithmetic variables.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warnings SC2030, SC2031 (subshell variables)
Martin Schwenke [Wed, 6 Jul 2016 06:13:27 +0000 (16:13 +1000)] 
ctdb-scripts: Avoid shellcheck warnings SC2030, SC2031 (subshell variables)

SC2030: Modification of VAR is local (to subshell caused by (..) group).
SC2031: VAR was modified in a subshell. That change might be lost.

Fix a related, incorrect comment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Avoid shellcheck warning SC2016 ($ in single quotes)
Martin Schwenke [Wed, 6 Jul 2016 05:22:19 +0000 (15:22 +1000)] 
ctdb-scripts: Avoid shellcheck warning SC2016 ($ in single quotes)

SC2016: Expressions don't expand in single quotes, use double quotes for that.

Error messages are now arguably more readable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Drop function ctdb_check_counter()
Martin Schwenke [Wed, 6 Jul 2016 05:11:43 +0000 (15:11 +1000)] 
ctdb-scripts: Drop function ctdb_check_counter()

It is no longer used and adds needless complexity.

As a side-effect, the functions file can now be parsed by shellcheck.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Drop use of ctdb_check_counter from vsftpd event script
Martin Schwenke [Wed, 6 Jul 2016 05:06:24 +0000 (15:06 +1000)] 
ctdb-scripts: Drop use of ctdb_check_counter from vsftpd event script

This makes the logic more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Drop use of ctdb_check_counter from reclock event script
Martin Schwenke [Wed, 6 Jul 2016 04:28:06 +0000 (14:28 +1000)] 
ctdb-scripts: Drop use of ctdb_check_counter from reclock event script

This makes the logic more obvious.

Fix the (probably) accidental fall-through to the regular monitor
failure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Drop use of ctdb_check_counter from httpd event script
Martin Schwenke [Wed, 6 Jul 2016 04:24:18 +0000 (14:24 +1000)] 
ctdb-scripts: Drop use of ctdb_check_counter from httpd event script

This makes the logic more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Drop use of service_tcp_ports
Martin Schwenke [Wed, 6 Jul 2016 04:32:38 +0000 (14:32 +1000)] 
ctdb-scripts: Drop use of service_tcp_ports

This makes the logic more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Event script indentation and whitespace cleanups
Martin Schwenke [Wed, 6 Jul 2016 04:44:14 +0000 (14:44 +1000)] 
ctdb-scripts: Event script indentation and whitespace cleanups

* Re-indent case labels as per new script style

  Other indentation can be tweaked later as code changes, but the
  labels are an obvious bulk change.

* Minor whitespace fixes

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Drop use of ctdb_standard_event_handler()
Martin Schwenke [Mon, 11 Jul 2016 05:04:16 +0000 (15:04 +1000)] 
ctdb-scripts: Drop use of ctdb_standard_event_handler()

It doesn't do anything.  Add a comment to its definition to explain
why it is still there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: New event script test for corrupt TDB checking
Martin Schwenke [Tue, 12 Jul 2016 20:44:08 +0000 (06:44 +1000)] 
ctdb-tests: New event script test for corrupt TDB checking

Ensures that backups of corrupt TDB files are correctly limited in
number.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Add new httpd event script test
Martin Schwenke [Mon, 11 Jul 2016 04:44:45 +0000 (14:44 +1000)] 
ctdb-tests: Add new httpd event script test

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Add new vsftpd event script test
Martin Schwenke [Tue, 5 Jul 2016 10:10:06 +0000 (20:10 +1000)] 
ctdb-tests: Add new vsftpd event script test

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Add reclock event script tests
Martin Schwenke [Wed, 6 Jul 2016 04:06:14 +0000 (14:06 +1000)] 
ctdb-tests: Add reclock event script tests

Tweak eventscript unit test infrastructure to support.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-scripts: Fix a bug in counter checking
Martin Schwenke [Tue, 5 Jul 2016 10:09:12 +0000 (20:09 +1000)] 
ctdb-scripts: Fix a bug in counter checking

If there are insufficient arguments then they can't be shifted.

This function will be removed shortly.  However, it needs to work for
now as tests will be added that depend on it to work.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agos4:torture/ndr: add more krb5pac tests with PAC blobs from pkinit
Stefan Metzmacher [Tue, 19 Jul 2016 14:32:06 +0000 (16:32 +0200)] 
s4:torture/ndr: add more krb5pac tests with PAC blobs from pkinit

We validate everything except the whole LOGON_INFO structure,
we even decrypt the PAC_CREDENTIALS_INFO blob and verify
PAC_CREDENTIAL_DATA_NDR and PAC_CREDENTIAL_NTLM_SECPKG.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 21 01:07:28 CEST 2016 on sn-devel-144

9 years agos4:torture/ndr: make use of torture_suite_add_ndr_pull_validate_test() in krb5pac...
Stefan Metzmacher [Tue, 19 Jul 2016 14:38:56 +0000 (16:38 +0200)] 
s4:torture/ndr: make use of torture_suite_add_ndr_pull_validate_test() in krb5pac when possible

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agokrb5_wrap: provide CKSUMTYPE_HMAC_SHA1_96_AES_*
Stefan Metzmacher [Tue, 19 Jul 2016 14:31:01 +0000 (16:31 +0200)] 
krb5_wrap: provide CKSUMTYPE_HMAC_SHA1_96_AES_*

MIT only defined this as CKSUMTYPE_HMAC_SHA1_96_AES128,
while Heimdal has CKSUMTYPE_HMAC_SHA1_96_AES_128.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agokrb5pac/netlogon: add a comment regarding PAC_LOGON_INFO unique pointers on push
Stefan Metzmacher [Thu, 14 Jul 2016 07:34:43 +0000 (09:34 +0200)] 
krb5pac/netlogon: add a comment regarding PAC_LOGON_INFO unique pointers on push

This difference is the reason why we can't fully (ndr)validate some
PAC blobs.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agotorture: Add another sample of a PAC that broke the old PAC_UPN_DNS_INFO handling
Andrew Bartlett [Tue, 19 Jul 2016 04:48:18 +0000 (16:48 +1200)] 
torture: Add another sample of a PAC that broke the old PAC_UPN_DNS_INFO handling

This is included because this sample helped us addres issues in the previous attempt at
handling PAC_UPN_DNS_INFO correctly, and I have Tris's permission to include this in our
tests.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-torture: add another krb5pac buffer to the ndr test.
Günther Deschner [Wed, 6 Feb 2013 12:10:44 +0000 (13:10 +0100)] 
s4-torture: add another krb5pac buffer to the ndr test.

This one nicely demonstrates that the strings are really non-null terminated.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-torture: add ndr krb5pac testsuite.
Günther Deschner [Thu, 13 Dec 2012 11:28:19 +0000 (12:28 +0100)] 
s4-torture: add ndr krb5pac testsuite.

Someone changed the PAC buffer union without adding proper tests, now we
sometimes fail to parse the PAC completely due to that...

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agokrb5pac.idl: implement PAC_UPN_DNS_INFO correct
Stefan Metzmacher [Wed, 6 Jan 2016 12:27:21 +0000 (13:27 +0100)] 
krb5pac.idl: implement PAC_UPN_DNS_INFO correct

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agokrb5pac: fix push/pull of subcontexts in PAC_BUFFER
Stefan Metzmacher [Wed, 6 Feb 2013 15:44:12 +0000 (16:44 +0100)] 
krb5pac: fix push/pull of subcontexts in PAC_BUFFER

We need to have two subcontexts to get the padding right,
the outer subcontext uses NDR_ROUND(_ndr_size, 8), while
the inner subcontext only uses _ndr_size.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agokrb5pac: no need for a noprint PAC_BUFFER.
Günther Deschner [Mon, 18 Mar 2013 15:25:06 +0000 (16:25 +0100)] 
krb5pac: no need for a noprint PAC_BUFFER.

Guenther

@@ -1,6 +1,7 @@
 _PUBLIC_ void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r)
 {
        ndr_print_struct(ndr, name, "PAC_BUFFER");
+       if (r == NULL) { ndr_print_null(ndr); return; }
        ndr->depth++;
        ndr_print_PAC_TYPE(ndr, "type", r->type);
        ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,0):r->_ndr_size);
@@ -11,7 +12,7 @@
                ndr_print_PAC_INFO(ndr, "info", r->info);
        }
        ndr->depth--;
-       ndr_print_uint32(ndr, "_pad", r->_pad);
+       ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
        ndr->depth--;
 }

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:torture/ndr: Add supplementalCredentials blob from Win2012R2
Andrew Bartlett [Wed, 20 Jul 2016 04:45:34 +0000 (16:45 +1200)] 
s4:torture/ndr: Add supplementalCredentials blob from Win2012R2

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:torture/ndr: Add supplementalCredentials blobs from alpha13 and release_4_1_0rc3
Andrew Bartlett [Wed, 20 Jul 2016 02:53:42 +0000 (14:53 +1200)] 
s4:torture/ndr: Add supplementalCredentials blobs from alpha13 and release_4_1_0rc3

This coveres the case without AES keys, and before the IDL was changed for SambaGPG support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:torture/ndr: add validation checks for strange supplementalCredentials blobs
Stefan Metzmacher [Fri, 15 Jul 2016 07:10:03 +0000 (09:10 +0200)] 
s4:torture/ndr: add validation checks for strange supplementalCredentials blobs

From the mail to dochelp:

  I've also got cases (where I created an account with
  UF_NORMAL_ACCOUNT|UF_ACCOUNTDISABLE|UF_SMARTCARD_REQUIRED
  in the LDAP add) with the following strange blobs:

  One time:
  [0000] 00 00 00 00 00 00 00 00 00 00 00 00 00

  and once:
  [0000] 00 00 00 00 00 00 00 00 00 00 00 00 53

  The original issue I reported was the following, a user was created
  with a password and then userAccountControl was changed to
  UF_NORMAL_ACCOUNT|UF_SMARTCARD_REQUIRED. In that case I'm getting:

  [0000] 00 00 00 00 62 00 00 00   00 00 00 00 20 00 20 00
  [0010] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0020] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0030] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0040] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0050] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0060] 20 00 20 00 20 00 20 00   20 00 20 00 50 00 30

As you see the last byte (unknown3) is always different on Windows,
but always 0x00 from Samba, so I used 0x00 in order to allow the
test to pass.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agos4-torture: rename torture_suite_add_ndr_pullpush_test to torture_suite_add_ndr_pull_...
Günther Deschner [Wed, 6 Feb 2013 11:34:53 +0000 (12:34 +0100)] 
s4-torture: rename torture_suite_add_ndr_pullpush_test to torture_suite_add_ndr_pull_validate_test.

Hoping the new name is not as confusing as the old name.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotorture: show the first differing byte and a dump in torture_assert_data_blob_equal().
Günther Deschner [Wed, 6 Feb 2013 11:25:43 +0000 (12:25 +0100)] 
torture: show the first differing byte and a dump in torture_assert_data_blob_equal().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Günther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agodrsblobs.idl: supplementalCredentialsSubBlob make it possible to parse strange blobs
Stefan Metzmacher [Fri, 20 May 2016 16:59:20 +0000 (18:59 +0200)] 
drsblobs.idl: supplementalCredentialsSubBlob make it possible to parse strange blobs

Windows omits the uint16 num_packages field when the packages array is empty.
This happens if the UF_SMARTCARD_REQUIRED flag is set for an account.

A user was created with a password and then userAccountControl was changed to
UF_NORMAL_ACCOUNT|UF_SMARTCARD_REQUIRED. In that case I'm getting
(as the whole supplementalCredentialsBlob):

[0000] 00 00 00 00 62 00 00 00   00 00 00 00 20 00 20 00   ....b... .... . .
[0010] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0020] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0030] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0040] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0050] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0060] 20 00 20 00 20 00 20 00   20 00 20 00 50 00 30       . . . .  . .P.0

I've also got cases (where I created an account with
UF_NORMAL_ACCOUNT|UF_ACCOUNTDISABLE|UF_SMARTCARD_REQUIRED
in the LDAP add) with the following strange blobs:

One time:
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 00
and once:
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 53

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agodrsblobs.idl: mark supplementalCredentialsSubBlob as nopull,nopush
Stefan Metzmacher [Fri, 20 May 2016 15:06:23 +0000 (17:06 +0200)] 
drsblobs.idl: mark supplementalCredentialsSubBlob as nopull,nopush

This commit moves the autogenerated ndr_{pull,push}_supplementalCredentialsSubBlob()
function to the handwritten librpc/ndr/ndr_drsblobs.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agos4:dsdb/password_hash: explicitly set SUPPLEMENTAL_CREDENTIALS_SIGNATURE
Stefan Metzmacher [Thu, 2 Jun 2016 17:57:15 +0000 (19:57 +0200)] 
s4:dsdb/password_hash: explicitly set SUPPLEMENTAL_CREDENTIALS_SIGNATURE

Typically this is automatically set in ndr_push_supplementalCredentialsBlob(),
but we need to change that behavior in order to handle strange formated
values.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agos3:libnet_dssync_keytab: ignore empty supplementalCredentialsBlob structures
Stefan Metzmacher [Fri, 3 Jun 2016 14:34:08 +0000 (16:34 +0200)] 
s3:libnet_dssync_keytab: ignore empty supplementalCredentialsBlob structures

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agos4:kdc: ignore empty supplementalCredentialsBlob structures
Stefan Metzmacher [Fri, 3 Jun 2016 14:34:08 +0000 (16:34 +0200)] 
s4:kdc: ignore empty supplementalCredentialsBlob structures

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
9 years agoctdb-tools: Avoid uninitialised memory access
Martin Schwenke [Wed, 20 Jul 2016 06:42:32 +0000 (16:42 +1000)] 
ctdb-tools: Avoid uninitialised memory access

==27786== Syscall param write(buf) points to uninitialised byte(s)
==27786==    at 0x62820D0: __write_nocancel (syscall-template.S:84)
==27786==    by 0x428B57: ctdb_queue_send (ctdb_io.c:322)
==27786==    by 0x41F3B1: ctdb_client_queue_pkt (ctdb_client.c:153)
==27786==    by 0x41F3B1: ctdb_client_send_message (ctdb_client.c:603)
==27786==    by 0x419FA3: srvid_broadcast.constprop.26 (ctdb.c:1965)
==27786==    by 0x41B869: control_reload_nodes_file (ctdb.c:5696)
==27786==    by 0x404DBA: main (ctdb.c:6008)
==27786==  Address 0x7ead310 is 144 bytes inside a block of size 168 alloc'd
==27786==    at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27786==    by 0x564DBEC: __talloc_with_prefix (talloc.c:675)
==27786==    by 0x564DBEC: __talloc (talloc.c:716)
==27786==    by 0x564DBEC: _talloc_named_const (talloc.c:873)
==27786==    by 0x564DBEC: _talloc_zero (talloc.c:2318)
==27786==    by 0x41E1E2: _ctdbd_allocate_pkt (ctdb_client.c:59)
==27786==    by 0x41F37D: ctdb_client_send_message (ctdb_client.c:594)
==27786==    by 0x419FA3: srvid_broadcast.constprop.26 (ctdb.c:1965)
==27786==    by 0x41B869: control_reload_nodes_file (ctdb.c:5696)
==27786==    by 0x404DBA: main (ctdb.c:6008)
==27786==

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-client: Fix access after free error
Martin Schwenke [Wed, 20 Jul 2016 04:41:13 +0000 (14:41 +1000)] 
ctdb-client: Fix access after free error

State is stolen onto tmp_ctx above so can't be referenced after
tmp_ctx is freed.  So, state->status has to be looked at earlier.

Moving it immediately before the talloc_free(tmp_ctx) isn't sufficient
because invoking the callback appears to cause a recursive call to
ctdb_control_recv(), which also frees state.

Referencing it at the top seems safe.

==23982== Invalid read of size 4
==23982==    at 0x4204AE: ctdb_control_recv (ctdb_client.c:1181)
==23982==    by 0x420645: invoke_control_callback (ctdb_client.c:971)
==23982==    by 0x5E675EC: tevent_common_loop_timer_delay (tevent_timed.c:341)
==23982==    by 0x5E68639: epoll_event_loop_once (tevent_epoll.c:911)
==23982==    by 0x5E66BD6: std_event_loop_once (tevent_standard.c:114)
==23982==    by 0x5E622EC: _tevent_loop_once (tevent.c:533)
==23982==    by 0x4255F7: ctdb_client_async_wait (ctdb_client.c:3385)
==23982==    by 0x42578A: ctdb_client_async_control (ctdb_client.c:3442)
==23982==    by 0x41B405: ctdb_get_nodes_files (ctdb.c:5488)
==23982==    by 0x41B405: check_all_node_files_are_identical (ctdb.c:5530)
==23982==    by 0x41B405: control_reload_nodes_file (ctdb.c:5673)
==23982==    by 0x404DBA: main (ctdb.c:6008)
==23982==  Address 0x7e98d9c is 108 bytes inside a block of size 168 free'd
==23982==    at 0x4C2CDFB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23982==    by 0x5652692: _tc_free_internal (talloc.c:1125)
==23982==    by 0x5652692: _tc_free_children_internal (talloc.c:1570)
==23982==    by 0x564B952: _tc_free_internal (talloc.c:1081)
==23982==    by 0x564B952: _talloc_free_internal (talloc.c:1151)
==23982==    by 0x564B952: _talloc_free (talloc.c:1693)
==23982==    by 0x4204C9: ctdb_control_recv (ctdb_client.c:1182)
==23982==    by 0x4207AA: async_callback (ctdb_client.c:3350)
==23982==    by 0x4204AD: ctdb_control_recv (ctdb_client.c:1179)
==23982==    by 0x420645: invoke_control_callback (ctdb_client.c:971)
==23982==    by 0x5E675EC: tevent_common_loop_timer_delay (tevent_timed.c:341)
==23982==    by 0x5E68639: epoll_event_loop_once (tevent_epoll.c:911)
==23982==    by 0x5E66BD6: std_event_loop_once (tevent_standard.c:114)
==23982==    by 0x5E622EC: _tevent_loop_once (tevent.c:533)
==23982==    by 0x4255F7: ctdb_client_async_wait (ctdb_client.c:3385)
==23982==  Block was alloc'd at
==23982==    at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23982==    by 0x564DBEC: __talloc_with_prefix (talloc.c:675)
==23982==    by 0x564DBEC: __talloc (talloc.c:716)
==23982==    by 0x564DBEC: _talloc_named_const (talloc.c:873)
==23982==    by 0x564DBEC: _talloc_zero (talloc.c:2318)
==23982==    by 0x42017F: ctdb_control_send (ctdb_client.c:1086)
==23982==    by 0x425746: ctdb_client_async_control (ctdb_client.c:3431)
==23982==    by 0x41B405: ctdb_get_nodes_files (ctdb.c:5488)
==23982==    by 0x41B405: check_all_node_files_are_identical (ctdb.c:5530)
==23982==    by 0x41B405: control_reload_nodes_file (ctdb.c:5673)
==23982==    by 0x404DBA: main (ctdb.c:6008)
==23982==

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-client: Fix incorrect variable reference
Martin Schwenke [Wed, 20 Jul 2016 04:46:58 +0000 (14:46 +1000)] 
ctdb-client: Fix incorrect variable reference

The point of this code is almost certainly to return non-zero when
state->errormsg is set.  So, return state->status if non-zero, -1
otherwise.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoWHATSNEW: Add features added for Samba 4.5
Andrew Bartlett [Tue, 19 Jul 2016 03:48:28 +0000 (15:48 +1200)] 
WHATSNEW: Add features added for Samba 4.5

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosamba-tool: Speed up all samba-tool commands
Garming Sam [Fri, 15 Jul 2016 02:29:02 +0000 (14:29 +1200)] 
samba-tool: Speed up all samba-tool commands

This in particular helps the docs.py test halve in time (at least on my machine)

NOTE: The removal of enable_null_tracking is required because we are no
longer importing join.py in every single samba-tool invocation. Without
removing this line, memory would be hanging from both the actual NULL
context and the talloc_null_context (causing a segfault at system_exit).

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Jul 20 12:47:24 CEST 2016 on sn-devel-144

9 years agonotifyd: Move BlockSignals calls to server.c
Volker Lendecke [Tue, 19 Jul 2016 12:36:07 +0000 (14:36 +0200)] 
notifyd: Move BlockSignals calls to server.c

notifyd_send() is called as part of smbd initialization both in normal daemon
mode after a fork, but also in interactive mode. In interactive mode, notifyd
should not modify the global signal state with BlockSignals(). This patch moves
the signal blocking to the place where we know that notifyd is a child daemon.

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): Wed Jul 20 09:04:00 CEST 2016 on sn-devel-144

9 years agosmbd: Re-register notify requests
Volker Lendecke [Tue, 21 Jun 2016 14:23:19 +0000 (16:23 +0200)] 
smbd: Re-register notify requests

When notifyd is restarted, the parent will broadcast that fact to all workers.
They will then re-register their notify requests.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Restart notifyd
Volker Lendecke [Fri, 24 Jun 2016 14:29:28 +0000 (16:29 +0200)] 
smbd: Restart notifyd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Store notify filters in fsp->notify
Volker Lendecke [Fri, 24 Jun 2016 14:27:34 +0000 (16:27 +0200)] 
smbd: Store notify filters in fsp->notify

When notifyd crashes, it will be restarted. We need to restore the filters with
notifyd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Log which notifyd was found
Volker Lendecke [Thu, 23 Jun 2016 12:24:32 +0000 (14:24 +0200)] 
smbd: Log which notifyd was found

Just a debugging aid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Remember notifyd's serverid
Volker Lendecke [Tue, 21 Jun 2016 12:13:06 +0000 (14:13 +0200)] 
smbd: Remember notifyd's serverid

Similarly to cleanupd, this is necessary to restart notifyd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agonotify_msg: Deregister handler upon talloc_free
Volker Lendecke [Tue, 21 Jun 2016 11:04:25 +0000 (13:04 +0200)] 
notify_msg: Deregister handler upon talloc_free

So far, we haven't TALLOC_FREE'ed the notify context. This will change.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Remove "listel" from notify_msg
Volker Lendecke [Tue, 14 Jun 2016 13:03:35 +0000 (15:03 +0200)] 
smbd: Remove "listel" from notify_msg

We have all information that was kept in "notify_list" in other parts of smbd
as well. The only possible downside of this patch is that we possibly have a
lot more fsp's than fsp's with notifies, so notify_callback() might be a bit
slower in this situation. If this turns out to be a problem, I'd rather put
some more smarts into the notifyd protocol to enable a better indexed
notify_callback(). For now, this avoids data to be kept in two places.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Protect notify_callback from stray pointers
Volker Lendecke [Tue, 14 Jun 2016 13:00:29 +0000 (15:00 +0200)] 
smbd: Protect notify_callback from stray pointers

This protection right now lives in notify_msg.c with the notify_list, but that
will go.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Pass "sconn" via notify to notify_callback()
Volker Lendecke [Tue, 14 Jun 2016 12:54:32 +0000 (14:54 +0200)] 
smbd: Pass "sconn" via notify to notify_callback()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: There's only one notify_callback
Volker Lendecke [Tue, 14 Jun 2016 09:55:13 +0000 (11:55 +0200)] 
smbd: There's only one notify_callback

We do not have different callbacks per notify, put the callback function into
the notify context

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Make notify_callback() public
Volker Lendecke [Tue, 14 Jun 2016 04:54:11 +0000 (06:54 +0200)] 
smbd: Make notify_callback() public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>