gd/samba-autobuild/.git
5 months agoctdb/build: fix ctdb_mutex_ceph_rados_helper builds
David Disseldorp [Thu, 18 Apr 2019 18:14:31 +0000 (20:14 +0200)]
ctdb/build: fix ctdb_mutex_ceph_rados_helper builds

2b5dbb352553699afce62dca4964eb0bd64477f8 fixed builds with an explicit
--with-libcephfs but broke builds against system Ceph libraries. This
change handles both cases.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu May  9 04:24:56 UTC 2019 on sn-devel-184

5 months agos4 lib socket: Ensure address string owned by parent struct
Gary Lockyer [Tue, 7 May 2019 04:30:22 +0000 (16:30 +1200)]
s4 lib socket: Ensure address string owned by parent struct

The local address string was not owned by it's parent structure, which
caused a use after free error in
continue_ip_open_socket source4/librpc/rpc/dcerpc_sock.c:267

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May  8 20:03:42 UTC 2019 on sn-devel-184

5 months agog_lock: Fix a typo
Volker Lendecke [Mon, 6 May 2019 14:34:15 +0000 (16:34 +0200)]
g_lock: Fix a typo

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 May  8 17:47:39 UTC 2019 on sn-devel-184

5 months agog_lock: Apply some const
Volker Lendecke [Mon, 6 May 2019 14:19:22 +0000 (16:19 +0200)]
g_lock: Apply some const

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agodbwrap: Adapt tdb_data_buf's overflow handling to modern conventions
Volker Lendecke [Fri, 3 May 2019 13:43:35 +0000 (15:43 +0200)]
dbwrap: Adapt tdb_data_buf's overflow handling to modern conventions

This is the way we do it right now, avoid confusion why "tmp" might be
needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agodbwrap: Fix tdb_data_buf()
Volker Lendecke [Fri, 3 May 2019 13:42:42 +0000 (15:42 +0200)]
dbwrap: Fix tdb_data_buf()

IIRC there are platforms that don't like memcpy() with len=0.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos3:utils: If share is NULL in smbcacls, don't print it
Andreas Schneider [Wed, 8 May 2019 15:12:12 +0000 (17:12 +0200)]
s3:utils: If share is NULL in smbcacls, don't print it

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos3:utils: If share is NULL in smbcquotas, don't print it
Andreas Schneider [Wed, 8 May 2019 15:11:13 +0000 (17:11 +0200)]
s3:utils: If share is NULL in smbcquotas, don't print it

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos3:winbindd: Do not free db_path in idmap_tdb2 before we printed it
Andreas Schneider [Wed, 8 May 2019 15:05:58 +0000 (17:05 +0200)]
s3:winbindd: Do not free db_path in idmap_tdb2 before we printed it

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agoctdb:common: Do not print NULL if we don't get a sockpath
Andreas Schneider [Wed, 8 May 2019 15:03:54 +0000 (17:03 +0200)]
ctdb:common: Do not print NULL if we don't get a sockpath

sock_socket_start_recv() might not fill sockpath if we return early.

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos4:torture: Do not free full_name before we printed it
Andreas Schneider [Wed, 8 May 2019 14:58:07 +0000 (16:58 +0200)]
s4:torture: Do not free full_name before we printed it

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agolib:torture: Fix string comparison macros where we directly pass NULL
Andreas Schneider [Wed, 8 May 2019 14:54:30 +0000 (16:54 +0200)]
lib:torture: Fix string comparison macros where we directly pass NULL

See e.g. lib/util/tests/strlist.c +177

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos4:torture: Do not print NULL strings we just checked before
Andreas Schneider [Wed, 8 May 2019 14:51:20 +0000 (16:51 +0200)]
s4:torture: Do not print NULL strings we just checked before

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos4:ntvfs: Do not free eadb before we printed an error
Andreas Schneider [Wed, 8 May 2019 14:32:45 +0000 (16:32 +0200)]
s4:ntvfs: Do not free eadb before we printed an error

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos3:rpc_server: Do not free the tdbname before we printed it
Andreas Schneider [Wed, 8 May 2019 14:31:10 +0000 (16:31 +0200)]
s3:rpc_server: Do not free the tdbname before we printed it

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos4:auth: Fix debug statement in gensec_gssapi
Andreas Schneider [Wed, 8 May 2019 14:27:57 +0000 (16:27 +0200)]
s4:auth: Fix debug statement in gensec_gssapi

The 'role' is set to null, we should first set it to the correct value
before printing anything.

Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agoCID 1363286: Resource leak by failing to free tmp_ctx
Garming Sam [Tue, 7 May 2019 01:28:49 +0000 (13:28 +1200)]
CID 1363286: Resource leak by failing to free tmp_ctx

There are a few oddities in this function, including a duplicated NULL
check, a talloc_free of a context which is passed in and a number of
missing frees before a return.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed May  8 00:36:14 UTC 2019 on sn-devel-184

5 months agoCID 1363287: Resource leak using str_list_append
Garming Sam [Thu, 2 May 2019 05:11:57 +0000 (17:11 +1200)]
CID 1363287: Resource leak using str_list_append

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agowafsamba: Enable warnings about zero-length formats
Andreas Schneider [Thu, 14 Feb 2019 11:08:37 +0000 (12:08 +0100)]
wafsamba: Enable warnings about zero-length formats

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue May  7 18:45:06 UTC 2019 on sn-devel-184

5 months agowafsamba: Enable warnings about format overflows
Andreas Schneider [Thu, 14 Feb 2019 11:06:57 +0000 (12:06 +0100)]
wafsamba: Enable warnings about format overflows

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agoctdb: Fix format in db_hash_test
Andreas Schneider [Mon, 29 Apr 2019 11:26:04 +0000 (13:26 +0200)]
ctdb: Fix format in db_hash_test

error: ‘%04d’ directive writing between 4 and 11 bytes into a region of
size 5 [-Werror=format-overflow=]
   sprintf(key, "key%04d", i);

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 months agoctdb-tests: Don't clean up test var directory in autotest target
Martin Schwenke [Wed, 1 May 2019 05:17:14 +0000 (15:17 +1000)]
ctdb-tests: Don't clean up test var directory in autotest target

If the directory is always cleaned up then it is not possible to look
at daemon logs to debug test failures.

This target is only really used by autobuild.py, which (optionally)
cleans up the parent directory anyway.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue May  7 06:56:01 UTC 2019 on sn-devel-184

5 months agoctdb-tests: Fix usage message
Martin Schwenke [Wed, 1 May 2019 05:10:28 +0000 (15:10 +1000)]
ctdb-tests: Fix usage message

Since commit 0e9ead8f28fced3ebfa888786a1dc5bb59e734a3 daemons have
been shut down after each test, so this option no longer has anything
to do with killing daemons.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-tests: Wait to allow database attach/detach to take effect
Martin Schwenke [Sat, 27 Apr 2019 04:54:09 +0000 (14:54 +1000)]
ctdb-tests: Wait to allow database attach/detach to take effect

Sometimes the detach test fails:

  Check detaching single test database detach_test1.tdb
  BAD: database detach_test1.tdb is still attached
  Number of databases:4
  dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.0/db/volatile/detach_test4.tdb.0
  dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.0/db/volatile/detach_test3.tdb.0
  dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.0/db/volatile/detach_test2.tdb.0
  dbid:0xc62491f4 name:detach_test1.tdb path:tests/var/simple/node.0/db/volatile/detach_test1.tdb.0
  Number of databases:3
  dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.1/db/volatile/detach_test4.tdb.1
  dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.1/db/volatile/detach_test3.tdb.1
  dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.1/db/volatile/detach_test2.tdb.1
  Number of databases:4
  dbid:0x5ae995ee name:detach_test4.tdb path:tests/var/simple/node.2/db/volatile/detach_test4.tdb.2
  dbid:0xd84cc13c name:detach_test3.tdb path:tests/var/simple/node.2/db/volatile/detach_test3.tdb.2
  dbid:0x8e8e8cef name:detach_test2.tdb path:tests/var/simple/node.2/db/volatile/detach_test2.tdb.2
  dbid:0xc62491f4 name:detach_test1.tdb path:tests/var/simple/node.2/db/volatile/detach_test1.tdb.2
  *** TEST COMPLETED (RC=1) AT 2019-04-27 03:35:40, CLEANING UP...

When issued from a client, the detach control re-broadcasts itself
asynchronously to all nodes and then returns success.  The controls to
some nodes to do the actual detach may still be in flight when success
is returned to the client.  Therefore, the test should wait for a few
seconds to allow the asynchronous controls to complete.

The same is true for the attach control, so workaround the problem in
the attach test too.

An alternative is to make the attach and detach controls synchronous
by avoiding the broadcast and waiting for the results of the
individual controls sent to the nodes.  However, a simple
implementation would involve adding new nested event loops.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-tests: Avoid bulk output in $out, prefer $outfile
Martin Schwenke [Thu, 11 Apr 2019 10:55:20 +0000 (20:55 +1000)]
ctdb-tests: Avoid bulk output in $out, prefer $outfile

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-tests: Make try_command_on_node less error-prone
Martin Schwenke [Thu, 28 Mar 2019 03:26:52 +0000 (14:26 +1100)]
ctdb-tests: Make try_command_on_node less error-prone

This sometimes fails, apparently due to a cat process in onnode
getting EAGAIN.  The conclusion is that tests that process large
amounts of output should not depend on a sub-shell delivering that
output into a shell variable.

Change try_command_on_node() to leave all of the output in file
$outfile and just put the first 1KB into $out.  $outfile is removed
after each test completes.

Change the implementation of sanity_check_output() to use $outfile
instead of $out.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-tests: Change sanity_check_output() to internally use $out
Martin Schwenke [Tue, 30 Apr 2019 02:09:26 +0000 (12:09 +1000)]
ctdb-tests: Change sanity_check_output() to internally use $out

All callers are currently passed $out.  Global variable $out is used
in many other places so use it here to simplify the interface and make
future changes simpler.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-scripts: Drop script configuration variable CTDB_MONITOR_SWAP_USAGE
Martin Schwenke [Fri, 29 Mar 2019 00:19:55 +0000 (11:19 +1100)]
ctdb-scripts: Drop script configuration variable CTDB_MONITOR_SWAP_USAGE

CTDB's system memory monitoring in 05.system.script monitors both main
memory and swap.  The swap monitoring was originally based on
the (possibly incorrect, see below) idea that swap space stacks on top
of main memory, so that when a system starts filling swap space then
this is supposed to be a good sign that the system is running out of
memory.  Additionally, performance on a Linux system tends to be
destroyed by the I/O associated with a lot of swapping to spinning
disks.

However, some platforms default to creating only 4GB of swap space
even when there is 128GB of main memory.  With such a small swap to
main memory ratio, memory pressure can force swap to be nearly full
even when a significant amount of main memory is still available and
the system is performing well.  This suggests that checking swap
utilisation might be less than useful in many circumstances.

So, remove the separate swap space checking and change the memory
check to cover the total of main memory and swap space.

Test function set_mem_usage() still takes an argument for each of main
memory and swap space utilisation.  For simplicity, the same number is
now passed twice to make the intended results comprehensible.  This
could be changed later.

A couple of tests are cleaned up to no longer use hard-coded
/proc/meminfo and ps output.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-tests: Extend test to cover ctdb rddumpmemory
Martin Schwenke [Thu, 11 Apr 2019 06:58:10 +0000 (16:58 +1000)]
ctdb-tests: Extend test to cover ctdb rddumpmemory

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-tools: Fix ctdb dumpmemory to avoid printing trailing NUL
Martin Schwenke [Thu, 11 Apr 2019 06:56:32 +0000 (16:56 +1000)]
ctdb-tools: Fix ctdb dumpmemory to avoid printing trailing NUL

Fix ctdb rddumpmemory too.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-daemon: Log when ctdbd CPU utilisation exceeds a threshold
Martin Schwenke [Fri, 18 Jan 2019 06:46:37 +0000 (17:46 +1100)]
ctdb-daemon: Log when ctdbd CPU utilisation exceeds a threshold

This is to help us notice when ctdbd is using the full capacity of a
CPU, so is saturated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agoctdb-build: Add check for getrusage()
Martin Schwenke [Fri, 18 Jan 2019 06:43:44 +0000 (17:43 +1100)]
ctdb-build: Add check for getrusage()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 months agos4 dns_server Bind9: Log opertion durations
Gary Lockyer [Thu, 4 Apr 2019 22:13:15 +0000 (11:13 +1300)]
s4 dns_server Bind9: Log opertion durations

Add duration debug logging to the samba bind9 dlz driver and the
dnsserver_common routines.  This should aid future diagnosis of
performance issues, and could be used to monitor DNS performance.

The logs are currently Human readable text only, i.e. no JSON formatted
output.

Log lines are of the form:

<function>: DNS timing: result: [<result>] \
duration: (<duration>) zone: [<zone>] name: [<name>] \
data: [<data>]

e.g.

dns_common_wildcard_lookup: DNS timing: result: [WERR_OK] \
duration: (111) zone: [] \
name: [DC=_ldap._tcp.Default-First-Site-Name._sites.ForestDnsZones,\
DC=chgdcpassword.samba.example.com,CN=MicrosoftDNS,DC=DomainDnsZones,\
DC=chgdcpassword,DC=samba,DC=example,DC=com] data: []

Enabled by setting log level to "dns:10"

durations are in microseconds.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May  7 05:03:26 UTC 2019 on sn-devel-184

5 months agolib:crypto: Remove unused SHA512
Andreas Schneider [Mon, 22 Oct 2018 16:20:04 +0000 (18:20 +0200)]
lib:crypto: Remove unused SHA512

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos3:smbd: Use GnuTLS SHA512 in smb2 session setup
Andreas Schneider [Mon, 22 Oct 2018 15:48:43 +0000 (17:48 +0200)]
s3:smbd: Use GnuTLS SHA512 in smb2 session setup

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos3:smbd: Use GnuTLS SHA512 in smb2 server
Andreas Schneider [Mon, 22 Oct 2018 15:44:33 +0000 (17:44 +0200)]
s3:smbd: Use GnuTLS SHA512 in smb2 server

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agolibcli:smb: Use GnuTLS SHA512 in smbXcli_base
Andreas Schneider [Wed, 17 Oct 2018 16:09:06 +0000 (18:09 +0200)]
libcli:smb: Use GnuTLS SHA512 in smbXcli_base

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agogitlab-ci: Enable building on CentOS7
Andreas Schneider [Tue, 30 Apr 2019 06:34:00 +0000 (08:34 +0200)]
gitlab-ci: Enable building on CentOS7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May  7 01:45:37 UTC 2019 on sn-devel-184

5 months agobootstrap: Install correct python modules on CentOS7
Andreas Schneider [Tue, 30 Apr 2019 10:20:34 +0000 (12:20 +0200)]
bootstrap: Install correct python modules on CentOS7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agobootstrap: Move to python 3.6 on CentOS
Andreas Schneider [Mon, 6 May 2019 08:33:01 +0000 (10:33 +0200)]
bootstrap: Move to python 3.6 on CentOS

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agobootstrap: Make sure that the python3 interpreter is installed
Andreas Schneider [Tue, 30 Apr 2019 07:48:39 +0000 (09:48 +0200)]
bootstrap: Make sure that the python3 interpreter is installed

We need it for waf ;-)

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agobootstrap: Fix yum commands
Andreas Schneider [Tue, 30 Apr 2019 06:33:15 +0000 (08:33 +0200)]
bootstrap: Fix yum commands

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agowaf: Also check for gnutls_privkey_export_x509()
Andreas Schneider [Mon, 6 May 2019 09:12:54 +0000 (11:12 +0200)]
waf: Also check for gnutls_privkey_export_x509()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agonsswitch pam_winbind: Fix Asan use after free
Gary Lockyer [Wed, 17 Apr 2019 21:29:28 +0000 (09:29 +1200)]
nsswitch pam_winbind: Fix Asan use after free

Fix use after free condition detected by Address Sanitizer triggered by
wbcLogonUserInfoDestructor, wbcFreeMemory has code to detect and prevent a
double free.  This patch prevents the Address Sanitizer error, allowing
tests to be run with Address Sanitizer enabled.

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon May  6 08:55:22 UTC 2019 on sn-devel-184

5 months agoselftest: Utils.cmd_output returns byte string
Gary Lockyer [Mon, 6 May 2019 01:14:37 +0000 (13:14 +1200)]
selftest: Utils.cmd_output returns byte string

Convert the returned byte string into a string.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos4 heimdal_build: disable leak checks for asn1 compiler
Gary Lockyer [Mon, 6 May 2019 01:12:33 +0000 (13:12 +1200)]
s4 heimdal_build: disable leak checks for asn1 compiler

Disable Address Sanitizer leak checking for the heimdal asn1 compiler, this
allows a samba build with Address Sanitizer enabled.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos4/scripting/bin Remove unecessary scripts
Noel Power [Tue, 30 Apr 2019 11:24:11 +0000 (12:24 +0100)]
s4/scripting/bin Remove unecessary scripts

Apparently we get official schema from MS these days

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agolibnet: Remove unused source4/libnet/libnet_sam{dump,sync}:
Andrew Bartlett [Mon, 6 May 2019 02:37:19 +0000 (14:37 +1200)]
libnet: Remove unused source4/libnet/libnet_sam{dump,sync}:

The last caller was removed in samba-tool: Remove C version of samba-tool
(e2af38415163f248e3dbd5a2abc156761e74b87c) by Amitay Isaacs in 2011

This was a tool to dump a genine NT4 DC (never Samba) into smbpasswd file.

It did work against Windows AD, but DRS replication is much
more comprehensive.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon May  6 07:11:51 UTC 2019 on sn-devel-184

5 months agolibnet: Remove unused source4/libnet/libnet_samsync_ldb.c
Andrew Bartlett [Mon, 6 May 2019 02:31:51 +0000 (14:31 +1200)]
libnet: Remove unused source4/libnet/libnet_samsync_ldb.c

The last caller was removed in samba-tool: Remove C version of samba-tool
(e2af38415163f248e3dbd5a2abc156761e74b87c) by Amitay Isaacs in 2011

This was a prototype tool to sync a genine NT4 DC (never Samba) into ldb.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agotorture: Remove unused dsdb_attribute_ldb_to_drsuapi()
Andrew Bartlett [Mon, 6 May 2019 02:23:29 +0000 (14:23 +1200)]
torture: Remove unused dsdb_attribute_ldb_to_drsuapi()

The last caller was removed in s4-drs: GetNCChanges() to return correct (in AD-way) ATTIDs
(6a51afcfdbcbce7813fb59c0655e4178268ca70e) by Kamen Mazdrashki in 2010

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agotorture: Remove unused torture_join_server_dn_str()
Andrew Bartlett [Mon, 6 May 2019 02:14:47 +0000 (14:14 +1200)]
torture: Remove unused torture_join_server_dn_str()

The last caller was removed in 2010 by
s4:torture Rework NET-API-BECOMEDC test to use libnet_vampire callbacks.
in ecf782da87b67b8d977aa1bbfce21f1b6ed8288a

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agotorture: Remove unused torture_ldap_connection2()
Andrew Bartlett [Mon, 6 May 2019 02:09:49 +0000 (14:09 +1200)]
torture: Remove unused torture_ldap_connection2()

The last caller was removed by 'r7626: a new ldap client library'
in 2005 with bab977dad76e9204278c7afe0bb905cda064f488.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agolib/tls: Remove unused source4/lib/tls/tls.c (tls socket wrapper)
Andrew Bartlett [Mon, 6 May 2019 01:45:37 +0000 (13:45 +1200)]
lib/tls: Remove unused source4/lib/tls/tls.c (tls socket wrapper)

The last caller was removed in 72c79e30f07bcc98610cca878f5de50e7db239a0
to remove the web server as all other callers use tls_tstream.

Found by callcatcher.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agos4-winbindd: Removed unused wb_utils.c
Andrew Bartlett [Mon, 6 May 2019 01:36:36 +0000 (13:36 +1200)]
s4-winbindd: Removed unused wb_utils.c

Garming noticed this was untested code in the lcov report, and it turns out to be unused.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agobuild: Remove ndr_PyLong_FromUnsignedLongLong wrapper from NT_STATUS and W_ERROR...
Andrew Bartlett [Mon, 6 May 2019 03:58:49 +0000 (15:58 +1200)]
build: Remove ndr_PyLong_FromUnsignedLongLong wrapper from NT_STATUS and W_ERROR table generator

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agopidl: Call PyLong_FromUnsignedLongLong directly rather than via inline helper
Andrew Bartlett [Sun, 5 May 2019 23:25:33 +0000 (11:25 +1200)]
pidl: Call PyLong_FromUnsignedLongLong directly rather than via inline helper

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agopidl: Call PyLong_FromLongLong() directly rather than via inline helper
Andrew Bartlett [Sun, 5 May 2019 23:24:39 +0000 (11:24 +1200)]
pidl: Call PyLong_FromLongLong() directly rather than via inline helper

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agopidl: Always call PyLong_FromUnsignedLongLong() in ndr_PyLong_FromUnsignedLongLong()
Andrew Bartlett [Sun, 5 May 2019 23:22:55 +0000 (11:22 +1200)]
pidl: Always call PyLong_FromUnsignedLongLong() in ndr_PyLong_FromUnsignedLongLong()

The C type is "unsigned long long" so use that always, as the Python type is now always the same.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agopidl: Always call PyLong_FromLongLong() in ndr_PyLong_FromLongLong()
Andrew Bartlett [Sun, 5 May 2019 23:22:09 +0000 (11:22 +1200)]
pidl: Always call PyLong_FromLongLong() in ndr_PyLong_FromLongLong()

The C type is "long long" so use that always, as the Python type is now always the same.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agopidl: No longer use Python3 compat define: PyInt_FromLong -> PyLong_FromLong
Andrew Bartlett [Sun, 5 May 2019 23:17:32 +0000 (11:17 +1200)]
pidl: No longer use Python3 compat define: PyInt_FromLong -> PyLong_FromLong

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agotalloc: Follow pattern of ldb and tdb to ensure "make test" depends on a build
Andrew Bartlett [Sun, 5 May 2019 23:09:16 +0000 (11:09 +1200)]
talloc: Follow pattern of ldb and tdb to ensure "make test" depends on a build

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agoreplace: Fix "make test" to actually test libreplace
Andrew Bartlett [Sun, 5 May 2019 22:23:49 +0000 (10:23 +1200)]
replace: Fix "make test" to actually test libreplace

Found by Joe Guo during preperation for automated code coverage output.

In order to allow the Makefile wrapper to work we need to rename the
test directory to tests.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agobuild: Remove build of replacetort
Andrew Bartlett [Mon, 6 May 2019 03:32:12 +0000 (15:32 +1200)]
build: Remove build of replacetort

This is built close to the code it tests in lib/replace/wscript_build as
replace_testsuite.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 months agoselftest: correcting empty attribute usage in requests
Aaron Haslett [Thu, 28 Mar 2019 02:54:06 +0000 (15:54 +1300)]
selftest: correcting empty attribute usage in requests

Many parts of Samba use an empty attribute list in requests expecting
all attributes to be returned in the response, which is incorrect.  This
patch corrects the instances found by current CI tests.  Static analysis
and debugging will need to be done before changing ildap to the correct
semantics.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon May  6 05:45:55 UTC 2019 on sn-devel-184

5 months agoldap: test for empty attributes list
Aaron Haslett [Wed, 20 Mar 2019 06:17:07 +0000 (19:17 +1300)]
ldap: test for empty attributes list

Test for LDAP request with an empty attribute list.  LDB responds with
no attributes, but LDAP responds with all attributes.  Fix is attached
to the bug below but we can't push it upstream until we've found all
instances of incorrect empty attribute list usage in Samba.

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

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agolib util debug: Increase format buffer to 4KiB
Gary Lockyer [Wed, 17 Apr 2019 22:23:22 +0000 (10:23 +1200)]
lib util debug: Increase format buffer to 4KiB

Increase the debug line buffer to 4KiB, the existing size of 1KiB is too
small for dsdbChange JSON audit messages.  These messages were then
split across multipe lines causing issues in log ingestion tools
expecting single line messages.

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon May  6 01:18:22 UTC 2019 on sn-devel-184

5 months ago.gitlab-ci.yml: add docker tag back for private jobs
Joe Guo [Wed, 1 May 2019 23:04:05 +0000 (11:04 +1200)]
.gitlab-ci.yml: add docker tag back for private jobs

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-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): Sun May  5 23:22:54 UTC 2019 on sn-devel-184

5 months ago.gitlab-ci.yml: rm abs path in artifacts
Joe Guo [Wed, 1 May 2019 23:05:23 +0000 (11:05 +1200)]
.gitlab-ci.yml: rm abs path in artifacts

According to doc: https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html#defining-artifacts-in-gitlab-ciyml
all paths in artifacts must be relative to the cloned repo, so this line
actually never worked.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agobootstrap: add lcov to generate code coverage report
Joe Guo [Fri, 3 May 2019 02:21:24 +0000 (14:21 +1200)]
bootstrap: add lcov to generate code coverage report

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agosmbd: Use "ISDOT" in reply_setatr
Volker Lendecke [Mon, 15 Apr 2019 20:31:40 +0000 (22:31 +0200)]
smbd: Use "ISDOT" in reply_setatr

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): Fri May  3 23:45:55 UTC 2019 on sn-devel-184

5 months agolibcli: Align integer types
Volker Lendecke [Fri, 12 Apr 2019 13:03:26 +0000 (15:03 +0200)]
libcli: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agolibcli: Remove an unnecessary #include
Volker Lendecke [Fri, 12 Apr 2019 13:03:12 +0000 (15:03 +0200)]
libcli: Remove an unnecessary #include

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agosmbd: Use a struct initializer
Volker Lendecke [Thu, 25 Apr 2019 19:03:35 +0000 (21:03 +0200)]
smbd: Use a struct initializer

With -O3 this saves 32 bytes of .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agosmbd: Make "check_access()" static to trans2.c
Volker Lendecke [Sun, 14 Apr 2019 09:41:49 +0000 (11:41 +0200)]
smbd: Make "check_access()" static to trans2.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agosmbd: Use smbd_check_access_rights in reply_setatr()
Volker Lendecke [Sun, 14 Apr 2019 09:39:31 +0000 (11:39 +0200)]
smbd: Use smbd_check_access_rights in reply_setatr()

That was the only caller of check_access outside of trans2.c, and it
passed an explicit NULL for fsp. Use the lower-level call, so we can
make check_access() static to trans2.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos3: modules: ceph: use current working directory instead of share path
Robert Sander [Thu, 2 May 2019 18:20:44 +0000 (11:20 -0700)]
s3: modules: ceph: use current working directory instead of share path

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

Signed-off-by: Robert Sander <r.sander@heinlein-support.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  2 19:34:11 UTC 2019 on sn-devel-184

5 months agosmbd: implement SMB_FILE_NORMALIZED_NAME_INFORMATION handling
Stefan Metzmacher [Thu, 25 Apr 2019 12:57:33 +0000 (14:57 +0200)]
smbd: implement SMB_FILE_NORMALIZED_NAME_INFORMATION handling

Windows 10 (1803 and higher) support and use
SMB_FILE_NORMALIZED_NAME_INFORMATION calls over the network. As a
fallback (in case the server don't support it) the client traverses all
path components, which is very expensive.

Implementing SMB_FILE_NORMALIZED_NAME_INFORMATION is very cheap for us
as the open already went through unix_convert() and we have the
information the client is asking for.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May  1 18:33:00 UTC 2019 on sn-devel-184

5 months agos4:torture/smb2: add smb2.getinfo.normalized test
Stefan Metzmacher [Thu, 25 Apr 2019 12:57:02 +0000 (14:57 +0200)]
s4:torture/smb2: add smb2.getinfo.normalized test

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos4:libcli/raw: add RAW_FILEINFO_NORMALIZED_NAME_INFORMATION support
Stefan Metzmacher [Thu, 25 Apr 2019 10:12:34 +0000 (12:12 +0200)]
s4:libcli/raw: add RAW_FILEINFO_NORMALIZED_NAME_INFORMATION support

This is supported over the wire in SMB 3.1.1 on starting with
Windows 10 1803.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agosmbd: allow case insensitive opens of named streams
Stefan Metzmacher [Thu, 25 Apr 2019 15:30:43 +0000 (17:30 +0200)]
smbd: allow case insensitive opens of named streams

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agos4:torture/smb2: add smb2.stream.names3 test
Stefan Metzmacher [Mon, 29 Apr 2019 12:53:13 +0000 (14:53 +0200)]
s4:torture/smb2: add smb2.stream.names3 test

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 months agoscript/attr_count_read: load and correlate all data
Douglas Bagnall [Sun, 31 Mar 2019 03:07:57 +0000 (16:07 +1300)]
script/attr_count_read: load and correlate all data

This changes script/attr_count_read to take the samba private directory
as an argument and load all the databases at once, printing them as
one big table. It isn't extremely clear what it all means, but it
*tries* to tell you.

With --plot, it will attempt to load matplotlib and plot the number of
requested attributes against the number returned, with colour
of each point indicating its relative frequency. It is a scatterplot
that wants to be a heatmap.

With --no-casefold, you can get an extra confusing table where,
for instance, something repeatedly asks for "attributeId" which is not
accounted for, while in a completely different row an unrequested
"attributeID" is found many times over.

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 May  1 06:46:36 UTC 2019 on sn-devel-184

5 months agodsdb/modules: a module to count attribute searches and results
Douglas Bagnall [Thu, 28 Mar 2019 03:07:48 +0000 (16:07 +1300)]
dsdb/modules: a module to count attribute searches and results

The dsdb module stack can turn a simple search request into a
complicated tree of sub-queries that include attributes not originally
asked for and excluding those that were. The corresponding replies
might contain unrequested attributes or (for good reasons, according
to some module) hide requested ones. The entire stack is there to
meddle and that is what is does. Except *this* module. It just counts.
To understand dsdb performance it helps to have some idea what
requests and replies are flying too and fro. This module, when
inserted anywhere in the stack, counts the requests and replies
passing through and the attributes they contain. This data is stored
in on-disk tdbs in the private/debug directory.

The module is not loaded by default. To load it you need to patch the
source4/dsdb/samdb/ldb_modules/samba_dsdb.c and put "count_attrs"
somewhere in the module lists in the samba_dsdb_init() function. For
example, to examine the traffic between repl_meta_data and
group_audit_log, you would do something like this around line 316:

          "subtree_delete",
          "repl_meta_data",
  +       "count_attrs",
          "group_audit_log",
          "encrypted_secrets",

and recompile. Samba will then write to a number of tdb files in the
debug directory as requests and replies pass through. A simple script
is included to read these files. Doing this:

./script/attr_count_read st/ad_dc/private/debug/debug/attr_counts_not_found.tdb

will print a table showing how often various attritbutes were
requested but not found (from the point of view of the module).

A more sophisticated version of the script is coming in the next
commit, but this one is included first because in its simplicity it
documents the storage format reasonably well. The tdb keys are
attribute names, and the values are uint32_t in machine native order.

When the module is included in the stack there will be a very small
decrease in performance.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agopytests: slightly better errors in Testcase.insta_creds()
Douglas Bagnall [Thu, 18 Apr 2019 01:37:27 +0000 (13:37 +1200)]
pytests: slightly better errors in Testcase.insta_creds()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agopytests: try ldap.modify_order with normal user
Douglas Bagnall [Thu, 18 Apr 2019 01:39:58 +0000 (13:39 +1200)]
pytests: try ldap.modify_order with normal user

We run the tests again, trying to modify as a normal user rather than
Administrator.

It turns out that we do not always return the same error code as
Windows, but in all these tests both Windows and Samba always return
some kind of error (as you might hope).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agodsdb pytests: test the effect of reordering modify requests
Douglas Bagnall [Fri, 12 Apr 2019 12:23:26 +0000 (00:23 +1200)]
dsdb pytests: test the effect of reordering modify requests

Do we interpret these the same way as Windows? In many cases, no.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos4/tests.py: shorten lines with common path
Douglas Bagnall [Fri, 12 Apr 2019 12:21:29 +0000 (00:21 +1200)]
s4/tests.py: shorten lines with common path

A small step

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agodsdb/pytest/ldap: use idiomatic 'e' for exceptions
Douglas Bagnall [Fri, 12 Apr 2019 03:51:05 +0000 (15:51 +1200)]
dsdb/pytest/ldap: use idiomatic 'e' for exceptions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agodsdb/pytest/ldap: revive commented out test for attr size range
Douglas Bagnall [Fri, 12 Apr 2019 04:09:55 +0000 (16:09 +1200)]
dsdb/pytest/ldap: revive commented out test for attr size range

The test was presumably commented out because we fail it, and
known-failing it would have hidden the attr-too-short tests that it
was bundled with. If we disentangle them we can knwn-fail it, which
serves as a TODO list.

(passes against WIN2012R2).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months ago.gitlab-ci.yml: keep samba-ci-private tag only for private jobs
Joe Guo [Wed, 1 May 2019 03:18:31 +0000 (15:18 +1200)]
.gitlab-ci.yml: keep samba-ci-private tag only for private jobs

This will help us give the legacy 'private' tag, used in branches
under maintenance, more resources without those jobs running on the
normal production runners (therefore avoiding the additional cost for
the 90% of builds that are for master).

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>
5 months agos4:samdb: Make sure value is initialized with 0
Andreas Schneider [Tue, 30 Apr 2019 14:23:17 +0000 (16:23 +0200)]
s4:samdb: Make sure value is initialized with 0

Found by csbuild.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May  1 05:02:22 UTC 2019 on sn-devel-184

5 months agolib:torture: Fix size type in torture macro
Andreas Schneider [Tue, 30 Apr 2019 12:23:52 +0000 (14:23 +0200)]
lib:torture: Fix size type in torture macro

Found by csbuild.
https://gitlab.com/samba-team/devel/samba/-/jobs/204481431

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos4/replmd delete: optimise attribute preservation with binary search
Douglas Bagnall [Tue, 30 Apr 2019 22:41:41 +0000 (10:41 +1200)]
s4/replmd delete: optimise attribute preservation with binary search

When we get here it is very likely that the attribute will not be
preserved, as the preserved ones should have had the flag set, but we
still end up loking through the whole list to confirm. With a binary
search, we end up looking at ~5 attributes to confirm.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agos4/replmd: delete checks flag before laborious search
Douglas Bagnall [Tue, 30 Apr 2019 22:35:46 +0000 (10:35 +1200)]
s4/replmd: delete checks flag before laborious search

Most (perhaps all) attributes that are in the "must not remove" list also
have the PRESERVEONDELETE bit set, and checking bits is much cheaper
than a linear search involving strcasecmp. If we check the bit first
we save work.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agosmbd: Move deadtime default to parameter definition and man page
Christof Schmitt [Mon, 29 Apr 2019 18:01:44 +0000 (11:01 -0700)]
smbd: Move deadtime default to parameter definition and man page

The code has a default of one week (10080 minutes) if the parameter is
set to 0. Make this the public default of the parameter, instead of
hiding it in the code. This change also has the code match the
documentation that setting this parameter to 0 disables the check.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 months agotraffic: load dns query from file and write stats to file
Joe Guo [Tue, 26 Mar 2019 04:48:39 +0000 (17:48 +1300)]
traffic: load dns query from file and write stats to file

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May  1 01:10:42 UTC 2019 on sn-devel-184

5 months agotraffic: define kerberos_state to simplify code
Joe Guo [Tue, 26 Mar 2019 06:50:35 +0000 (19:50 +1300)]
traffic: define kerberos_state to simplify code

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 months agotraffic: make code more pythonic
Joe Guo [Sun, 24 Mar 2019 23:59:44 +0000 (12:59 +1300)]
traffic: make code more pythonic

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 months agotraffic_replay: Avoid Exception if no packet rate is specified
Tim Beale [Wed, 10 Apr 2019 01:12:30 +0000 (13:12 +1200)]
traffic_replay: Avoid Exception if no packet rate is specified

traffic_replay would throw an exception if you didn't specify some sort
of packet rate. We can avoid this by using --scale-traffic=1.0 as the
default if nothing else was specified.

 script/traffic_replay model.txt $SERVER.$REALM --duration=10
   --fixed-password=blahblah12# -U$USERNAME%$PASSWORD
INFO 2019-04-10 01:03:01,809 pid:47755 script/traffic_replay #280: Using
the specified model file to generate conversations
Traceback (most recent call last):
  File "script/traffic_replay", line 438, in <module>
    main()
  File "script/traffic_replay", line 293, in main
    opts.conversation_persistence)
  File "bin/python/samba/emulate/traffic.py", line 1295, in
generate_conversation_sequences
    target_packets = int(packet_rate * duration)
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 months agotraffic_replay: Assign users to groups by default
Tim Beale [Wed, 10 Apr 2019 00:55:26 +0000 (12:55 +1200)]
traffic_replay: Assign users to groups by default

The traffic_replay script has a myriad of options, but by default when
it creates user accounts it does not assign these users to any groups
(you have to specify extra options to do that). This isn't really a fair
test of samba performance, because it's unlikely that real world setups
will have users that are in no groups (other than the default ones).

This patch changes the default behaviour so that it will assign the new
users to groups automatically, if no other group options were
specified.

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