jelmer/samba-autobuild/.git
5 years agotalloc: Release talloc 2.2.0 talloc-2.2.0
Andrew Bartlett [Mon, 4 Mar 2019 09:12:18 +0000 (22:12 +1300)]
talloc: Release talloc 2.2.0

 * Remove pytalloc_CObject_FromTallocPtr()
 * Remove --extra-python (a build time mode to produce Python2 and Python3
   bindings at the same time)
 * New minor version to allow Samba 4.10 to release a talloc if
   required from that branch

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: Standardise on calling conf.SAMBA_CHECK_PYTHON() in libraries
Andrew Bartlett [Fri, 15 Feb 2019 03:13:48 +0000 (16:13 +1300)]
build: Standardise on calling conf.SAMBA_CHECK_PYTHON() in libraries

We do this by removing the confusing mandatory option to
conf.SAMBA_CHECK_PYTHON{,_HEADERS}(), instead just use the value of
--disable-python internally

This follows the default minimum of Python 3.4 and keeps things consistent
with the main Samba build where --disable-python is required to skip building
python bindings.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: Remove manual specification of minimum python version
Andrew Bartlett [Fri, 15 Feb 2019 03:04:53 +0000 (16:04 +1300)]
build: Remove manual specification of minimum python version

We now used the default of 3.4 from conf.SAMBA_CHECK_PYTHON()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: Set default minimum python version to 3.4.0
Andrew Bartlett [Fri, 15 Feb 2019 03:03:35 +0000 (16:03 +1300)]
build: Set default minimum python version to 3.4.0

This is the current minimum, but this may change before the 4.11 release.

Python 2.x support is no longer available except to build using --disable-python.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: Do not make python mandatory to build
Andrew Bartlett [Fri, 15 Feb 2019 04:45:27 +0000 (17:45 +1300)]
build: Do not make python mandatory to build

Clearly we have python or else we would not be running, so this is about if
we have a new enough version.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoABI: Remove unused .py3*.sigs files
Andrew Bartlett [Mon, 4 Mar 2019 09:15:47 +0000 (22:15 +1300)]
ABI: Remove unused .py3*.sigs files

These are no longer used by the build system so avoid
confusion by removing them from the tree.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: Remove distinct .py3 ABI files
Andrew Bartlett [Mon, 4 Mar 2019 08:48:41 +0000 (21:48 +1300)]
build: Remove distinct .py3 ABI files

The only difference between the two built libraries is pytalloc_CObject_FromTallocPtr()
which is deprecated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoselftest: Remove mention of --extra-python from comment
Andrew Bartlett [Wed, 20 Mar 2019 03:14:25 +0000 (16:14 +1300)]
selftest: Remove mention of --extra-python from comment

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoselftest: Remove obsolete py3_compatible=True markers
Andrew Bartlett [Fri, 15 Feb 2019 04:30:43 +0000 (17:30 +1300)]
selftest: Remove obsolete py3_compatible=True markers

All our tests now run in python3.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoselftest: Remove support for running multiple tests against python versions in a...
Andrew Bartlett [Fri, 15 Feb 2019 03:31:32 +0000 (16:31 +1300)]
selftest: Remove support for running multiple tests against python versions in a single run

The extra_python support was added to aid the python3 transition

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agobuild: Remove bld.gen_python_environments()
Andrew Bartlett [Fri, 15 Feb 2019 03:37:48 +0000 (16:37 +1300)]
build: Remove bld.gen_python_environments()

This was part of --extra-python support.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
5 years agobuild: Remove --extra-python
Andrew Bartlett [Fri, 15 Feb 2019 03:28:38 +0000 (16:28 +1300)]
build: Remove --extra-python

This option is quite invasive in waf and was mainly for the python3 transition.

Testing with multiple python versions can be done by testing a full compile against
multiple versions, likewise multiple different binding versions can be created
the same way.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agopytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr()
Andrew Bartlett [Mon, 4 Mar 2019 09:11:05 +0000 (22:11 +1300)]
pytalloc: Remove deprecated pytalloc_CObject_FromTallocPtr()

This function makes it harder to remove the --extra-python handlers and is only
provided for Python 2.x, support for which Samba is removing.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agolibsmb: Make SMB1-only cli_nt_hardlink calls static
Volker Lendecke [Mon, 18 Mar 2019 10:03:32 +0000 (11:03 +0100)]
libsmb: Make SMB1-only cli_nt_hardlink calls static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 20 23:32:31 UTC 2019 on sn-devel-144

5 years agoutils: Use cli_hardlink instead of cli_nt_hardlink
Volker Lendecke [Mon, 18 Mar 2019 10:00:50 +0000 (11:00 +0100)]
utils: Use cli_hardlink instead of cli_nt_hardlink

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Introduce protocol-agnostic cli_hardlink
Volker Lendecke [Mon, 18 Mar 2019 09:34:53 +0000 (10:34 +0100)]
libsmb: Introduce protocol-agnostic cli_hardlink

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Use cli_smb2_set_info_fnum()
Volker Lendecke [Sun, 17 Mar 2019 13:00:09 +0000 (14:00 +0100)]
libsmb: Use cli_smb2_set_info_fnum()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Simplify cli_smb2_ftruncate
Volker Lendecke [Sun, 17 Mar 2019 11:24:05 +0000 (12:24 +0100)]
libsmb: Simplify cli_smb2_ftruncate

We don't need to talloc 8 bytes, they can live on the stack. When we
go async, this can go into the state struct.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Simplify cli_smb2_delete_on_close
Volker Lendecke [Sun, 17 Mar 2019 08:25:42 +0000 (09:25 +0100)]
libsmb: Simplify cli_smb2_delete_on_close

Use cli_smb2_set_info_fnum, remove "state" variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Add cli_smb2_set_info_fnum
Volker Lendecke [Sun, 17 Mar 2019 08:17:11 +0000 (09:17 +0100)]
libsmb: Add cli_smb2_set_info_fnum

This wraps getting the file handle from the fnum

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos4:librpc: Fix installation of Samba
Andreas Schneider [Wed, 20 Mar 2019 10:09:21 +0000 (11:09 +0100)]
s4:librpc: Fix installation of Samba

This breaks installation of Samba 4.10 on Fedora.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Mar 20 13:11:28 UTC 2019 on sn-devel-144

5 years agopy/graph: use 2.6 compatible check for set membership
Douglas Bagnall [Tue, 19 Mar 2019 23:02:09 +0000 (12:02 +1300)]
py/graph: use 2.6 compatible check for set membership

It is better this way anyway.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar 20 06:36:05 UTC 2019 on sn-devel-144

5 years agoregfio tests: Update comment style to match README.Coding
Andrew Bartlett [Wed, 20 Mar 2019 04:33:46 +0000 (17:33 +1300)]
regfio tests: Update comment style to match README.Coding

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoregfio: Update code near recent changes to match README.Coding
Andrew Bartlett [Wed, 20 Mar 2019 04:32:39 +0000 (17:32 +1300)]
regfio: Update code near recent changes to match README.Coding

This file long predates our current code conventions.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 years agoregfio: Improve handling of malformed registry hive files
Michael Hanselmann [Sun, 17 Mar 2019 12:49:20 +0000 (13:49 +0100)]
regfio: Improve handling of malformed registry hive files

* next_record: A malformed file can lead to an endless loop.
* regfio_rootkey: Supplying a malformed registry hive file to the
  registry hive I/O code can lead to out-of-bounds reads.

Test cases are included. Both issues resolved have been identified using
AddressSanitizer.

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

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoregfio: Add trivial unit test
Michael Hanselmann [Mon, 18 Mar 2019 23:47:52 +0000 (00:47 +0100)]
regfio: Add trivial unit test

An upcoming commit will resolve two cases of insufficient handling of
mangled registry hive files and will include unit tests.

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

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoregfio: Use correct function names in debug information
Michael Hanselmann [Sun, 17 Mar 2019 15:20:47 +0000 (16:20 +0100)]
regfio: Use correct function names in debug information

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoFix typos in "valid"
Michael Hanselmann [Sun, 17 Mar 2019 12:04:52 +0000 (13:04 +0100)]
Fix typos in "valid"

s/vald/valid/

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agobuild: Allow build when --disable-gnutls is set
Andrew Bartlett [Wed, 20 Mar 2019 00:57:50 +0000 (13:57 +1300)]
build: Allow build when --disable-gnutls is set

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar 20 05:25:48 UTC 2019 on sn-devel-144

5 years agos3: smbd: Clarify POSIX name handling in SMB2 get/setinfo calls.
Jeremy Allison [Mon, 18 Mar 2019 21:52:26 +0000 (14:52 -0700)]
s3: smbd: Clarify POSIX name handling in SMB2 get/setinfo calls.

We should never be looking at the info level here, the create
call will have set the correct POSIX flag on the smb_filename
struct.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 19 22:55:11 UTC 2019 on sn-devel-144

5 years agosmbd: Focus smb_file_link_information on correct posix'ness
Volker Lendecke [Mon, 18 Mar 2019 11:40:06 +0000 (12:40 +0100)]
smbd: Focus smb_file_link_information on correct posix'ness

In the SMB1 unix extensions, posix'ness is a property of the SMB
request, because it's tied to the connection. In the upcoming SMB3
extensions, this will become a property of the file name, it's being
set at SMB2_CREATE time. To correctly transfer posix'ness of the
filename to the destination name, we can't look at the
req->posix_pathnames here, the SMB2_SETINFO call has not set
that. This is still correct for SMB1, as the per-connection posix'ness
has spilled into the filename there too.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 19 18:46:28 UTC 2019 on sn-devel-144

5 years agosmbd: Enhance debugging for setting hard links
Volker Lendecke [Mon, 18 Mar 2019 11:24:25 +0000 (12:24 +0100)]
smbd: Enhance debugging for setting hard links

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotalloc: Fix alignment issues for casting pointers
Andreas Schneider [Fri, 12 Oct 2018 09:58:26 +0000 (11:58 +0200)]
talloc: Fix alignment issues for casting pointers

warning: cast from 'char *' to 'struct talloc_chunk *' increases required
alignment from 1 to 8

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Mar 19 12:38:50 UTC 2019 on sn-devel-144

5 years agovfs_nfs4acl_xattr: check status for NT_STATUS_ACCESS_DENIED in take ownership override
Ralph Boehme [Thu, 29 Nov 2018 10:17:08 +0000 (11:17 +0100)]
vfs_nfs4acl_xattr: check status for NT_STATUS_ACCESS_DENIED in take ownership override

This was missing in commit 8b1b1cd8cc561378058b915e03996ff567355d81.

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): Mon Mar 18 20:19:30 UTC 2019 on sn-devel-144

5 years agoselftest: test vfs_nfs4acl_xattr in nfs mode
Ralph Boehme [Mon, 26 Nov 2018 19:51:14 +0000 (20:51 +0100)]
selftest: test vfs_nfs4acl_xattr in nfs mode

The same tests as for the other modes xdr and ndr are marked as
knownfail.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_nfs4acl_xattr: support for NFS 4.0 and 4.1 ACLs from NFS4 mount
Ralph Boehme [Thu, 29 Nov 2018 10:01:59 +0000 (11:01 +0100)]
vfs_nfs4acl_xattr: support for NFS 4.0 and 4.1 ACLs from NFS4 mount

This adds a new main switch "nfs" to "nfs4acl_xattr:encoding" which
enables to use NFS4 ACLs from an NFS4 mount on a Linux box. Tested with
a FreeBSD NFS4 server.

Supports both NFS 4.0 and 4.1 ACLs.

By default NFS4 servers send user and group identifiers in ACLs as
strings in the format "[USER|GROUP]@DNSDOMAIN". Some NFS4 servers
support sending identifiers as numeric strings. This module does support
this as well, the config knob "nfs4acl_xattr:nfs4_id_numeric = yes|no"
controls behaviour.

When "nfs4acl_xattr:encoding" is set to "nfs", the new option
"nfs4acl_xattr:validate_mode", which defauts to "yes" is set to "no" to
avoid checking and munging the mode on files.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonfs4acl_xattr: reformat enum nfs4acl_encoding to one per line
Ralph Boehme [Mon, 26 Nov 2018 15:31:42 +0000 (16:31 +0100)]
nfs4acl_xattr: reformat enum nfs4acl_encoding to one per line

In preperation of adding another enum value.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonfs4acl_xattr: add RFC compliant NFS 4.0 and 4.1 ACL defintions
Ralph Boehme [Mon, 26 Nov 2018 15:30:38 +0000 (16:30 +0100)]
nfs4acl_xattr: add RFC compliant NFS 4.0 and 4.1 ACL defintions

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonfs4acl_xattr: move a define to a common header file
Ralph Boehme [Mon, 26 Nov 2018 15:29:43 +0000 (16:29 +0100)]
nfs4acl_xattr: move a define to a common header file

In preperation of a adding real NFS backend.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonfs4acl_xattr: move some functions to a seperate file
Ralph Boehme [Sun, 25 Nov 2018 11:07:26 +0000 (12:07 +0100)]
nfs4acl_xattr: move some functions to a seperate file

These functions will be called from another translation unit in a
subsequent commit.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonfs4acl_xattr: append 'i' to nfs4acl functions
Ralph Boehme [Sun, 25 Nov 2018 10:47:48 +0000 (11:47 +0100)]
nfs4acl_xattr: append 'i' to nfs4acl functions

This reflects the new struct names the functions use.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agonfs4acl_xattr: identifiers are XDR encoded as integers
Ralph Boehme [Thu, 22 Nov 2018 17:27:47 +0000 (18:27 +0100)]
nfs4acl_xattr: identifiers are XDR encoded as integers

The structs nfsacl41 and nfsace4 are not RFC 3530 compliant, let's
rename them adding a trailing "i" that indicates that the structs store
identifiers as integers.

  struct nfsace4  -> struct nfsace4i
  struct nfsacl41 -> struct nfsacl41i

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Fix a "assuming signed overflow does not occur" error
Volker Lendecke [Mon, 18 Mar 2019 08:41:57 +0000 (09:41 +0100)]
libsmb: Fix a "assuming signed overflow does not occur" error

Eventually we need to convert internal_resolve_name to "size_t" for
"return_count". But that's a patch for another day :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agolibsmb: Align integer types
Volker Lendecke [Mon, 18 Mar 2019 08:32:27 +0000 (09:32 +0100)]
libsmb: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoheimdal: Fix "assuming signed overflow doesnt occur" error
Volker Lendecke [Mon, 18 Mar 2019 08:30:17 +0000 (09:30 +0100)]
heimdal: Fix "assuming signed overflow doesnt occur" error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agolibsmb: Use cli_smb2_query_info_fnum
Volker Lendecke [Sun, 10 Mar 2019 18:08:20 +0000 (19:08 +0100)]
libsmb: Use cli_smb2_query_info_fnum

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Add cli_smb2_query_info_fnum
Volker Lendecke [Sun, 10 Mar 2019 17:49:55 +0000 (18:49 +0100)]
libsmb: Add cli_smb2_query_info_fnum

This wraps getting the file handle from the fnum

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Change cli_posix_stat_send to take a pointer to sbuf
Volker Lendecke [Wed, 13 Mar 2019 15:10:33 +0000 (16:10 +0100)]
libsmb: Change cli_posix_stat_send to take a pointer to sbuf

This moves the parsing work from the _recv function into the _done
function. This makes writing the SMB2 call easier later on: We can
have a smb2-specific done function doing the smb2-specific work and we
don't have to fork on protocol in the _recv function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Make cli_posix_[sym|hard]link proper tevent_req functions
Volker Lendecke [Thu, 14 Mar 2019 13:23:35 +0000 (14:23 +0100)]
libsmb: Make cli_posix_[sym|hard]link proper tevent_req functions

Simplify adding SMB2 to those functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Use tevent_req_simple_finish_ntstatus
Volker Lendecke [Thu, 14 Mar 2019 19:46:45 +0000 (20:46 +0100)]
libsmb: Use tevent_req_simple_finish_ntstatus

Less lines of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Remove two unnecessary return; statements
Volker Lendecke [Fri, 8 Mar 2019 13:58:02 +0000 (14:58 +0100)]
smbd: Remove two unnecessary return; statements

return; is unnecessary at the end of a void function

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotorture3: Fix an error message
Volker Lendecke [Thu, 14 Mar 2019 10:40:23 +0000 (11:40 +0100)]
torture3: Fix an error message

We tried to open "dname", not "fname"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibsmb: Use a direct struct initializer
Volker Lendecke [Sun, 10 Mar 2019 14:40:45 +0000 (15:40 +0100)]
libsmb: Use a direct struct initializer

There's a few ways to initialize a DATA_BLOB to NULL. There's the
variable data_blob_null, there's ZERO_STRUCTP, and the explicit
initializer. And there's the data_blob() macro which calls into
data_blob_talloc_named. You have to look at that routine to see that
this is nothing more than a ZERO_STRUCT() and not calling into
talloc. Choose the more direct way.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli: Align integer types
Volker Lendecke [Sun, 10 Mar 2019 14:36:53 +0000 (15:36 +0100)]
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoidl: Remove a trailing empty line
Volker Lendecke [Thu, 14 Mar 2019 15:18:03 +0000 (16:18 +0100)]
idl: Remove a trailing empty line

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolibcli: Add a comment explaining lack of overflow checks
Volker Lendecke [Thu, 14 Mar 2019 15:13:10 +0000 (16:13 +0100)]
libcli: Add a comment explaining lack of overflow checks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoidl: Fix a typo
Volker Lendecke [Thu, 14 Mar 2019 16:16:12 +0000 (17:16 +0100)]
idl: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agorpc_server: Give mdssd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:52:16 +0000 (09:52 +0100)]
rpc_server: Give mdssd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agorpc_server: Give fssd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:43:07 +0000 (09:43 +0100)]
rpc_server: Give fssd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agorpc_server: Give lsasd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:40:21 +0000 (09:40 +0100)]
rpc_server: Give lsasd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agorpc_server: Give epmd its header file
Volker Lendecke [Fri, 15 Mar 2019 08:36:35 +0000 (09:36 +0100)]
rpc_server: Give epmd its header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3:client: Fix smbspool device uri handling
Andreas Schneider [Tue, 12 Mar 2019 10:40:30 +0000 (11:40 +0100)]
s3:client: Fix smbspool device uri handling

If we are executed as a CUPS backend, argv[0] is set to the device uri.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Mar 18 16:47:55 UTC 2019 on sn-devel-144

5 years agos3:client: Make sure we work on a copy of the title
Andreas Schneider [Tue, 12 Mar 2019 09:09:14 +0000 (10:09 +0100)]
s3:client: Make sure we work on a copy of the title

We can't be sure we can write to the input buffer.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
5 years agos3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cups
Andreas Schneider [Fri, 4 Jan 2019 08:21:24 +0000 (09:21 +0100)]
s3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cups

This should not switch to username,password if cups has been configured
to use negotiate (Kerberos authentication).

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
5 years agos3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool
Andreas Schneider [Tue, 12 Mar 2019 08:40:58 +0000 (09:40 +0100)]
s3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
5 years agos3:script: Fix jobid check in test_smbspool.sh
Andreas Schneider [Tue, 12 Mar 2019 09:15:05 +0000 (10:15 +0100)]
s3:script: Fix jobid check in test_smbspool.sh

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Bryan Mason <bmason@redhat.com>
Signed-off-by: Guenther Deschner <gd@samba.org>
5 years agosmbd: fix check_parent_access() talloc stackframe leaks
David Disseldorp [Tue, 12 Mar 2019 17:49:09 +0000 (18:49 +0100)]
smbd: fix check_parent_access() talloc stackframe leaks

check_parent_access() currently leaks a number of allocations onto the
talloc_tos() context in both success and error paths.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Mar 15 11:32:04 UTC 2019 on sn-devel-144

5 years agoctdb-version: Simplify version string usage
Amitay Isaacs [Fri, 15 Mar 2019 01:14:27 +0000 (12:14 +1100)]
ctdb-version: Simplify version string usage

There is no need to write SAMBA_VERSION_STRING as CTDB_VERSION_STRING.
Wherever required use SAMBA_VERSION_STRING directly.

Avoids the confusion with two version.h files.

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

Signed-off-by: Amitay Isaacs <amitay@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Mar 15 06:31:50 UTC 2019 on sn-devel-144

5 years agoctdb-build: Drop creation of .distversion in tarball
Martin Schwenke [Thu, 7 Mar 2019 06:53:25 +0000 (17:53 +1100)]
ctdb-build: Drop creation of .distversion in tarball

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING
Stefan Metzmacher [Fri, 16 Jun 2017 10:15:25 +0000 (12:15 +0200)]
ctdb-build: use a fixed ctdb_version.h using SAMBA_VERSION_STRING

This way we don't get constant rebuild as SAMBA_VERSION_STRING
is "4.7.0pre1.DEVELOPERBUILD" for the binaries under bin/
instead of "4.7.0pre1.GIT.59e51f6".

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
5 years agoctdb-tests: Add a test for version consistency checking
Martin Schwenke [Fri, 8 Feb 2019 02:32:16 +0000 (13:32 +1100)]
ctdb-tests: Add a test for version consistency checking

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-daemon: Add an environment variable to set version
Martin Schwenke [Wed, 6 Feb 2019 02:57:00 +0000 (13:57 +1100)]
ctdb-daemon: Add an environment variable to set version

This can be used to test the version checking logic.  Cache the
version to avoid re-checking the environment variable each time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-tests: Fix remaining common.sh ShellCheck hits
Martin Schwenke [Thu, 7 Mar 2019 04:46:48 +0000 (15:46 +1100)]
ctdb-tests: Fix remaining common.sh ShellCheck hits

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-tests: Shell cleanups in wait_until() function
Martin Schwenke [Thu, 7 Mar 2019 04:40:59 +0000 (15:40 +1100)]
ctdb-tests: Shell cleanups in wait_until() function

This file is included by local_daemons.sh, which is not a bash script
and wait_until() uses the "local" keyword.  Prefixing variable names
with '_' to indicate that they are local changes a lot of lines in
this function.  So, fix indentation, potential quoting problems and
other ShellCheck hits while touching this function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-tests: export CTDB_SCRIPTS_TOOLS_BIN_DIR
Martin Schwenke [Thu, 7 Mar 2019 04:26:27 +0000 (15:26 +1100)]
ctdb-tests: export CTDB_SCRIPTS_TOOLS_BIN_DIR

This isn't used anywhere that requires it to be exported, but the lack
of consistency will cause problems and confusion at some later stage.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-packaging: Test package requires tcpdump
Martin Schwenke [Wed, 6 Mar 2019 08:16:55 +0000 (19:16 +1100)]
ctdb-packaging: Test package requires tcpdump

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-packaging: ctdb package should not own system library directory
Martin Schwenke [Wed, 6 Mar 2019 03:36:01 +0000 (14:36 +1100)]
ctdb-packaging: ctdb package should not own system library directory

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-tests: Add some testing for IPv4-mapped IPv6 address parsing
Martin Schwenke [Thu, 14 Mar 2019 05:32:02 +0000 (16:32 +1100)]
ctdb-tests: Add some testing for IPv4-mapped IPv6 address parsing

ctdb_sock_addr values are hashed in some contexts.  This means that
all of the memory used for the ctdb_sock_addr should be consistent
regardless of how parsing is done.  The first 2 cases are just sanity
checks but the 3rd case involving an IPv4-mapped IPv6 address is the
real target of this test addition.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb: Initialize addr struct to zero before reparsing as IPV4
Zhu Shangzhong [Tue, 12 Mar 2019 12:49:48 +0000 (20:49 +0800)]
ctdb: Initialize addr struct to zero before reparsing as IPV4

Failed to kill the tcp connection that using IPv4-mapped IPv6 address
(e.g. ctdb_killtcp eth0 ::ffff:192.168.200.44:2049
::ffff:192.168.200.45:863).

When the ctdb_killtcp is used to kill the tcp connection, the IPs and
ports in the connection will be parsed to conn.client and conn.server
(call stack: main->ctdb_sock_addr_from_string->ip_from_string). In
the ip_from_string, as we are using IPv4-mapped IPv6 addresses, the
ipv6_from_string will be used to parse ip to addr.ip6 first. The next
step the ipv4_from_string will be used to reparse ip to addr.ip.

As a result, the data that dump from conn.server is "2 0 8 1 192 168
200 44 0 0 0 0 0 0 0 0 0 0 255 255 192 168 200 44 0 0 0 0", the data
from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0 0 0 0 0 0 255 255
192 168 200 45 0 0 0 0". The connection will be add to conn_list by
ctdb_connection_list_add. Then the reset_connections_send uses conn_list
as parameter to start to reset connections in the conn_list.

In the reset_connections_send, the database "connections" will be
created. The connections from conn_list will be written to the
database(call db_hash_add), and use the data that dump from conn_client
and conn_server as key.

In the reset_connections_capture_tcp_handler, the
ctdb_sys_read_tcp_packet will receive data on the raw socket. And
extract the IPs and ports from the tcp packet. when extracting IP and
port, the tcp4_extract OR tcp6_extract will be used. Then we got the
new conn.client and conn.server. the data that dump from the
conn.server is "2 0 8 1 192 168 200 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0", the data from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0". Finally, we use the data as key to check
if this connection is one being reset(call db_hash_delete). The
db_hash_delete will return ENOENT. Because the two key that being used
by db_hash_delete and db_hash_add are different.

So, the TCP RST will be NOT sent for the connection forever. We should
initialize addr struct to zero before reparsing as IPV4 in the
ip_from_string.

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

Signed-off-by: Zhu Shangzhong <zhu.shangzhong@zte.com.cn>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agoctdb-tests: Build cluster mutex path manually
Martin Schwenke [Thu, 7 Mar 2019 04:53:31 +0000 (15:53 +1100)]
ctdb-tests: Build cluster mutex path manually

CTDB_CLUSTER_MUTEX_HELPER can't be depended on because it is only set
when the tests are not installed and setting it unconditionally for
this particular use would be wrong.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
5 years agodbcheck: don't check expired tombstone objects by default anymore
Stefan Metzmacher [Tue, 12 Mar 2019 10:41:01 +0000 (11:41 +0100)]
dbcheck: don't check expired tombstone objects by default anymore

These will be removed anyway and any change on them risks to
be an originating update that causes replication problems.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar 14 03:12:27 UTC 2019 on sn-devel-144

5 years agoblackbox/dbcheck-links.sh: prepare regression test for skipping expired tombstones
Stefan Metzmacher [Tue, 12 Mar 2019 10:38:22 +0000 (11:38 +0100)]
blackbox/dbcheck-links.sh: prepare regression test for skipping expired tombstones

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoblackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheck
Stefan Metzmacher [Tue, 12 Mar 2019 10:04:33 +0000 (11:04 +0100)]
blackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheck

These tests operate on provision dumps created long ago, they still
want to run tests on deleted objects, when the next commits remove
processing expired tombstone objects in dbcheck.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: add --selftest-check-expired-tombstones cmdline option
Stefan Metzmacher [Tue, 12 Mar 2019 10:02:18 +0000 (11:02 +0100)]
dbcheck: add --selftest-check-expired-tombstones cmdline option

This will be used by dbcheck tests which operate on static/old provision
dumps in the following commits.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agopython/samba/netcmd: provide SUPPRESS_HELP via Option class
Stefan Metzmacher [Tue, 12 Mar 2019 09:25:40 +0000 (10:25 +0100)]
python/samba/netcmd: provide SUPPRESS_HELP via Option class

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: detect the change after deletion bug
Stefan Metzmacher [Thu, 28 Feb 2019 17:22:18 +0000 (18:22 +0100)]
dbcheck: detect the change after deletion bug

Old versions of 'samba-tool dbcheck' could reanimate
deleted objects, when running at the same time as the
tombstone garbage collection.

When the (deleted) parent of a deleted object
(with the DISALLOW_MOVE_ON_DELETE bit in systemFlags),
is removed before the object itself, dbcheck moved
it in the LostAndFound[Config] subtree of the partition
as an originating change. That means that the object
will be in tombstone state again for 180 days on the local
DC. And other DCs fail to replicate the object as
it's already removed completely there and the replication
only gives the name and lastKnownParent attributes, because
all other attributes should already be known to the other DC.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoblackbox/dbcheck-links.sh: add regression test for lost deleted object repair
Stefan Metzmacher [Mon, 11 Mar 2019 22:14:02 +0000 (23:14 +0100)]
blackbox/dbcheck-links.sh: add regression test for lost deleted object repair

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: add find_repl_attid() helper function
Stefan Metzmacher [Thu, 28 Feb 2019 17:16:27 +0000 (18:16 +0100)]
dbcheck: add find_repl_attid() helper function

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: don't remove dangling one-way links on already deleted objects
Stefan Metzmacher [Mon, 25 Feb 2019 14:35:22 +0000 (15:35 +0100)]
dbcheck: don't remove dangling one-way links on already deleted objects

This would typically happen when the garbage collection
removed a parent object before a child object (both with
the DISALLOW_MOVE_ON_DELETE bit set in systemFlags),
while dbcheck is running at the same time as the garbage collection.
In this case the lastKnownParent attributes points a non existing
object.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: don't move already deleted objects to LostAndFound
Stefan Metzmacher [Mon, 25 Feb 2019 14:35:22 +0000 (15:35 +0100)]
dbcheck: don't move already deleted objects to LostAndFound

This would typically happen when the garbage collection
removed a parent object before a child object (both with
the DISALLOW_MOVE_ON_DELETE bit set in systemFlags),
while dbcheck is running at the same time as the garbage collection.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: do isDeleted, systemFlags and replPropertyMetaData detection first
Stefan Metzmacher [Mon, 25 Feb 2019 14:09:36 +0000 (15:09 +0100)]
dbcheck: do isDeleted, systemFlags and replPropertyMetaData detection first

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objects
Stefan Metzmacher [Mon, 11 Mar 2019 21:45:46 +0000 (22:45 +0100)]
dbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objects

We should never do originating updates on deleted objects.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename
Stefan Metzmacher [Mon, 11 Mar 2019 21:38:38 +0000 (22:38 +0100)]
dsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename

We need a way to rename an object without updating the replication meta
data.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoblackbox/dbcheck-links.sh: reproduce lost deleted object problem
Stefan Metzmacher [Mon, 11 Mar 2019 13:52:57 +0000 (14:52 +0100)]
blackbox/dbcheck-links.sh: reproduce lost deleted object problem

When a parent object is removed during the tombstone garbage collection
before a child object and samba-tool dbcheck runs at the same time, the
following can happen:

- If the object child had DISALLOW_MOVE_ON_DELETE in systemFlags,
  samba-tool dbcheck moves the object under the LostAndFound[Config]
  object (as an originating update!)
- The lastKnownParent attribute is removed (as an originating update!)

These originating updates cause the object to have an extended time
as tombstone. And these changes are replicated to other DCs,
which very likely already removed the object completely!

This means the destination DC of replication has no chance to handle
the object it gets from the source DC with just 2 attributes (name, lastKnownParent).

The destination logs something like:

  No objectClass found in replPropertyMetaData

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoblackbox/*.sh: pass -u to 'diff'
Stefan Metzmacher [Tue, 12 Mar 2019 09:36:49 +0000 (10:36 +0100)]
blackbox/*.sh: pass -u to 'diff'

This is what we work with every day...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Remove unnecessary dns_hub hashmap entries
Tim Beale [Tue, 12 Mar 2019 21:30:25 +0000 (10:30 +1300)]
selftest: Remove unnecessary dns_hub hashmap entries

These are only used within the function, and there's already a local
variable that stores the same info.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Use consistent env variables for dns_hub
Tim Beale [Tue, 12 Mar 2019 04:39:50 +0000 (17:39 +1300)]
selftest: Use consistent env variables for dns_hub

Setting up a testenv involves populating 2 different hashmaps - an
intermediary one (usually called 'ctx') and one that is used to populate
the testenv environment variables (usually called 'env_vars' or
'dcvars').
Because the dns_hub setup is very simple, it doesn't need two different
hashmaps. However, the variable names are still a mix of the two
hashmaps.

This patch updates dns_hub to use the second, more finalized hashmap
variable-names.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Use new helper function for client's smb.conf IP
Tim Beale [Tue, 12 Mar 2019 01:04:21 +0000 (14:04 +1300)]
selftest: Use new helper function for client's smb.conf IP

This has the side-effect of giving the client an IPv6 address, which it
hasn't had up until now. But it at least makes the client and server
interfaces settings consistent, and gets rid of a hard-coded IP address.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotests: Make IPv4 assumption explicit
Tim Beale [Tue, 12 Mar 2019 21:18:41 +0000 (10:18 +1300)]
tests: Make IPv4 assumption explicit

This test is asserting the expected number of *IPv4* addresses, not any
interface address (including IPv6). It works currently because the
selftest client doesn't have an IPv6 address in its smb.conf.

This patch makes the IPv4 assumption explicit by importing
interface_ips_v4() from the provision code. We need to tweak this to
pass through an 'all_interfaces' flag, otherwise it filters out the
loopback IP addresses that the testenv is using.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Add helper function to get interfaces config
Tim Beale [Tue, 12 Mar 2019 01:00:55 +0000 (14:00 +1300)]
selftest: Add helper function to get interfaces config

Add a helper function to return the IPv4/IPv6 addresses for the
smb.conf. This keeps the netmask assumptions in the same places as
the IP subnet assumptions.

This refactor means we no longer need to store $ctx->{interfaces}, as it
was only used in one place.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>