1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

111248 Commits

Author SHA1 Message Date
Amitay Isaacs
147ff850aa 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>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
4e37be92bf 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>
2018-03-27 04:27:24 +02:00
Amitay Isaacs
92a68af1a8 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>
2018-03-27 04:27:24 +02:00
Andrew Bartlett
2610a3f2f7 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
2018-03-24 07:21:37 +01:00
Andrew Bartlett
fc9150dcab 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>
2018-03-24 02:31:15 +01:00
Andrew Bartlett
d418d0ca33 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>
2018-03-24 02:31:15 +01:00
Andrew Bartlett
da72c4018e 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
2018-03-23 12:00:40 +01:00
David Mulder
e29a75e74a 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>
2018-03-23 07:28:26 +01:00
Noel Power
4f036497f1 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>
2018-03-23 07:28:26 +01:00
David Mulder
6a7cdad3e7 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>
2018-03-23 07:28:26 +01:00
David Mulder
a032ea5bf8 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>
2018-03-23 07:28:25 +01:00
Joe Guo
bb88292cee 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>
2018-03-23 07:28:25 +01:00
Douglas Bagnall
f6db12e236 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>
2018-03-23 07:28:25 +01:00
Noel Power
cd5a4519b1 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>
2018-03-23 07:28:25 +01:00
Noel Power
18a5afa6fb 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>
2018-03-23 07:28:25 +01:00
Noel Power
aea433ee0c 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>
2018-03-23 07:28:25 +01:00
Noel Power
0d65c1ef65 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>
2018-03-23 07:28:25 +01:00
Noel Power
4c02d5cafe 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>
2018-03-23 07:28:25 +01:00
Noel Power
330bbf7c3c 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>
2018-03-23 07:28:25 +01:00
Noel Power
0fa93f5fe9 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>
2018-03-23 07:28:25 +01:00
Noel Power
04487198a7 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>
2018-03-23 07:28:25 +01:00
Douglas Bagnall
8ca43ec8e2 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>
2018-03-23 07:28:25 +01:00
Douglas Bagnall
cd1136f39b README.Coding: mention compatible Python versions
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-23 07:28:24 +01:00
Noel Power
0844c5aa22 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>
2018-03-23 07:28:24 +01:00
Noel Power
7b897d6d1c 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>
2018-03-23 07:28:24 +01:00
Noel Power
2a64f77d4f 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>
2018-03-23 07:28:24 +01:00
Noel Power
220f19fce0 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>
2018-03-23 07:28:24 +01:00
Noel Power
40e7d57999 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>
2018-03-23 07:28:24 +01:00
Noel Power
bebdefeba9 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>
2018-03-23 07:28:24 +01:00
Noel Power
66ea49130d 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>
2018-03-23 07:28:24 +01:00
Noel Power
dd5c347da5 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>
2018-03-23 07:28:24 +01:00
Noel Power
66a9b4dc66 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>
2018-03-23 07:28:24 +01:00
Noel Power
a8aab19b90 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>
2018-03-23 07:28:24 +01:00
Noel Power
9c251740b4 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>
2018-03-23 07:28:23 +01:00
Noel Power
aacbe1b65c 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>
2018-03-23 07:28:23 +01:00
Noel Power
708abbf306 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>
2018-03-23 07:28:23 +01:00
Timur I. Bakeyev
b9f0c7f93c 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
2018-03-23 07:25:30 +01:00
Andrew Bartlett
e133490939 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>
2018-03-23 02:32:08 +01:00
Andrew Bartlett
8fd73b3891 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>
2018-03-23 02:32:08 +01:00
Andreas Schneider
35ca6161f1 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
2018-03-23 01:59:07 +01:00
Ralph Boehme
42d6dd2f30 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
2018-03-22 18:26:03 +01:00
Jamie McClymont
dd1f8cdf6b 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
2018-03-22 13:26:44 +01:00
Jamie McClymont
ba805dcd6f 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>
2018-03-22 08:00:25 +01:00
Jamie McClymont
3966342a18 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>
2018-03-22 08:00:25 +01:00
Andrew Bartlett
ef35fbfc8c 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>
2018-03-22 08:00:25 +01:00
Andrew Bartlett
0879be9758 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>
2018-03-22 08:00:25 +01:00
Andrew Bartlett
c32fa9bb22 travis-ci: Use Gold linker for faster builds
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-22 08:00:25 +01:00
Andrew Bartlett
87dac6295c travis-ci: Only un-shallow for PIDL
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-22 08:00:25 +01:00
Andrew Bartlett
d950556755 autobuild: Move defaulttasks to one-per-line
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-22 08:00:25 +01:00
Volker Lendecke
7964b3640a 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
2018-03-22 07:21:44 +01:00