samba.git
15 months agonetlogon: Add a comment regarding one of the DC location calls
Garming Sam [Thu, 22 Mar 2018 03:54:59 +0000 (16:54 +1300)]
netlogon: Add a comment regarding one of the DC location calls

It appears to be basically deprecated, as it was superceded by other
calls. Presumably it is also unused.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
15 months agos3:cleanupd: sends MSG_SMB_UNLOCK twice to interested peers
Ralph Boehme [Tue, 1 May 2018 07:53:36 +0000 (09:53 +0200)]
s3:cleanupd: sends MSG_SMB_UNLOCK twice to interested peers

MSG_SMB_UNLOCK should be send to smbd that are waiting on blocked
byte-range-locks when a lock holder died.

In smbd_cleanupd_unlock() we do this twice: once via a broadcast and
then again via brl_revalidate() to processes that are actually recorded
in brlock.tdb.

As brl_revalidate() should already take care of signaling anyone who
would be interested in the message, there's no need to broadcast.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  4 03:02:28 CEST 2018 on sn-devel-144

15 months agos3:cleanupd: use MSG_SMB_BRL_VALIDATE to signal cleanupd unclean process shutdown
Ralph Boehme [Mon, 30 Apr 2018 17:03:41 +0000 (19:03 +0200)]
s3:cleanupd: use MSG_SMB_BRL_VALIDATE to signal cleanupd unclean process shutdown

Since 6423ca4bf293cac5e2f84b1a37bb29b06b5c05ed messaging_send_all()
broadcasts messages in a cluster, so cleanupd receives those broadcasts
and acts upon it by re-broadcasting the message. Result: message
storm.

By reactivating the currently unused MSG_SMB_BRL_VALIDATE for the
trigger message to cleanupd we avoid the storm.

Note that MSG_SMB_BRL_VALIDATE was unused only in the sense that noone
*listened* to it, but we were still *sending* the message in
smbd_parent_ctdb_reconfigured(). de6fe2a1dd6ab03b1c369b61da17fded72305b2d
removed listening for MSG_SMB_BRL_VALIDATE from cleanupd. This commits
brings it back.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
15 months agos3:smbspool: Fix cmdline argument handling
Andreas Schneider [Thu, 3 May 2018 08:17:12 +0000 (10:17 +0200)]
s3:smbspool: Fix cmdline argument handling

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Thu May  3 16:33:54 CEST 2018 on sn-devel-144

15 months agovfs_virusfilter_fsav: Initialize stack pointers per README.Coding
Andrew Bartlett [Thu, 3 May 2018 02:28:02 +0000 (14:28 +1200)]
vfs_virusfilter_fsav: Initialize stack pointers per README.Coding

This allows a build with --address-sanitizer

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agosamdb: fix wrong computer container dn for newcomputer
Joe Guo [Wed, 2 May 2018 04:41:04 +0000 (04:41 +0000)]
samdb: fix wrong computer container dn for newcomputer

CN=Users --> CN=Computers

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Rowland Penny <rpenny@samba.org>
15 months agoldb: Prepare to allow tests to operate on ldb_mdb (by using the GUID index)
Gary Lockyer [Tue, 6 Mar 2018 02:30:10 +0000 (15:30 +1300)]
ldb: Prepare to allow tests to operate on ldb_mdb (by using the GUID index)

The LMDB backend requires the GUID index mode, so prepare for it
by setting a unique objectGUID on each record.  Also prepare for the
index list to be optionally set as an attribute on the test object,
allowing the GUID index mode to be set later when LMDB is configured.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu May  3 11:08:12 CEST 2018 on sn-devel-144

15 months agotests/dlz_bind9: support for multiple db types by using ldb://
Gary Lockyer [Wed, 10 Jan 2018 23:40:01 +0000 (12:40 +1300)]
tests/dlz_bind9: support for multiple db types by using ldb://

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
15 months agotests: Replace some references to tdb with ldb://
Garming Sam [Thu, 4 Jan 2018 20:28:54 +0000 (09:28 +1300)]
tests: Replace some references to tdb with ldb://

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
15 months agoldb-samba: Handle generic ldb:// url scheme in ldb_relative_path()
Gary Lockyer [Tue, 6 Mar 2018 00:40:21 +0000 (13:40 +1300)]
ldb-samba: Handle generic ldb:// url scheme in ldb_relative_path()

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
15 months agoldb: Introduce new generic ldb:// prefix to allow backend autodetection
Gary Lockyer [Tue, 6 Mar 2018 02:11:23 +0000 (15:11 +1300)]
ldb: Introduce new generic ldb:// prefix to allow backend autodetection

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
15 months agodsdb:schema_load: make use of ldb_relative_path() in partition_metadata_open()
Gary Lockyer [Tue, 6 Mar 2018 00:40:21 +0000 (13:40 +1300)]
dsdb:schema_load: make use of ldb_relative_path() in partition_metadata_open()

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
15 months agodsdb:partition_metadata: make use of ldb_relative_path() in partition_metadata_open()
Gary Lockyer [Tue, 6 Mar 2018 00:40:21 +0000 (13:40 +1300)]
dsdb:partition_metadata: make use of ldb_relative_path() in partition_metadata_open()

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
15 months agoldb tests: add cmocka tests of kv operation interactions with transactions
Gary Lockyer [Mon, 19 Mar 2018 23:15:12 +0000 (12:15 +1300)]
ldb tests: add cmocka tests of kv operation interactions with transactions

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
15 months agoldb tests: api ensure database correctly populated
Gary Lockyer [Mon, 19 Mar 2018 23:14:10 +0000 (12:14 +1300)]
ldb tests: api ensure database correctly populated

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
15 months agoldb_tdb: Disallow reads without a transaction or read lock
Andrew Bartlett [Wed, 4 Apr 2018 05:21:30 +0000 (17:21 +1200)]
ldb_tdb: Disallow reads without a transaction or read lock

This will ensure we match LMDB behaviour and avoid a repeat of the per-record locking
issues (compared with full DB locking) we had before Samba 4.7.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
15 months agoldb_tdb: Disallow TDB nested transactions and use tdb_transaction_active()
Gary Lockyer [Thu, 22 Mar 2018 22:28:18 +0000 (11:28 +1300)]
ldb_tdb: Disallow TDB nested transactions and use tdb_transaction_active()

This avoids keeping a counter, which can be error-prone.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
15 months agoldb_tdb: Do not make search or DB modifications without a lock
Gary Lockyer [Thu, 22 Mar 2018 22:27:10 +0000 (11:27 +1300)]
ldb_tdb: Do not make search or DB modifications without a lock

The ldb_cache startup code would previously not take a read lock
nor a sufficiently wide write transaction.

The new code takes a read lock, and if it needs to write takes a
write lock (transaction) and re-reads before continuing.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
15 months agoldb: make key/value backends expose if there is an active transaction
Gary Lockyer [Mon, 19 Mar 2018 22:25:28 +0000 (11:25 +1300)]
ldb: make key/value backends expose if there is an active transaction

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
15 months agoldb_tdb: Make sure max_key_length != 0 requires a GUID index mode
Gary Lockyer [Tue, 6 Mar 2018 02:27:51 +0000 (15:27 +1300)]
ldb_tdb: Make sure max_key_length != 0 requires a GUID index mode

We need to enforce the GUID index mode so end-users do not get a supprise
in mid-operation and we enforce a max key length of 511 so that the
index key trunctation is done correctly.

Otherwise the DB will appear to work until a very long key (DN or index)
is used, after which it will be sad.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
15 months agoldb/tests: don't use TEVENT_DEPRECATED in ldb_kv_ops_test.c
Stefan Metzmacher [Thu, 12 Apr 2018 12:31:20 +0000 (14:31 +0200)]
ldb/tests: don't use TEVENT_DEPRECATED in ldb_kv_ops_test.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
15 months agogitlab-ci: Run samba-ad-dc-2 in the shared environment
Andrew Bartlett [Mon, 30 Apr 2018 08:38:43 +0000 (20:38 +1200)]
gitlab-ci: Run samba-ad-dc-2 in the shared environment

This will allow more AD DC tests to run for those without access
to a private gitlab runner.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agogitlab-ci: Use YAML templates to reduce duplication
Andrew Bartlett [Mon, 30 Apr 2018 08:31:19 +0000 (20:31 +1200)]
gitlab-ci: Use YAML templates to reduce duplication

Inspired by WIP patches by Jamie McClymont

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agogitlab-ci: split up gitlab-ci file
Andrew Bartlett [Mon, 30 Apr 2018 08:18:52 +0000 (20:18 +1200)]
gitlab-ci: split up gitlab-ci file

The "private" build environments are not available to most users so
remove this from the default build.  Only developers with access
to private runners (rather than a shared runner) will have a runner
tagged as "private".

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agoautobuild: Extend build combinations tested to include --without-ldap
Andrew Bartlett [Tue, 1 May 2018 21:04:51 +0000 (09:04 +1200)]
autobuild: Extend build combinations tested to include --without-ldap

This bumps --without-ads to the samba-nt4 job so that option alone is still covered.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agoselftest: Allow make test to run with --address-sanitizer
Andrew Bartlett [Thu, 3 May 2018 03:47:45 +0000 (15:47 +1200)]
selftest: Allow make test to run with --address-sanitizer

Recent GCC versions enforce that the library must be in LD_PRELOAD if linked to a plugin
(like a python module).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agos4-lsa: Fix use-after-free in LSA server
Andrew Bartlett [Thu, 3 May 2018 04:22:19 +0000 (16:22 +1200)]
s4-lsa: Fix use-after-free in LSA server

This is a regression introduced in ab7988aa2fd1a43f576a4b73a6893c61c7ef1957.

The state variable contains the data to be returned to the client
and packed into NDR after the function returned.

This memory needs to be kept (on mem_ctx as parent) until that is
pushed and freed by the caller.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agoFix some incorrect debug messages that look to be copy-paste issues.
Richard Sharpe [Wed, 2 May 2018 22:12:44 +0000 (15:12 -0700)]
Fix some incorrect debug messages that look to be copy-paste issues.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu May  3 08:16:26 CEST 2018 on sn-devel-144

15 months agopython.gpo.ADS_STRUCT: check type of loadparm argument
Douglas Bagnall [Fri, 13 Apr 2018 00:29:05 +0000 (12:29 +1200)]
python.gpo.ADS_STRUCT: check type of loadparm argument

And add a test showning the segfault.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
15 months agosamba_dnsupdate: Put samba.kcc import after path insert of bin/python
Garming Sam [Tue, 27 Mar 2018 02:24:44 +0000 (15:24 +1300)]
samba_dnsupdate: Put samba.kcc import after path insert of bin/python

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
15 months agos3: libsmbclient: Fix hard-coded connection error return of ETIMEDOUT.
Jeremy Allison [Wed, 2 May 2018 18:19:31 +0000 (11:19 -0700)]
s3: libsmbclient: Fix hard-coded connection error return of ETIMEDOUT.

We shouldn't hard-code the connection error as ETIMEDOUT when
we have a perfectly good NT_STATUS to map from.

Found by the ChromeOS guys trying to connect an SMB2-only client
to an SMB1-only supporting server.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  3 02:42:20 CEST 2018 on sn-devel-144

15 months agos3: VFS: Default. Move vfs_read_data() out of source3/smbd/vfs.c to the printing...
Jeremy Allison [Mon, 30 Apr 2018 17:15:49 +0000 (10:15 -0700)]
s3: VFS: Default. Move vfs_read_data() out of source3/smbd/vfs.c to the printing code, which is the only caller.

Make static.

Signed-off-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 May  2 22:20:23 CEST 2018 on sn-devel-144

15 months agos3: VFS: default: Remove recursion into the VFS inside the default pread call.
Jeremy Allison [Mon, 30 Apr 2018 16:51:34 +0000 (09:51 -0700)]
s3: VFS: default: Remove recursion into the VFS inside the default pread call.

We already know we're at the POSIX level here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
15 months agos3: VFS: default: Remove fallback if we don't have HAVE_PREAD set. Samba doesn't...
Jeremy Allison [Mon, 30 Apr 2018 16:50:04 +0000 (09:50 -0700)]
s3: VFS: default: Remove fallback if we don't have HAVE_PREAD set. Samba doesn't work without pread.

Start of the changes to remove synchronous VFS read.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
15 months agos3: VFS: Remove fsync_fn() from the VFS and all modules. VFS ABI change.
Jeremy Allison [Sat, 28 Apr 2018 00:06:10 +0000 (17:06 -0700)]
s3: VFS: Remove fsync_fn() from the VFS and all modules. VFS ABI change.

Signed-off-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 May  2 01:06:28 CEST 2018 on sn-devel-144

15 months agos3: vfs: Use the new smb_vfs_fsync_sync() call in place of SMB_VFS_FSYNC().
Jeremy Allison [Fri, 27 Apr 2018 23:59:42 +0000 (16:59 -0700)]
s3: vfs: Use the new smb_vfs_fsync_sync() call in place of SMB_VFS_FSYNC().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
15 months agos3: VFS: Add a synchronous smb_vfs_fsync_sync() call, built from async primitives.
Jeremy Allison [Fri, 27 Apr 2018 23:59:02 +0000 (16:59 -0700)]
s3: VFS: Add a synchronous smb_vfs_fsync_sync() call, built from async primitives.

Will be used in the next commit.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
15 months agoctdb-scripts: Remove function rewrite_ctdb_options()
Martin Schwenke [Thu, 19 Apr 2018 11:57:07 +0000 (21:57 +1000)]
ctdb-scripts: Remove function rewrite_ctdb_options()

This is no longer necessary after the removal of support for
CTDB_DBDIR=tmpfs.

File-local variable ctdb_rundir is no longer used, so drop it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue May  1 16:20:37 CEST 2018 on sn-devel-144

15 months agoctdb-scripts: Drop support for CTDB_DBDIR=tmpfs
Martin Schwenke [Thu, 19 Apr 2018 11:54:11 +0000 (21:54 +1000)]
ctdb-scripts: Drop support for CTDB_DBDIR=tmpfs

CTDB has no business mounting filesystems.  Instead, documentation
for the new configuration system will include a recommendation that a
tmpfs be mounted on the volatile database directory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Change default volatile database directory
Martin Schwenke [Thu, 26 Apr 2018 01:58:13 +0000 (11:58 +1000)]
ctdb-daemon: Change default volatile database directory

Volatile databases now have their own subdirectory.  This makes things
easier if we later recommend mounting a tmpfs on the volatile database
directory, rather than supporting the current CTDB_DBDIR=tmpfs magic.

No need to create database directories for local daemon tests.  ctdbd
will do that.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-tests: CTDB_DBDIR_PERSISTENT should not depend on CTDB_DBDIR
Martin Schwenke [Mon, 30 Apr 2018 10:44:36 +0000 (20:44 +1000)]
ctdb-tests: CTDB_DBDIR_PERSISTENT should not depend on CTDB_DBDIR

Add new variable CTDB_DBDIR_BASE, just for event script unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Fix location of persistent databases
Martin Schwenke [Mon, 30 Apr 2018 10:26:20 +0000 (20:26 +1000)]
ctdb-scripts: Fix location of persistent databases

If CTDB_DBDIR_PERSISTENT is not set then set the default relative to
CTDB_VARDIR.  The persistent database directory is not (necessarily)
relative to the volatile one.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-tests: Fix location of persistent databases
Martin Schwenke [Mon, 30 Apr 2018 10:24:40 +0000 (20:24 +1000)]
ctdb-tests: Fix location of persistent databases

Always use CTDB_DBDIR_PERSISTENT, which is setup by the test
infrastructure.  The persistent database directory is
not (necessarily) relative to the volatile one.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Drop UDP/file logging warning from ctdbd_wrapper
Martin Schwenke [Mon, 16 Apr 2018 09:08:20 +0000 (19:08 +1000)]
ctdb-scripts: Drop UDP/file logging warning from ctdbd_wrapper

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Log the logging location when not logging via syslog()
Martin Schwenke [Mon, 16 Apr 2018 09:05:54 +0000 (19:05 +1000)]
ctdb-daemon: Log the logging location when not logging via syslog()

A variant of this is currently done by the wrapper but will be removed
from there because the wrapper will no longer see the CTDB_LOGGING
option.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Drop warning when there is no recovery lock
Martin Schwenke [Sat, 14 Apr 2018 11:38:32 +0000 (21:38 +1000)]
ctdb-scripts: Drop warning when there is no recovery lock

After configuration changes ctdbd_wrapper will no longer see the
CTDB_RECOVERY_LOCK option.  The daemon already logs a warning if the
recovery lock is not set, so simply drop this extra warning.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Reorder main() to improve the structure
Martin Schwenke [Wed, 18 Apr 2018 00:57:54 +0000 (10:57 +1000)]
ctdb-daemon: Reorder main() to improve the structure

Move code into clearly defined sections.  Add a fail label for fatal
errors to ensure memory is freed.  Modernise debug messages.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Consolidate basic CTDB context initialisation
Martin Schwenke [Wed, 18 Apr 2018 04:44:01 +0000 (14:44 +1000)]
ctdb-daemon: Consolidate basic CTDB context initialisation

None of this initialisation needs configuration options, so centralise
it with the context initialisation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Drop duplicate initialisation of request ID context
Martin Schwenke [Wed, 18 Apr 2018 00:51:26 +0000 (10:51 +1000)]
ctdb-daemon: Drop duplicate initialisation of request ID context

This doesn't require configuration options so keep the instance in
ctdb_init().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Move ctdb_init() to the only place it is used
Martin Schwenke [Wed, 18 Apr 2018 00:36:05 +0000 (10:36 +1000)]
ctdb-daemon: Move ctdb_init() to the only place it is used

This used to be used by client code but not anymore, so move it to
where it is used.  Drop the comment because it is wrong.  Modernise
logging.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-docs: Move remaining test options to README
Martin Schwenke [Thu, 5 Apr 2018 06:12:31 +0000 (16:12 +1000)]
ctdb-docs: Move remaining test options to README

Test options do not belong in the user documentation.  Move them to
the README file in the tests/ subdirectory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Drop ctdbd --torture and --valgrinding options
Martin Schwenke [Wed, 18 Apr 2018 00:21:20 +0000 (10:21 +1000)]
ctdb-daemon: Drop ctdbd --torture and --valgrinding options

These haven't been used by anyone in a long time.  --valgrinding is
less use with CTDB_VALGRINDING now gone.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Drop CTDB_VALGRIND testing option
Martin Schwenke [Mon, 30 Apr 2018 06:01:57 +0000 (16:01 +1000)]
ctdb-scripts: Drop CTDB_VALGRIND testing option

This is too inflexible for general use.  There is no use finding a new
home for this in the new configuration scheme.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Drop ctdbd --sloppy-start and --nopublicipcheck options
Martin Schwenke [Thu, 5 Apr 2018 06:25:14 +0000 (16:25 +1000)]
ctdb-daemon: Drop ctdbd --sloppy-start and --nopublicipcheck options

CTDB_LOCAL_DAEMON_MODE=yes is used instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-tests: Make local daemon tests depend on CTDB_TEST_MODE
Martin Schwenke [Thu, 5 Apr 2018 05:46:53 +0000 (15:46 +1000)]
ctdb-tests: Make local daemon tests depend on CTDB_TEST_MODE

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Add testing environment variable CTDB_TEST_MODE
Martin Schwenke [Thu, 5 Apr 2018 05:37:42 +0000 (15:37 +1000)]
ctdb-daemon: Add testing environment variable CTDB_TEST_MODE

This is a generic indicator that tests are being run.

For local daemons, this will replace --sloppy-start and
--nopublicipcheck - it also does --nosetsched, which isn't being
removed at this point.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Drop ctdbd --notification-script command-line option
Martin Schwenke [Thu, 29 Mar 2018 04:25:47 +0000 (15:25 +1100)]
ctdb-daemon: Drop ctdbd --notification-script command-line option

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Drop CTDB_NOTIFY_SCRIPT configuration option
Martin Schwenke [Thu, 29 Mar 2018 04:11:04 +0000 (15:11 +1100)]
ctdb-scripts: Drop CTDB_NOTIFY_SCRIPT configuration option

Notification scripts are installed into $CTDB_BASE/notify.d/ and are
always run by notify.sh.  Leave notify.sh where it is for now but no
longer consider it a configuration file.  This is an interim measure
and will be changed again soon.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-tests: Ensure notify.sh is available to local daemons
Martin Schwenke [Fri, 30 Mar 2018 09:46:41 +0000 (20:46 +1100)]
ctdb-tests: Ensure notify.sh is available to local daemons

Changes to notification configuration are coming, so ensure notify.sh
is always "installed" for local daemons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Provide a default location for the notification script
Martin Schwenke [Thu, 29 Mar 2018 03:58:49 +0000 (14:58 +1100)]
ctdb-daemon: Provide a default location for the notification script

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Use a local variable instead of repeating getenv()
Martin Schwenke [Thu, 26 Apr 2018 10:32:30 +0000 (20:32 +1000)]
ctdb-daemon: Use a local variable instead of repeating getenv()

Makes the error handling easier and the code more compact.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Drop unused function ctdb_set_notification_script()
Martin Schwenke [Thu, 29 Mar 2018 04:32:53 +0000 (15:32 +1100)]
ctdb-daemon: Drop unused function ctdb_set_notification_script()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-daemon: Set ctdb->notification_script directly
Martin Schwenke [Thu, 29 Mar 2018 03:50:17 +0000 (14:50 +1100)]
ctdb-daemon: Set ctdb->notification_script directly

This doesn't need a wrapper function.  It gets in the way if building
a value involves allocating memory (e.g. talloc_asprintf()) and then
ctdb_set_notification_script() duplicates that memory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-docs: Move some configuration options out of the debug section
Martin Schwenke [Tue, 1 May 2018 04:05:32 +0000 (14:05 +1000)]
ctdb-docs: Move some configuration options out of the debug section

These aren't test options so improve their visibility.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-docs: Move some ctdbd options out of the debug section
Martin Schwenke [Thu, 5 Apr 2018 06:11:48 +0000 (16:11 +1000)]
ctdb-docs: Move some ctdbd options out of the debug section

ctdbd -i might be useful with systemd or similar, so should be
documented.

--nosetsched and --script-log-level options are valid user-level
options.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-build: Rename ctdb-client2 subsystem to ctdb-client
Amitay Isaacs [Mon, 30 Apr 2018 09:38:47 +0000 (19:38 +1000)]
ctdb-build: Rename ctdb-client2 subsystem to ctdb-client

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
15 months agoctdb-daemon: Move ctdb_client.c to server/ subdir
Amitay Isaacs [Mon, 30 Apr 2018 09:36:43 +0000 (19:36 +1000)]
ctdb-daemon: Move ctdb_client.c to server/ subdir

It is used only by the code in the server directory.  It's mainly used
in recovery daemon and vacuuming child process.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
15 months agoctdb-build: Drop unnessary dependency on ctdb-client
Amitay Isaacs [Mon, 30 Apr 2018 09:37:04 +0000 (19:37 +1000)]
ctdb-build: Drop unnessary dependency on ctdb-client

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
15 months agoctdb-client: Remove ununsed functions from old client code
Amitay Isaacs [Mon, 30 Apr 2018 09:32:13 +0000 (19:32 +1000)]
ctdb-client: Remove ununsed functions from old client code

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
15 months agoceph: VFS: Add asynchronous fsync to ceph module, fake using synchronous call.
Jeremy Allison [Fri, 27 Apr 2018 21:25:54 +0000 (14:25 -0700)]
ceph: VFS: Add asynchronous fsync to ceph module, fake using synchronous call.

This will allow me to ultimately simplify the VFS by removing the synchronous
fsync VFS call.

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

Signed-off-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): Mon Apr 30 21:48:55 CEST 2018 on sn-devel-144

15 months agopython/samba: Py2/Py3 compat change '/' to '//' to ensure int result
Noel Power [Fri, 27 Apr 2018 07:15:28 +0000 (08:15 +0100)]
python/samba: Py2/Py3 compat change '/' to '//' to ensure int result

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Apr 30 18:25:25 CEST 2018 on sn-devel-144

15 months agopython/samba: port some isinstance str checks (to cater for unicode)
Noel Power [Thu, 26 Apr 2018 09:38:57 +0000 (10:38 +0100)]
python/samba: port some isinstance str checks (to cater for unicode)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agopython: Bulk conversion callers of ldb.Dn second param
Noel Power [Wed, 25 Apr 2018 19:01:49 +0000 (20:01 +0100)]
python: Bulk conversion callers of ldb.Dn second param

Convert second param passed to ldb.Dn to be unicode so py2 & py3 code
will work

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agopython/samba: bulk conversion of caller to dsdb_Dn 2nd param.
Noel Power [Wed, 25 Apr 2018 17:28:30 +0000 (18:28 +0100)]
python/samba: bulk conversion of caller to dsdb_Dn 2nd param.

Convert second param to dsdb_Dn to be unicode so py2 & py3 code
will work

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agopython/samba: Add binary_type for p2/p3 testing.
Noel Power [Tue, 24 Apr 2018 15:28:41 +0000 (16:28 +0100)]
python/samba: Add binary_type for p2/p3 testing.

For helping test for binary types, binary_type evaluates to 'str'
in py2, and 'bytes' in py3.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agoAdd aliases for StringIO.StringIO
Noel Power [Tue, 17 Apr 2018 12:52:58 +0000 (13:52 +0100)]
Add aliases for StringIO.StringIO

cStringIO doesn't handle unicode, StringIO does. With py2/py3
compatable code we can easily find ourselves getting passed
unicode so we don't alias cStringIO

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agopython/samba: Add some compatability PY2/PY3 functions
Noel Power [Fri, 13 Apr 2018 10:19:10 +0000 (11:19 +0100)]
python/samba: Add some compatability PY2/PY3 functions

I hope these changes are a short term interim solution for the
absence of the 'six' module/library. I also hope that soon this
module can be removed and be replaced by usage of six.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agos4/param: Additionally accept unicode as string param in Py2
Noel Power [Fri, 13 Apr 2018 16:34:40 +0000 (17:34 +0100)]
s4/param: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agos4/librpc: Additionally accept unicode as string param in Py2
Noel Power [Fri, 13 Apr 2018 16:34:19 +0000 (17:34 +0100)]
s4/librpc: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agos4/dsdb: Additionally accept unicode as string param in Py2
Noel Power [Fri, 13 Apr 2018 16:33:47 +0000 (17:33 +0100)]
s4/dsdb: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agos4/auth: Additionally accept unicode as string param in Py2
Noel Power [Fri, 13 Apr 2018 16:33:10 +0000 (17:33 +0100)]
s4/auth: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agolibcli/nbt: Additionally accept unicode as string param in Py2
Noel Power [Fri, 13 Apr 2018 16:32:15 +0000 (17:32 +0100)]
libcli/nbt: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agolib/tevent: Additionally accept unicode as string param in Py2
Noel Power [Fri, 13 Apr 2018 16:17:20 +0000 (17:17 +0100)]
lib/tevent: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agolib/ldb: Additionally accept unicode as string param in Py2
Noel Power [Thu, 12 Apr 2018 13:46:59 +0000 (14:46 +0100)]
lib/ldb: Additionally accept unicode as string param in Py2

With the changes to make samba python code Py2/Py3 compatible there
now are many instances where string content is decoded.
Decoded string variables in Py2 are returned as the unicode type. Many
Py2 c-module functions that take string arguments only check for the
string type. However now it's quite possibe the content formally passed
as a string argument is now passed as unicode after being decoded,
such arguments are rejected and code can fail subtly. This only affects
places where the type is directly checked e.g. via PyStr_Check etc.
arguments that are parsed by ParseTuple* functions generally already
accept both string and unicode (if 's', 'z', 's*' format specifiers
are used)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
15 months agosamba-tool visualize: use correct DC in graph label
Douglas Bagnall [Thu, 19 Apr 2018 22:52:31 +0000 (10:52 +1200)]
samba-tool visualize: use correct DC in graph label

We have been using a random DC (depending to hash order, which was not
random enough on Python 2.7 to affect the tests).

Reported-by: Noel Power <noel.power@suse.com>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
15 months agoctdb-tests: Fix a typo
Martin Schwenke [Mon, 30 Apr 2018 02:07:48 +0000 (12:07 +1000)]
ctdb-tests: Fix a typo

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Apr 30 14:26:43 CEST 2018 on sn-devel-144

15 months agoctdb-tests: Simplify a test
Martin Schwenke [Mon, 26 Feb 2018 19:40:59 +0000 (06:40 +1100)]
ctdb-tests: Simplify a test

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Drop CTDB_RC_LOCAL testing hook
Martin Schwenke [Thu, 5 Apr 2018 06:09:22 +0000 (16:09 +1000)]
ctdb-scripts: Drop CTDB_RC_LOCAL testing hook

This is not used.

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 Apr 27 09:37:49 CEST 2018 on sn-devel-144

15 months agoctdb-scripts: Drop unused variable service_config
Martin Schwenke [Wed, 4 Apr 2018 09:00:56 +0000 (19:00 +1000)]
ctdb-scripts: Drop unused variable service_config

This was previously used by the loadconfig() function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-docs: Drop documentation for CTDB_SHUTDOWN_TIMEOUT option
Martin Schwenke [Wed, 4 Apr 2018 08:17:13 +0000 (18:17 +1000)]
ctdb-docs: Drop documentation for CTDB_SHUTDOWN_TIMEOUT option

This was recently removed but the documentation was forgotten.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-docs: Drop stale reference to unused configuration file
Martin Schwenke [Thu, 29 Mar 2018 04:42:10 +0000 (15:42 +1100)]
ctdb-docs: Drop stale reference to unused configuration file

Recently removed but documentation change was forgotten.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-docs: Drop references to CTDB_BASE from the documentation
Martin Schwenke [Thu, 29 Mar 2018 04:38:13 +0000 (15:38 +1100)]
ctdb-docs: Drop references to CTDB_BASE from the documentation

CTDB_BASE should only ever be modified by test code.  It should not be
mentioned in the user documentation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-tools: Avoid filtering stderr when onnode not running in parallel
Martin Schwenke [Tue, 17 Apr 2018 22:05:25 +0000 (08:05 +1000)]
ctdb-tools: Avoid filtering stderr when onnode not running in parallel

stderr_filter() only does anything useful when running in
parallel (i.e. with the -p option).  So, simplify the non-parallel
case by not using stderr_filter().

As a side-effect, this fixes an issue introduced in commit
85a4375788d8ef8345ec390807f18299abdadb20 where local daemon tests
would hang when trying to start daemons with VALGRIND set (to a
valgrind command that does not use --log-file).  This is because
valgrind would keep stderr open for its output so the pipeline
involving stderr_filter() would never complete.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb-scripts: Avoid shellcheck SC1117: Backslash is literal in "..."
Martin Schwenke [Thu, 19 Apr 2018 01:54:26 +0000 (11:54 +1000)]
ctdb-scripts: Avoid shellcheck SC1117: Backslash is literal in "..."

This warning (apparently new in shellcheck 0.4.7) only applies to
double-quoted strings.  Change affected constant strings to use
single-quotes.  In the one example that contains a variable expansion
escape the backslash as recommended.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoctdb: Fix some -Werror=strict-overflow issues
Martin Schwenke [Mon, 16 Apr 2018 08:32:07 +0000 (18:32 +1000)]
ctdb: Fix some -Werror=strict-overflow issues

All quite obvious.  For the LCP2 one, we're not actually counting so
use a bool instead of an int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
15 months agoscript/git-hooks: add check-trailing-whitespace
Ralph Boehme [Tue, 10 Apr 2018 11:19:09 +0000 (13:19 +0200)]
script/git-hooks: add check-trailing-whitespace

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 26 03:54:39 CEST 2018 on sn-devel-144

15 months agoAdd a wrapper script as git pre-commit hook
Ralph Boehme [Tue, 10 Apr 2018 11:04:27 +0000 (13:04 +0200)]
Add a wrapper script as git pre-commit hook

When developer mode is enabled, the wrapper script
"script/git-hooks/pre-commit-hook" gets installed as

  .git/hooks/pre-commit

and calls "script/git-hooks/pre-commit-script".

This way we can later modify the "script/git-hooks/pre-commit-script"
without the need to ever change the installed commit hook itself.

Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Jeremy Allison <jra at samba.org>
15 months agorpc_server: Fix NetSessEnum with stale sessions
Christof Schmitt [Tue, 24 Apr 2018 20:53:41 +0000 (13:53 -0700)]
rpc_server: Fix NetSessEnum with stale sessions

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 25 22:49:07 CEST 2018 on sn-devel-144

15 months agoselftest: Add testcase for querying sessions after smbd crash
Christof Schmitt [Tue, 24 Apr 2018 20:52:59 +0000 (13:52 -0700)]
selftest: Add testcase for querying sessions after smbd crash

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
15 months agorpcclient: Print number of entries for NetSessEnum
Christof Schmitt [Tue, 24 Apr 2018 19:18:49 +0000 (12:18 -0700)]
rpcclient: Print number of entries for NetSessEnum

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>