samba.git
5 years agos3: printing: Move handle_ne_file code into a separate function.
Jeremy Allison [Mon, 30 Apr 2018 22:50:14 +0000 (15:50 -0700)]
s3: printing: Move handle_ne_file code into a separate function.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: printing: Split handling of PE file into separate function.
Jeremy Allison [Mon, 30 Apr 2018 22:06:39 +0000 (15:06 -0700)]
s3: printing: Split handling of PE file into separate function.

This is *horrible* old code...

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos3: printing: Reformatting of parts of this file to modern coding standards.
Jeremy Allison [Mon, 30 Apr 2018 18:57:52 +0000 (11:57 -0700)]
s3: printing: Reformatting of parts of this file to modern coding standards.

This should not change the code behavior in any way, it is just being
done to make it easier for me to move this code to calling the
standard read_file() function later on, which takes a file offset
to read from (and uses pread internally).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agonetlogon: Allow zero-GUID to act the same as NULL in GetDCNameEx2
Garming Sam [Mon, 26 Mar 2018 23:19:31 +0000 (12:19 +1300)]
netlogon: Allow zero-GUID to act the same as NULL in GetDCNameEx2

This matches Windows behaviour and allows rpcclient to work against
Samba without knowing the GUID ahead of time. Errors related to this
don't appear to occur within selftest.

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>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri May  4 09:11:19 CEST 2018 on sn-devel-144

5 years agonetlogon: Store the client site to clobber any plausibly returned via winbind
Garming Sam [Mon, 26 Mar 2018 01:32:07 +0000 (14:32 +1300)]
netlogon: Store the client site to clobber any plausibly returned via winbind

So far, I have never observed the case where the winbind call ever
bothered to return a proper site, but in case it ever does so, we
clobber it here. This has implications for returning a non-local domain
site name, but for now, we ignore them.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agonetlogon: Forward GetDCNameEx2 to winbind via IRPC
Garming Sam [Tue, 20 Mar 2018 22:25:19 +0000 (11:25 +1300)]
netlogon: Forward GetDCNameEx2 to winbind via IRPC

Here we simply forward everything without alteration (the same struct is
returned). This helps us to fix the case where the DC does not exist in
the target site, furthermore, this is supposed to work for trusted
domains.

In calling out to winbind, we now also notice if you provide a site
which exists in multiple domains and provide the correct domain (instead
of accidentally returning ourselves).

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowinbindd_irpc: Add an IRPC call to trigger a DC locate
Garming Sam [Tue, 20 Mar 2018 22:25:19 +0000 (11:25 +1300)]
winbindd_irpc: Add an IRPC call to trigger a DC locate

Calling the top level winbindd API would probably be more appropriate,
but we lack certain structures. We introduce this call in order to
return the result to NETLOGON (in order to give site-aware and domain
aware DC location).

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>
5 years agotests/getdcname: Add a number of tests for GetDCNameEx
Garming Sam [Wed, 28 Mar 2018 04:16:25 +0000 (17:16 +1300)]
tests/getdcname: Add a number of tests for GetDCNameEx

This will test the winbind forwarding to deal with sites that the target
DC does not exist in.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agonetlogon: Allow return of error code in future asynchronous winbind forwards
Garming Sam [Wed, 28 Mar 2018 00:05:11 +0000 (13:05 +1300)]
netlogon: Allow return of error code in future asynchronous winbind forwards

We change the naming conventions to match dcesrv_netr_*_base_call used elsewhere.

This is important when we make the underlying Ex2 call asynchronous.

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>
5 years agodsdb: Allow the disable of the Windows server site fallback
Garming Sam [Mon, 26 Mar 2018 01:25:45 +0000 (14:25 +1300)]
dsdb: Allow the disable of the Windows server site fallback

A usage in GetDCNameEx2 could return the wrong result. This may need to
be fixed in other places.

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>
5 years 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>
5 years 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

5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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

5 years 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

5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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

5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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>
5 years 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

5 years 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>
5 years 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

5 years 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>
5 years 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>