samba.git
6 years agoctdb-tests: Convert database map to a linked list in fake_ctdbd
Amitay Isaacs [Mon, 5 Feb 2018 01:11:32 +0000 (12:11 +1100)]
ctdb-tests: Convert database map to a linked list in fake_ctdbd

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-client: Add missing initialization of tevent_context
Amitay Isaacs [Mon, 19 Mar 2018 02:58:43 +0000 (13:58 +1100)]
ctdb-client: Add missing initialization of tevent_context

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agoctdb-client: Do not try to allocate 0 sized record
Amitay Isaacs [Mon, 19 Mar 2018 02:38:28 +0000 (13:38 +1100)]
ctdb-client: Do not try to allocate 0 sized record

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
6 years agowinbindd: Use talloc_zero_array for consistency with other winbindd_domain allocators
Andrew Bartlett [Wed, 21 Mar 2018 08:23:13 +0000 (21:23 +1300)]
winbindd: Use talloc_zero_array for consistency with other winbindd_domain allocators

The other allocator for this structure uses talloc_zero()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Mar 24 07:21:37 CET 2018 on sn-devel-144

6 years agowinbindd: Do re-connect if the RPC call fails in the passdb case
Andrew Bartlett [Wed, 21 Mar 2018 07:44:31 +0000 (20:44 +1300)]
winbindd: Do re-connect if the RPC call fails in the passdb case

This is very, very unlikely but possible as in the AD case the RPC server is in
another process that may eventually be able to restart.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agowinbindd: Add a cache of the samr and lsa handles for the passdb domain
Andrew Bartlett [Wed, 21 Mar 2018 07:43:10 +0000 (20:43 +1300)]
winbindd: Add a cache of the samr and lsa handles for the passdb domain

This domain is very close, in AD DC configurations over a internal ncacn_np pipe
and otherwise in the same process via C linking.  It is however very expensive
to re-create the binding handle per SID->name lookup, so keep a cache.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agoautobuild: Move "none" environment to samba-none-env
Andrew Bartlett [Sat, 3 Mar 2018 06:51:29 +0000 (19:51 +1300)]
autobuild: Move "none" environment to samba-none-env

This takes this part of the test out of the main, slow samba task
but also keeps it away from samba-o3 which is up against the 50min
budget on travis-ci.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 23 12:00:40 CET 2018 on sn-devel-144

6 years agoAdd tests for dckeytab python module
David Mulder [Fri, 16 Feb 2018 17:00:19 +0000 (10:00 -0700)]
Add tests for dckeytab python module

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agopython3 port for dckeytab module
Noel Power [Fri, 2 Feb 2018 16:08:48 +0000 (16:08 +0000)]
python3 port for dckeytab module

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agoAdd python tests for samba.gpo module
David Mulder [Mon, 12 Feb 2018 19:21:42 +0000 (12:21 -0700)]
Add python tests for samba.gpo module

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agolibgpo: port samba.gpo to python3
David Mulder [Tue, 30 Jan 2018 19:31:42 +0000 (12:31 -0700)]
libgpo: port samba.gpo to python3

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agotests/dcerpc/misc.GUID: improve tests
Joe Guo [Tue, 20 Mar 2018 23:13:56 +0000 (12:13 +1300)]
tests/dcerpc/misc.GUID: improve tests

1. Merge tests for different formats into a for loop, make it easy to
read and extend.
2. Add test for invalid formats.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agotests/dcerpc/misc.GUID: test that long-form py3 bytes works
Douglas Bagnall [Fri, 16 Mar 2018 03:33:44 +0000 (16:33 +1300)]
tests/dcerpc/misc.GUID: test that long-form py3 bytes works

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosamba python tests: Ensure GUIDTests cover all input formats
Noel Power [Wed, 28 Feb 2018 14:40:26 +0000 (14:40 +0000)]
samba python tests: Ensure GUIDTests cover all input formats

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4/librpc: GUID should accept string or bytes in python3
Noel Power [Wed, 28 Feb 2018 03:25:55 +0000 (16:25 +1300)]
s4/librpc: GUID should accept string or bytes in python3

In python3 you can't store a binary blob GUID in a string class, you
need to use 'bytes'. This change ensures python2 code continues to use
a string and in python3 both 'bytes' and 'string' are supported.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agopython: Add compatability helpers to determine if type is really bytes
Noel Power [Wed, 7 Mar 2018 14:39:54 +0000 (14:39 +0000)]
python: Add compatability helpers to determine if type is really bytes

py3compat has PyBytes_Check macro which evalates to PyString_Check in
python2. To help switch behaviour based on whether you are dealing
with the bytes type the following macros have been added.

IsPy3Bytes
IsPy3BytesOrString

IsPy3Bytes will evaluate to false in python2 and will return the
expected result in python3. IsPy3BytesOrString will test for string
type alone in python2 or bytes and string in python3.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4/dsdb: python3 api should take 'bytes'
Noel Power [Thu, 22 Feb 2018 12:49:36 +0000 (12:49 +0000)]
s4/dsdb: python3 api should take 'bytes'

Attributes are properly represented by 'bytes' and *maybe* can be
converted into strings (if they are text).
py_dsdb_normalise_attributes currently expects strings, this is fine
in python2 however in python3 we need to actually pass a 'bytes'
class.

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4/selftest: enable netbios python test for python3 too
Noel Power [Thu, 15 Feb 2018 20:46:53 +0000 (20:46 +0000)]
s4/selftest: enable netbios python test for python3 too

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agopython3 port for netbios module
Noel Power [Fri, 2 Feb 2018 17:08:00 +0000 (17:08 +0000)]
python3 port for netbios module

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos4/selftest: Add simple python netbios test python2 only for the moment
Noel Power [Thu, 15 Feb 2018 20:43:53 +0000 (20:43 +0000)]
s4/selftest: Add simple python netbios test python2 only for the moment

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agolibcli/nbt: Fix illegal tuple index access.
Noel Power [Thu, 15 Feb 2018 15:02:58 +0000 (15:02 +0000)]
libcli/nbt: Fix illegal tuple index access.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agoREADME.Coding: remove reference to non-existent prog_guide4.txt
Douglas Bagnall [Fri, 23 Mar 2018 02:12:06 +0000 (15:12 +1300)]
README.Coding: remove reference to non-existent prog_guide4.txt

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoREADME.Coding: mention compatible Python versions
Douglas Bagnall [Fri, 23 Mar 2018 02:09:57 +0000 (15:09 +1300)]
README.Coding: mention compatible Python versions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolib/tdb: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:07:31 +0000 (14:07 +0000)]
lib/tdb: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agoauth/credentials/test: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:06:55 +0000 (14:06 +0000)]
auth/credentials/test: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agoscript: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:06:21 +0000 (14:06 +0000)]
script: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos3/script/tests: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:04:29 +0000 (14:04 +0000)]
s3/script/tests: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agoselftest: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:03:29 +0000 (14:03 +0000)]
selftest: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos4/selftest: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:02:52 +0000 (14:02 +0000)]
s4/selftest: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos4/torture/drs: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:02:18 +0000 (14:02 +0000)]
s4/torture/drs: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos4/scripting: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 14:01:17 +0000 (14:01 +0000)]
s4/scripting: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos4/script: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:59:50 +0000 (13:59 +0000)]
s4/script: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos3/dsdb: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:57:01 +0000 (13:57 +0000)]
s3/dsdb: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agosamba python libs: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:53:45 +0000 (13:53 +0000)]
samba python libs: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agosamba-tool: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:49:09 +0000 (13:49 +0000)]
samba-tool: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agosamba python tests: convert print func to be py2/py3 compatible
Noel Power [Fri, 9 Mar 2018 13:38:42 +0000 (13:38 +0000)]
samba python tests: convert print func to be py2/py3 compatible

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agoFix invocation of gnutls_aead_cipher_encrypt()
Timur I. Bakeyev [Thu, 22 Mar 2018 04:47:58 +0000 (05:47 +0100)]
Fix invocation of gnutls_aead_cipher_encrypt()

Which was failing with GNUTLS_E_SHORT_MEMORY_BUFFER - The given memory
buffer is too short to hold parameters.

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

Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri Mar 23 07:25:30 CET 2018 on sn-devel-144

6 years agoselftest: Ensure tmpkpasswdscript is always under $PREFIX
Andrew Bartlett [Thu, 22 Mar 2018 00:18:39 +0000 (13:18 +1300)]
selftest: Ensure tmpkpasswdscript is always under $PREFIX

Otherwise it might not be removed at the end of the test

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agoselftest: Align cleanup of tmpkpasswdscript with scripts that use it
Andrew Bartlett [Thu, 22 Mar 2018 00:15:34 +0000 (13:15 +1300)]
selftest: Align cleanup of tmpkpasswdscript with scripts that use it

Some scripts removed it without creating it and the others created it
and did not remove it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
6 years agos3:lib: Fix probably a copy&paste error in namemap_cache_set_sid2name()
Andreas Schneider [Wed, 21 Mar 2018 19:25:09 +0000 (20:25 +0100)]
s3:lib: Fix probably a copy&paste error in namemap_cache_set_sid2name()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 23 01:59:08 CET 2018 on sn-devel-144

6 years agos3: smbd: always set vuid in check_user_ok()
Ralph Boehme [Thu, 22 Mar 2018 07:03:58 +0000 (08:03 +0100)]
s3: smbd: always set vuid in check_user_ok()

A SMB session reauth will have invalidated conn->vuid via
conn_clear_vuid_caches().

Ensure conn->vuid always has the vuid of the current user in
check_user_ok().

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 22 18:26:04 CET 2018 on sn-devel-144

6 years agoselftest: consistently produce high-res UTC time
Jamie McClymont [Thu, 25 Jan 2018 04:23:06 +0000 (17:23 +1300)]
selftest: consistently produce high-res UTC time

Currently some subunit reporters throughout the codebase provide low-res time,
meaning timestamps jump back and forth in the subunit file. Also, some subunit
reporters produce UTC timestamps while others produce local time. UTC was chosen
as the standard for this commit since all of the timestamps end with a Z (= Zulu
= UTC).

Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Mar 22 13:26:44 CET 2018 on sn-devel-144

6 years agos4:selftest: explicitly set NSS/RESOLV_WAPPER_* in wait_for_start
Jamie McClymont [Wed, 10 Jan 2018 00:28:13 +0000 (13:28 +1300)]
s4:selftest: explicitly set NSS/RESOLV_WAPPER_* in wait_for_start

These variables were previously set directly on the selftest process
for the purpose of making this ldbsearch call, allowing them to leak
into other environments.

Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoselftest: Clear environment before provision
Jamie McClymont [Mon, 29 Jan 2018 05:59:34 +0000 (18:59 +1300)]
selftest: Clear environment before provision

Currently, if an environment is being provisioned after a test which used
ad_member_rfc2307, the provisioning process has all of the following in its
environment:

{
'DC_NETBIOSNAME'               => 'LOCALDC',
'DC_PASSWORD'                  => 'locDCpass1',
'DC_SERVER_IP'                 => '127.0.0.21',
'DC_SERVER_IPV6'               => 'fd00:0000:0000:0000:0000:0000:5357:5f15',
'DC_SERVER'                    => 'localdc',
'DC_USERNAME'                  => 'Administrator',
'DOMAIN'                       => 'SAMBADOMAIN',
'LOCAL_PATH'                   => '/.../st/ad_member_rfc2307/share',
'LOCK_DIR'                     => '/.../st/ad_member_rfc2307/lockdir',
'NETBIOSNAME'                  => 'RFC2307MEMBER',
'NMBD_SOCKET_DIR'              => '/.../st/ad_member_rfc2307/nmbd',
'NSS_WRAPPER_GROUP'            => '/.../st/ad_member_rfc2307/private/group',
'NSS_WRAPPER_HOSTNAME'         => 'rfc2307member.samba.example.com',
'NSS_WRAPPER_HOSTS'            => '/.../st/hosts',
'NSS_WRAPPER_MODULE_FN_PREFIX' => 'winbind',
'NSS_WRAPPER_MODULE_SO_PATH'   => '/.../bin/default/nsswitch/libnss-wrapper-winbind.so',
'NSS_WRAPPER_PASSWD'           => '/.../st/ad_member_rfc2307/private/passwd',
'PASSWORD'                     => 'loCalMemberPass',
'REALM'                        => 'SAMBA.EXAMPLE.COM',
'RESOLV_WRAPPER_HOSTS'         => '/.../st/dns_host_file',
'SELFTEST_WINBINDD_SOCKET_DIR' => '/.../st/ad_member_rfc2307/winbindd',
'SERVER_IP'                    => '127.0.0.34',
'SERVER_IPV6'                  => 'fd00:0000:0000:0000:0000:0000:5357:5f22',
'SERVER'                       => 'RFC2307MEMBER',
'USERID'                       => '55668',
'USERNAME'                     => 'jamiemcclymont',
}

Unsurprisingly, some of these can cause issues for the provisioning process, if
a reduced subset of tests is being run which causes the provision to encounter
never-before-seen pairs of adjacent environments.

For example, a run with only
TESTS='--include-env=vampire_dc --include-env=ad_member_rfc2307'
would fail to start up the vampire_dc with:
Could not find machine account in secrets database:
Failed to fetch machine account password from secrets.ldb:
Could not find entry to match filter:
'(&(flatname=SAMBADOMAIN)(objectclass=primaryDomain))' base: 'cn=Primary Domains': No such object: dsdb_search at ../source4/dsdb/common/util.c:4641

Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos3-libnet: move rpc_join label into HAVE_ADS block with only caller
Andrew Bartlett [Sun, 4 Mar 2018 09:57:22 +0000 (22:57 +1300)]
s3-libnet: move rpc_join label into HAVE_ADS block with only caller

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agolibsmb: Use the same #ifdef for is_our_primary_domain() as the only caller
Andrew Bartlett [Sun, 4 Mar 2018 09:31:00 +0000 (22:31 +1300)]
libsmb: Use the same #ifdef for is_our_primary_domain() as the only caller

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotravis-ci: Use Gold linker for faster builds
Andrew Bartlett [Sat, 3 Mar 2018 10:39:24 +0000 (23:39 +1300)]
travis-ci: Use Gold linker for faster builds

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotravis-ci: Only un-shallow for PIDL
Andrew Bartlett [Sat, 3 Mar 2018 08:24:47 +0000 (21:24 +1300)]
travis-ci: Only un-shallow for PIDL

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoautobuild: Move defaulttasks to one-per-line
Andrew Bartlett [Fri, 21 Jul 2017 07:54:36 +0000 (19:54 +1200)]
autobuild: Move defaulttasks to one-per-line

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotdb: Fix a "increases alignment" warning
Volker Lendecke [Sun, 4 Mar 2018 10:51:13 +0000 (11:51 +0100)]
tdb: Fix a "increases alignment" warning

Many of those warnings are difficult to fix, but this one was easy :-)

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): Thu Mar 22 07:21:44 CET 2018 on sn-devel-144

6 years agotdb: Align a few integer types
Volker Lendecke [Sun, 4 Mar 2018 10:48:47 +0000 (11:48 +0100)]
tdb: Align a few integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotdb: Harden allocating the tdb recovery area
Volker Lendecke [Sun, 4 Mar 2018 10:26:37 +0000 (11:26 +0100)]
tdb: Harden allocating the tdb recovery area

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotdb: Make sure the hash size fits
Volker Lendecke [Sun, 4 Mar 2018 10:09:10 +0000 (11:09 +0100)]
tdb: Make sure the hash size fits

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agoHarden tdb_check_used_record against overflow
Volker Lendecke [Sun, 4 Mar 2018 09:46:09 +0000 (10:46 +0100)]
Harden tdb_check_used_record against overflow

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotdb: Handle TDB_NEXT_LOCK_ERR in tdb_traverse_internal
Volker Lendecke [Sun, 4 Mar 2018 09:21:09 +0000 (10:21 +0100)]
tdb: Handle TDB_NEXT_LOCK_ERR in tdb_traverse_internal

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotdb: Harden tdb_rec_read
Volker Lendecke [Sun, 4 Mar 2018 09:07:29 +0000 (10:07 +0100)]
tdb: Harden tdb_rec_read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agotdbdump: Avoid an int cast
Volker Lendecke [Sun, 4 Mar 2018 09:07:09 +0000 (10:07 +0100)]
tdbdump: Avoid an int cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3: docs: Add documentation for "smb2" and "smb2_credits" debug classes.
Jeremy Allison [Wed, 21 Mar 2018 19:56:12 +0000 (12:56 -0700)]
s3: docs: Add documentation for "smb2" and "smb2_credits" debug classes.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
6 years agos3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically debug credit issues.
Jeremy Allison [Wed, 21 Mar 2018 19:52:49 +0000 (12:52 -0700)]
s3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically debug credit issues.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
6 years agolib: debug: Add DBGC_XXX versions of the macros to allow class-specific messages.
Jeremy Allison [Wed, 21 Mar 2018 19:40:50 +0000 (12:40 -0700)]
lib: debug: Add DBGC_XXX versions of the macros to allow class-specific messages.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
6 years agos3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all smbd/smb2_*.c files...
Jeremy Allison [Wed, 21 Mar 2018 19:01:05 +0000 (12:01 -0700)]
s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all smbd/smb2_*.c files with it.

Will allow easier smb2-specific debugging.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
6 years agolib:param: Fix the size type in lp_do_parameter_parametric()
Andreas Schneider [Wed, 21 Mar 2018 10:26:55 +0000 (11:26 +0100)]
lib:param: Fix the size type in lp_do_parameter_parametric()

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 22 01:54:08 CET 2018 on sn-devel-144

6 years agos3:lib: Fix size types in tldap_find_first_star()
Andreas Schneider [Wed, 21 Mar 2018 10:24:45 +0000 (11:24 +0100)]
s3:lib: Fix size types in tldap_find_first_star()

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3:lib: Fix size types in ms_fnmatch()
Andreas Schneider [Wed, 21 Mar 2018 10:19:44 +0000 (11:19 +0100)]
s3:lib: Fix size types in ms_fnmatch()

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
6 years agos3:printing: Fix size check in get_file_version()
Andreas Schneider [Thu, 7 Dec 2017 17:01:45 +0000 (18:01 +0100)]
s3:printing: Fix size check in get_file_version()

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotalloc: version 2.1.12 talloc-2.1.12
Stefan Metzmacher [Wed, 21 Mar 2018 07:24:06 +0000 (08:24 +0100)]
talloc: version 2.1.12

* Fix documentation typo
* Fix compilation with -Wstrict-overflow=2
* Use a library destructor instead of atexit() if available
  (bug #7587)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Mar 21 18:39:33 CET 2018 on sn-devel-144

6 years agotalloc: use a library destructor instead of atexit() if available
Stefan Metzmacher [Tue, 20 Mar 2018 15:48:33 +0000 (16:48 +0100)]
talloc: use a library destructor instead of atexit() if available

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agotalloc: Fix size type and checks in _vasprintf_tc
Andreas Schneider [Wed, 21 Mar 2018 10:55:45 +0000 (11:55 +0100)]
talloc: Fix size type and checks in _vasprintf_tc

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agos3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.
Jeremy Allison [Mon, 19 Mar 2018 22:46:41 +0000 (15:46 -0700)]
s3: smbd: Fruit. Make the use of dom_sid_compare_domain() much clearer.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 years agosamba-tool visualize: fix python2.6 incompatibility
Björn Baumbach [Tue, 20 Mar 2018 11:15:22 +0000 (12:15 +0100)]
samba-tool visualize: fix python2.6 incompatibility

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-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 21 09:25:51 CET 2018 on sn-devel-144

6 years agosamba-tool ldapcmp: remove duplicate takes_optiongroups attribute
Douglas Bagnall [Fri, 9 Mar 2018 03:13:01 +0000 (16:13 +1300)]
samba-tool ldapcmp: remove duplicate takes_optiongroups attribute

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosamba_dnsupdate: Introduce automatic site coverage
Garming Sam [Mon, 12 Mar 2018 01:45:48 +0000 (14:45 +1300)]
samba_dnsupdate: Introduce automatic site coverage

This uses the underlying function in kcc_utils.py which already has
tests.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agotests/samba_dnsupdate: Add a trivial test of automatic site coverage
Garming Sam [Mon, 19 Mar 2018 03:50:36 +0000 (16:50 +1300)]
tests/samba_dnsupdate: Add a trivial test of automatic site coverage

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agotests/kcc_util: Add unit tests for automatic site coverage
Garming Sam [Wed, 14 Mar 2018 03:53:13 +0000 (16:53 +1300)]
tests/kcc_util: Add unit tests for automatic site coverage

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agokcc_utils: Use lower name in automatic sites covered
Garming Sam [Wed, 14 Mar 2018 03:52:58 +0000 (16:52 +1300)]
kcc_utils: Use lower name in automatic sites covered

This allows easier testing, as well as some consistency in the DNS
record creation.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agokcc_utils: Prevent multiple sites attached to a sitelink covering a site
Garming Sam [Tue, 13 Mar 2018 01:41:23 +0000 (14:41 +1300)]
kcc_utils: Prevent multiple sites attached to a sitelink covering a site

This avoids trivial duplicates in a similar manner as mentioned in:

https://blogs.technet.microsoft.com/askds/2011/04/29/sites-sites-everywhere/

It prefers the largest sites then the earliest alphabetically, so that
only a single site ever covers an uncovered site (within a site link).
Note that this isn't applicable over multiple site links (like Windows
presumably) and is only a simple mechanism to avoid excessive
registering.  DCs within the site will also still register for each.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agokcc_utils: Keep a count of the DCs in each site
Garming Sam [Tue, 13 Mar 2018 01:11:14 +0000 (14:11 +1300)]
kcc_utils: Keep a count of the DCs in each site

This is useful for ranking which sites are preferable within the same
site link.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agokcc_utils: Add a routine for automatic site coverage
Garming Sam [Tue, 13 Mar 2018 00:04:12 +0000 (13:04 +1300)]
kcc_utils: Add a routine for automatic site coverage

This allows double-coverage if two links exist with the same cost.
Administrators should only connect an DC-less site via a single site
link.

This also allows unnecessary coverage by all sites in the adjoining site
link (to be resolved in the later patches).

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agojoin.py: Add missing NTSTATUSError import
Garming Sam [Mon, 12 Mar 2018 01:44:58 +0000 (14:44 +1300)]
join.py: Add missing NTSTATUSError import

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agos3:registry: Fix size types and length calculations
Andreas Schneider [Thu, 7 Dec 2017 18:46:21 +0000 (19:46 +0100)]
s3:registry: Fix size types and length calculations

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 21 04:25:39 CET 2018 on sn-devel-144

6 years agos3:vfs_preopen: Change to a do-while loop and fix the check
Andreas Schneider [Thu, 7 Dec 2017 17:44:59 +0000 (18:44 +0100)]
s3:vfs_preopen: Change to a do-while loop and fix the check

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:locking: Fix integer overflow check in posix_lock_in_range()
Andreas Schneider [Thu, 7 Dec 2017 17:24:18 +0000 (18:24 +0100)]
s3:locking: Fix integer overflow check in posix_lock_in_range()

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:nmbd: Fix possible integer overflow
Andreas Schneider [Thu, 7 Dec 2017 14:24:59 +0000 (15:24 +0100)]
s3:nmbd: Fix possible integer overflow

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:dsdb: Fix integer operations
Andreas Schneider [Thu, 7 Dec 2017 16:32:36 +0000 (17:32 +0100)]
s4:dsdb: Fix integer operations

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agolib:socket: Return early if we have only one interface
Andreas Schneider [Thu, 7 Dec 2017 14:54:13 +0000 (15:54 +0100)]
lib:socket: Return early if we have only one interface

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoldb: Fix size types in ldb_ldif functions
Andreas Schneider [Fri, 8 Dec 2017 09:03:00 +0000 (10:03 +0100)]
ldb: Fix size types in ldb_ldif functions

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:rpcclient: Fix size types
Andreas Schneider [Thu, 7 Dec 2017 18:21:38 +0000 (19:21 +0100)]
s3:rpcclient: Fix size types

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:rpc_server: Fix size types in spoolss
Andreas Schneider [Thu, 7 Dec 2017 17:50:20 +0000 (18:50 +0100)]
s3:rpc_server: Fix size types in spoolss

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:passdb: Fix size types
Andreas Schneider [Thu, 7 Dec 2017 17:48:45 +0000 (18:48 +0100)]
s3:passdb: Fix size types

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:modules: Fix size type in getdate
Andreas Schneider [Thu, 7 Dec 2017 19:07:08 +0000 (20:07 +0100)]
s3:modules: Fix size type in getdate

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:nmbd: Fix size type in nmbd_browsesync.c
Andreas Schneider [Thu, 7 Dec 2017 18:47:50 +0000 (19:47 +0100)]
s3:nmbd: Fix size type in nmbd_browsesync.c

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:utils: Fix size type in log2pcaphex
Andreas Schneider [Thu, 7 Dec 2017 18:47:04 +0000 (19:47 +0100)]
s3:utils: Fix size type in log2pcaphex

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:rpc_server: Fix size types in srvsvc
Andreas Schneider [Thu, 7 Dec 2017 17:42:44 +0000 (18:42 +0100)]
s3:rpc_server: Fix size types in srvsvc

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:vfs_nettalk: Fix size types
Andreas Schneider [Thu, 7 Dec 2017 17:39:07 +0000 (18:39 +0100)]
s3:vfs_nettalk: Fix size types

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:winbindd: Fix size types in idmap_tdb_common
Andreas Schneider [Thu, 7 Dec 2017 17:27:41 +0000 (18:27 +0100)]
s3:winbindd: Fix size types in idmap_tdb_common

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:printing: Fix size type in printing_db
Andreas Schneider [Thu, 7 Dec 2017 16:58:38 +0000 (17:58 +0100)]
s3:printing: Fix size type in printing_db

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:avahi: Fix size types
Andreas Schneider [Thu, 7 Dec 2017 16:57:05 +0000 (17:57 +0100)]
s3:avahi: Fix size types

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:client: Fix size types
Andreas Schneider [Thu, 7 Dec 2017 17:47:18 +0000 (18:47 +0100)]
s3:client: Fix size types

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:client: Fix size types
Andreas Schneider [Thu, 7 Dec 2017 16:55:34 +0000 (17:55 +0100)]
s4:client: Fix size types

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos4:torture: Fix size types in nss tests
Andreas Schneider [Thu, 7 Dec 2017 16:54:12 +0000 (17:54 +0100)]
s4:torture: Fix size types in nss tests

This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>