sfrench/samba-autobuild/.git
2 years agoctdb-locking: Get tdb open flags from tdb instead of re-calculating
Amitay Isaacs [Thu, 2 Mar 2017 04:37:19 +0000 (15:37 +1100)]
ctdb-locking: Get tdb open flags from tdb instead of re-calculating

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Store tdb flags just after tdb is opened in ctdb_local_attach()
Amitay Isaacs [Thu, 2 Mar 2017 03:52:00 +0000 (14:52 +1100)]
ctdb-daemon: Store tdb flags just after tdb is opened in ctdb_local_attach()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-daemon: Once database is attached, do not modify tdb flags
Amitay Isaacs [Thu, 2 Mar 2017 00:15:26 +0000 (11:15 +1100)]
ctdb-daemon: Once database is attached, do not modify tdb flags

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoauth/ntlmssp: make ntlmssp_server_check_password() shorter
Stefan Metzmacher [Fri, 16 Jun 2017 15:11:17 +0000 (17:11 +0200)]
auth/ntlmssp: make ntlmssp_server_check_password() shorter

We move as must as possible into ntlmssp_server_{pre,post}auth().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 26 13:07:30 CEST 2017 on sn-devel-144

2 years agoauth/ntlmssp: remove useless talloc_steal calls in ntlmssp_server_check_password()
Stefan Metzmacher [Fri, 16 Jun 2017 16:03:11 +0000 (18:03 +0200)]
auth/ntlmssp: remove useless talloc_steal calls in ntlmssp_server_check_password()

We only create a temporary auth_usersupplied_info structure and pass it
down as const, lets keep the values on ntlmssp_state otherwise we may derefence
stale pointers.

We finally free the memory at the end of ntlmssp_server_postauth() now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb/samdb: pass an existing 'struct ldb_context' to crack_auto_name_to_nt4_name()
Stefan Metzmacher [Mon, 19 Jun 2017 06:39:19 +0000 (08:39 +0200)]
s4:dsdb/samdb: pass an existing 'struct ldb_context' to crack_auto_name_to_nt4_name()

There's no point in creating a temporary ldb_context as
the only callers already have a valid struct ldb_context for
the local sam.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:dsdb/samdb: pass an existing 'struct ldb_context' to crack_name_to_nt4_name()
Stefan Metzmacher [Mon, 19 Jun 2017 06:39:19 +0000 (08:39 +0200)]
s4:dsdb/samdb: pass an existing 'struct ldb_context' to crack_name_to_nt4_name()

There's no point in creating a temporary ldb_context as
all direct callers already have a valid struct ldb_context for
the local sam.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth/unix_token: remove unused tevent_context from auth_session_info_fill_unix()
Stefan Metzmacher [Mon, 19 Jun 2017 06:26:26 +0000 (08:26 +0200)]
s4:auth/unix_token: remove unused tevent_context from auth_session_info_fill_unix()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4:auth/unix_token: remove unused tevent_context from security_token_to_unix_token()
Stefan Metzmacher [Mon, 19 Jun 2017 06:26:26 +0000 (08:26 +0200)]
s4:auth/unix_token: remove unused tevent_context from security_token_to_unix_token()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: call auth_check_password_session_info() only in one central place
Stefan Metzmacher [Sun, 18 Jun 2017 10:53:05 +0000 (12:53 +0200)]
s3:smbd: call auth_check_password_session_info() only in one central place

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: introduce a reply_sesssetup_and_X_state
Stefan Metzmacher [Sun, 18 Jun 2017 10:48:11 +0000 (12:48 +0200)]
s3:smbd: introduce a reply_sesssetup_and_X_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: inline check_guest_password() into reply_sesssetup_and_X()
Stefan Metzmacher [Sun, 18 Jun 2017 10:08:58 +0000 (12:08 +0200)]
s3:smbd: inline check_guest_password() into reply_sesssetup_and_X()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3:smbd: only set user_info->auth_description on success
Stefan Metzmacher [Sun, 18 Jun 2017 10:06:10 +0000 (12:06 +0200)]
s3:smbd: only set user_info->auth_description on success

Otherwise we'll derefence a NULL pointer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopidl:NDR/Parser: initialize [skip] values in ndr_pull_*
Stefan Metzmacher [Tue, 13 Jun 2017 07:57:33 +0000 (09:57 +0200)]
pidl:NDR/Parser: initialize [skip] values in ndr_pull_*

It's too dangerous to leave values uninitialzed!
[skip_noinit] can be used if required.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agontprinting.idl: make use of [skip_noinit] for string_flags
Stefan Metzmacher [Wed, 21 Jun 2017 13:11:28 +0000 (15:11 +0200)]
ntprinting.idl: make use of [skip_noinit] for string_flags

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agopidl:NDR/Parser: add "skip_noinit" element
Stefan Metzmacher [Wed, 21 Jun 2017 13:05:35 +0000 (15:05 +0200)]
pidl:NDR/Parser: add "skip_noinit" element

In future "skip" will be changed to initialize the element
with ZERO_STRUCT() on ndr_pull_*.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agopidl:NDR/Parser: fix "skip" for pointers
Stefan Metzmacher [Mon, 19 Jun 2017 10:15:21 +0000 (12:15 +0200)]
pidl:NDR/Parser: fix "skip" for pointers

We should handle the "skip" at the element level before
we traverse trough the element levels.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agoctdb-scripts: Don't send empty argument string to logger
Amitay Isaacs [Thu, 22 Jun 2017 04:34:36 +0000 (14:34 +1000)]
ctdb-scripts: Don't send empty argument string to logger

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

This stops logger reading from stdin.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Jun 24 14:37:48 CEST 2017 on sn-devel-144

2 years agoctdb-recovery: Do not run local ip verification when in recovery
Amitay Isaacs [Thu, 22 Jun 2017 06:15:47 +0000 (16:15 +1000)]
ctdb-recovery: Do not run local ip verification when in recovery

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

If we drop public IPs because CTDB is in recovery for too long, then
avoid spamming logs "Trigger takeoverrun" every second.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-recovery: Get recmode unconditionally in the main_loop
Amitay Isaacs [Thu, 22 Jun 2017 07:45:20 +0000 (17:45 +1000)]
ctdb-recovery: Get recmode unconditionally in the main_loop

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

This can be used later in the main_loop to avoid the local ip check.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-recovery: Finish processing for recovery mode ACTIVE first
Amitay Isaacs [Thu, 22 Jun 2017 04:09:32 +0000 (14:09 +1000)]
ctdb-recovery: Finish processing for recovery mode ACTIVE first

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

This simplifies the code and avoids complicated conditions.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-recovery: Simplify logging of recovery mode setting
Amitay Isaacs [Thu, 22 Jun 2017 04:52:32 +0000 (14:52 +1000)]
ctdb-recovery: Simplify logging of recovery mode setting

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-recovery: Setting up of recmode should be idempotent
Amitay Isaacs [Thu, 22 Jun 2017 04:49:02 +0000 (14:49 +1000)]
ctdb-recovery: Setting up of recmode should be idempotent

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

If the recovery mode is already set to the expected value, there is
nothing to do.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-recovery: Assign banning credits if database fails to freeze
Amitay Isaacs [Thu, 22 Jun 2017 04:00:13 +0000 (14:00 +1000)]
ctdb-recovery: Assign banning credits if database fails to freeze

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agolib: Use ctdb_protocol instead of ctdb_private
Volker Lendecke [Fri, 9 Jun 2017 06:48:21 +0000 (08:48 +0200)]
lib: Use ctdb_protocol instead of ctdb_private

ctdb_private is much broader. Right now we implement the protocol
ourselves. In the future, we might switch to the native ctdb
client implementation defined in ctdb_client.h, but that's a
different project :-)

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): Sat Jun 24 05:33:41 CEST 2017 on sn-devel-144

2 years agolib: Give util_paths.c its own header
Volker Lendecke [Thu, 22 Jun 2017 14:10:52 +0000 (16:10 +0200)]
lib: Give util_paths.c its own header

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agonet: Dump data for net_g_lock dump
Volker Lendecke [Thu, 8 Jun 2017 10:51:19 +0000 (12:51 +0200)]
net: Dump data for net_g_lock dump

4d404f2 added user-data for a g_lock. Print it in net g_lock dump.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agobuild: fix build of vfs_posix_eadb module
Björn Baumbach [Tue, 20 Jun 2017 14:47:57 +0000 (16:47 +0200)]
build: fix build of vfs_posix_eadb module

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-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): Sat Jun 24 01:20:16 CEST 2017 on sn-devel-144

2 years agowaf:lib/replace: Fix building with older GCC versions
Björn Baumbach [Thu, 22 Jun 2017 14:07:27 +0000 (16:07 +0200)]
waf:lib/replace: Fix building with older GCC versions

Using gcc 4.3.2:
cc1: error: unrecognized command line option "-Wno-format-truncation"

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agos4:torture: Do not segfault in torture_rpc_spoolss_printer_teardown_common()
Andreas Schneider [Thu, 22 Jun 2017 08:25:09 +0000 (10:25 +0200)]
s4:torture: Do not segfault in torture_rpc_spoolss_printer_teardown_common()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun 23 21:00:19 CEST 2017 on sn-devel-144

2 years agosamba_kcc: debugging: say intrasite when we mean intrasite
Garming Sam [Fri, 16 Jun 2017 01:05:37 +0000 (13:05 +1200)]
samba_kcc: debugging: say intrasite when we mean intrasite

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Jun 23 06:45:47 CEST 2017 on sn-devel-144

2 years agosamba_kcc: drop all connections from non-existent DSAs
Douglas Bagnall [Thu, 15 Jun 2017 21:16:16 +0000 (09:16 +1200)]
samba_kcc: drop all connections from non-existent DSAs

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agosamba_kcc: comment typo
Douglas Bagnall [Thu, 15 Jun 2017 21:15:17 +0000 (09:15 +1200)]
samba_kcc: comment typo

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agothird_party/dnspython: fix variable name in dnssec
Douglas Bagnall [Thu, 9 Mar 2017 02:08:19 +0000 (15:08 +1300)]
third_party/dnspython: fix variable name in dnssec

This appears to have been fixed upstream (along with significant other
changes)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agosamba_kcc: avoid crash on odd networks with --dot-file-dir
Douglas Bagnall [Wed, 5 Apr 2017 23:56:25 +0000 (11:56 +1200)]
samba_kcc: avoid crash on odd networks with --dot-file-dir

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agowaf/wafadmin/3rdparty: fix paranoid.py variable names
Douglas Bagnall [Thu, 9 Mar 2017 01:56:24 +0000 (14:56 +1300)]
waf/wafadmin/3rdparty: fix paranoid.py variable names

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agopython/getopt: -d/--debuglevel saves value in options for scripts
Douglas Bagnall [Wed, 12 Apr 2017 00:34:49 +0000 (12:34 +1200)]
python/getopt: -d/--debuglevel saves value in options for scripts

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agoadd provision performance tests
Douglas Bagnall [Wed, 8 Mar 2017 02:25:53 +0000 (15:25 +1300)]
add provision performance tests

Because making provision faster makes autobuild faster.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agoperftest: add a new medley test
Douglas Bagnall [Tue, 21 Mar 2017 21:25:06 +0000 (10:25 +1300)]
perftest: add a new medley test

This is something of a rewrite of ad_dc_performance.py with more
search tests and a rebalancing of others. For example, the users are
added in three lots of 2000 using varying methods rather than 5 of
1000 using ldap, reducing duplication thus clarifying the results.

Links are added in more realistic patterns with groups of varying
size.

To save time, the database is not cleaned up. Usually perftests are
run with TESTS= restriction to a single suite, but in case this is not
done, this suite is run last.

The ad_dc_performance suite is not replaced so that comparisons with
old test sequences are still possible.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 years agoBug 15852. There are valid paths where conn->lsa_pipe_tcp->transport is NULL. Protect...
Richard Sharpe [Tue, 20 Jun 2017 19:40:39 +0000 (12:40 -0700)]
Bug 15852. There are valid paths where conn->lsa_pipe_tcp->transport is NULL. Protect against this.

Based on a suggestion from Metze.

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

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 22 23:16:46 CEST 2017 on sn-devel-144

2 years agotevent: version 0.9.32 tevent-0.9.32
Stefan Metzmacher [Tue, 20 Jun 2017 10:17:32 +0000 (12:17 +0200)]
tevent: version 0.9.32

* Fix mutex locking in tevent_threaded_context_destructor().
* Fix a memleak on FreeBSD.
* Re-init threading in tevent_re_initialise().
* Include the finish location in tevent_req_default_print().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun 22 17:17:33 CEST 2017 on sn-devel-144

2 years agotevent: include the finish location in tevent_req_default_print()
Stefan Metzmacher [Wed, 14 Jun 2017 14:59:10 +0000 (16:59 +0200)]
tevent: include the finish location in tevent_req_default_print()

It's verify useful when debugging code without a debugger to
be able to use tevent_req_print() in DEBUG statements.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agodsdb: Rework schema_init module to always use valid memory
Andrew Bartlett [Thu, 8 Jun 2017 11:05:26 +0000 (23:05 +1200)]
dsdb: Rework schema_init module to always use valid memory

The schema can go away unless the second argument (the memory context) is supplied

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agos3:test_smbclient_s3.sh: pass the protocol (NT1) to the script
Stefan Metzmacher [Tue, 20 Jun 2017 07:03:02 +0000 (09:03 +0200)]
s3:test_smbclient_s3.sh: pass the protocol (NT1) to the script

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:test_smbclient_s3.sh: make it explizit where we want to force SMB1 or SMB3
Stefan Metzmacher [Tue, 20 Jun 2017 07:03:02 +0000 (09:03 +0200)]
s3:test_smbclient_s3.sh: make it explizit where we want to force SMB1 or SMB3

We need to use -mNT1 or -mSMB3 at the end of the command line in order
to overwrite possible '-m' arguments in $ADDARGS.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:test_acl_xattr.sh: use -mNT1 for the 'getfacl' commands
Stefan Metzmacher [Mon, 19 Jun 2017 13:44:27 +0000 (15:44 +0200)]
s3:test_acl_xattr.sh: use -mNT1 for the 'getfacl' commands

The getfacl command is SMB1 only and will most likely never
be part the SMB3 unix extensions.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: use CLI_FULL_CONNECTION_DISABLE_SMB1 in run_oplock_cancel()
Stefan Metzmacher [Mon, 19 Jun 2017 08:00:32 +0000 (10:00 +0200)]
s3:torture: use CLI_FULL_CONNECTION_DISABLE_SMB1 in run_oplock_cancel()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: add torture_open_connection_flags()
Stefan Metzmacher [Mon, 19 Jun 2017 08:00:15 +0000 (10:00 +0200)]
s3:torture: add torture_open_connection_flags()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: add CLI_FULL_CONNECTION_DISABLE_SMB1
Stefan Metzmacher [Mon, 19 Jun 2017 07:57:28 +0000 (09:57 +0200)]
s3:libsmb: add CLI_FULL_CONNECTION_DISABLE_SMB1

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:pylibsmb: use CLI_FULL_CONNECTION_FORCE_SMB1 in py_cli_state_init()
Stefan Metzmacher [Tue, 20 Jun 2017 06:02:40 +0000 (08:02 +0200)]
s3:pylibsmb: use CLI_FULL_CONNECTION_FORCE_SMB1 in py_cli_state_init()

For now we only support SMB1, as most of the cli_*_send() function don't
support SMB2, it's only plugged into the sync wrapper functions currently.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: use CLI_FULL_CONNECTION_FORCE_SMB1 in run_chain2()
Stefan Metzmacher [Mon, 19 Jun 2017 07:46:55 +0000 (09:46 +0200)]
s3:torture: use CLI_FULL_CONNECTION_FORCE_SMB1 in run_chain2()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: use CLI_FULL_CONNECTION_FORCE_SMB1 in run_tcon_devtype_test()
Stefan Metzmacher [Mon, 19 Jun 2017 07:45:26 +0000 (09:45 +0200)]
s3:torture: use CLI_FULL_CONNECTION_FORCE_SMB1 in run_tcon_devtype_test()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture pass flags to torture_open_connection_share()
Stefan Metzmacher [Mon, 19 Jun 2017 07:45:05 +0000 (09:45 +0200)]
s3:torture pass flags to torture_open_connection_share()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:client: smbclient -L can't do workgroup listing over SMB2/3
Stefan Metzmacher [Mon, 19 Jun 2017 06:49:05 +0000 (08:49 +0200)]
s3:client: smbclient -L can't do workgroup listing over SMB2/3

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: use CLI_FULL_CONNECTION_FORCE_SMB1 in torture_open_connection_share()
Stefan Metzmacher [Mon, 19 Jun 2017 06:17:27 +0000 (08:17 +0200)]
s3:torture: use CLI_FULL_CONNECTION_FORCE_SMB1 in torture_open_connection_share()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: add CLI_FULL_CONNECTION_FORCE_SMB1
Stefan Metzmacher [Mon, 19 Jun 2017 06:16:57 +0000 (08:16 +0200)]
s3:libsmb: add CLI_FULL_CONNECTION_FORCE_SMB1

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:torture: make use of smb_protocol_types_string() in run_smb2_negprot()
Stefan Metzmacher [Mon, 19 Jun 2017 19:53:49 +0000 (21:53 +0200)]
s3:torture: make use of smb_protocol_types_string() in run_smb2_negprot()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolibcli/smb: add smb_protocol_types_string()
Stefan Metzmacher [Mon, 19 Jun 2017 19:52:54 +0000 (21:52 +0200)]
libcli/smb: add smb_protocol_types_string()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: add support for SMB2 to cli_nt_delete_on_close*()
Stefan Metzmacher [Tue, 20 Jun 2017 06:35:47 +0000 (08:35 +0200)]
s3:libsmb: add support for SMB2 to cli_nt_delete_on_close*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: add cli_smb2_delete_on_close*()
Stefan Metzmacher [Tue, 20 Jun 2017 06:35:13 +0000 (08:35 +0200)]
s3:libsmb: add cli_smb2_delete_on_close*()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: normalize leading slashes in cli_resolve_path()
Stefan Metzmacher [Mon, 19 Jun 2017 12:13:37 +0000 (14:13 +0200)]
s3:libsmb: normalize leading slashes in cli_resolve_path()

As we try to pass the path to an SMB2 server, we should have
just one leading backslash (which then gets ignored in
cli_smb2_create_fnum_send()).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: no longer pass remote_realm to cli_state_create()
Stefan Metzmacher [Thu, 8 Dec 2016 13:06:39 +0000 (14:06 +0100)]
s3:libsmb: no longer pass remote_realm to cli_state_create()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libsmb: remove unused cli_state_remote_realm()
Stefan Metzmacher [Thu, 8 Dec 2016 13:06:16 +0000 (14:06 +0100)]
s3:libsmb: remove unused cli_state_remote_realm()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:rpc_server/spoolss: allow spoolss_connect_to_client() to use SMB2
Stefan Metzmacher [Mon, 19 Jun 2017 13:46:54 +0000 (15:46 +0200)]
s3:rpc_server/spoolss: allow spoolss_connect_to_client() to use SMB2

It's just required that we can run DCERPC over the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agopython/tests: test SMB1 and SMB2/3 in auth_log.py
Stefan Metzmacher [Tue, 20 Jun 2017 06:26:45 +0000 (08:26 +0200)]
python/tests: test SMB1 and SMB2/3 in auth_log.py

We should do this explicitly in order to make
the tests independent of 'client max protocol'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodnsserver/common: Use cached dnsHostName to reduce database reads
Garming Sam [Mon, 19 Jun 2017 03:01:56 +0000 (15:01 +1200)]
dnsserver/common: Use cached dnsHostName to reduce database reads

The code to clobber the host name appears to have caused DNS requests to use 3x as much resources

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun 22 13:06:07 CEST 2017 on sn-devel-144

2 years agodsdb: Add a samdb_dns_host_name which avoids searching
Garming Sam [Mon, 19 Jun 2017 02:49:55 +0000 (14:49 +1200)]
dsdb: Add a samdb_dns_host_name which avoids searching

This ideally should also be used in rootDSE.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopycredentials: Add support for netr_crypt_password
Gary Lockyer [Tue, 20 Jun 2017 20:10:30 +0000 (08:10 +1200)]
pycredentials: Add support for netr_crypt_password

Add code to encrypt a netr_CryptPassword structure with the current
session key.  This allows the making of Netr_ServerPasswordSet2 calls
from python.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos4/dcerpc_netlogon: Logging for dcesrv_netr_LogonGetDomainInfo
Gary Lockyer [Tue, 20 Jun 2017 20:09:53 +0000 (08:09 +1200)]
s4/dcerpc_netlogon: Logging for dcesrv_netr_LogonGetDomainInfo

Log details of the remote machine when bad credentials received.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agopycredentials: add function to return the netr_Authenticator
Gary Lockyer [Thu, 15 Jun 2017 03:55:43 +0000 (15:55 +1200)]
pycredentials: add function to return the netr_Authenticator

Add method new_client_authenticator that returns data to allow a
netr_Authenticator to be constructed.
Allows python to make netr_LogonSamLogonWithFlags,
netr_LogonGetDomainInfo and similar calls

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agolsa.String: add String constructor, str and repr
Gary Lockyer [Mon, 29 May 2017 04:04:14 +0000 (16:04 +1200)]
lsa.String: add String constructor, str and repr

Add a String constructor, str and repr methods to the
samba.dcerpc.lsa.String python object

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agoTests lsa.String: add String constructor, str and repr
Gary Lockyer [Wed, 14 Jun 2017 19:57:23 +0000 (07:57 +1200)]
Tests lsa.String: add String constructor, str and repr

Tests for the String constructor, str and repr methods added to
the samba.dcerpc.lsa.String python object

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 years agos3: smbd: When deleting an fsp pointer ensure we don't keep any references to it...
Jeremy Allison [Tue, 20 Jun 2017 18:20:38 +0000 (11:20 -0700)]
s3: smbd: When deleting an fsp pointer ensure we don't keep any references to it around.

Based on a suggestion from <lev@zadarastorage.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 22 00:12:49 CEST 2017 on sn-devel-144

2 years agomessaging: Deliver messages only once
Volker Lendecke [Sat, 17 Jun 2017 06:48:16 +0000 (08:48 +0200)]
messaging: Deliver messages only once

This survived an autobuild, so no subsystem strictly needs this anymore. In
particular the notify subsystem has been rewritten.

Why this patch? It removes some complexity from core code, and it reduces the
potential memory overconsumption: Right now I'm working on a g_lock_ping_pong
test. This test does a lot of messaging_filtered_read_send calls in a tight
loop on a nested event context. With the current code we let the
messaging_filtered_read code consume the message that arrives, but it also
posts it for consumption by the main event context attached to the messaging
context with its "classic" callback. This test never comes back to the main
event context, so it accumulates more and more self-posted messages. That's
just unnecessary, given that due to the successful autobuild nothing but the
read1 test makes use of the "multicasting" of messages.

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 Jun 21 07:30:39 CEST 2017 on sn-devel-144

2 years agodbwrap: Remove unused dbwrap_file
Volker Lendecke [Fri, 26 May 2017 16:48:32 +0000 (18:48 +0200)]
dbwrap: Remove unused dbwrap_file

This has stopped working ages ago. The idea is clear, but if someone
wants to revive it, I think it needs a completely fresh start.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodbwrap: Remove unused dbwrap_cache
Volker Lendecke [Fri, 26 May 2017 16:47:23 +0000 (18:47 +0200)]
dbwrap: Remove unused dbwrap_cache

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib: Fix typos
Volker Lendecke [Thu, 8 Jun 2017 10:20:15 +0000 (12:20 +0200)]
lib: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoctdb: Fix typos
Volker Lendecke [Thu, 8 Jun 2017 09:44:36 +0000 (11:44 +0200)]
ctdb: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agotevent: Simplify create_immediate
Volker Lendecke [Sat, 17 Jun 2017 19:26:27 +0000 (21:26 +0200)]
tevent: Simplify create_immediate

Not much change, just 9 lines less of code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib: Give messages_ctdbd.c its own header
Volker Lendecke [Thu, 1 Jun 2017 17:25:48 +0000 (19:25 +0200)]
lib: Give messages_ctdbd.c its own header

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agomessaging: Use size_t for array sizes
Volker Lendecke [Sat, 17 Jun 2017 07:46:43 +0000 (09:46 +0200)]
messaging: Use size_t for array sizes

We use talloc_realloc, that takes size_t.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoselftest: Give tmux a bit of time to establish
Volker Lendecke [Thu, 15 Jun 2017 15:36:58 +0000 (17:36 +0200)]
selftest: Give tmux a bit of time to establish

I've seen a lot of failures with make testenv telling that stdin returns
EAGAIN. I haven't fully diagnosed it, but this seems to fix it. Now
make testenv is much more reliable.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun 21 03:14:17 CEST 2017 on sn-devel-144

2 years agos3:winbind: Fix 'winbind normalize names' in wb_getpwsid()
Andreas Schneider [Tue, 20 Jun 2017 08:27:07 +0000 (10:27 +0200)]
s3:winbind: Fix 'winbind normalize names' in wb_getpwsid()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agomessaging: Fix queueing on FreeBSD
Volker Lendecke [Wed, 23 Nov 2016 15:51:25 +0000 (16:51 +0100)]
messaging: Fix queueing on FreeBSD

FreeBSD does not do the nice blocking send that Linux does. Instead,
it returns ENOBUFS if the dst socket is full. According to the
manpage you have to do polling. Try with exponential backoff, at
the end try once a second forever.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 20 23:03:11 CEST 2017 on sn-devel-144

2 years agoldb: Fix CID 1412926 Unchecked return value
Volker Lendecke [Tue, 20 Jun 2017 12:50:41 +0000 (14:50 +0200)]
ldb: Fix CID 1412926 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agopidl: Fix array range checks in python output
Volker Lendecke [Tue, 20 Jun 2017 13:31:18 +0000 (15:31 +0200)]
pidl: Fix array range checks in python output

Without this, we generated code like

if (ndr_table_dnsserver.num_calls < 0) {
        PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_DnssrvOperation_ndr_pack");
        return NULL;
}
call = &ndr_table_dnsserver.calls[0];

This does not really make sense, and Coverity found comparing the unsigned
num_calls against <0 a bit pointless.

Should fix 138 Coverity findings and make the code a bit more correct.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:tests: Add test for smbclient -UDOMAIN+username
Andreas Schneider [Mon, 19 Jun 2017 13:52:23 +0000 (15:52 +0200)]
s3:tests: Add test for smbclient -UDOMAIN+username

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 20 14:48:33 CEST 2017 on sn-devel-144

2 years agos3:popt_common: Reparse the username in popt_common_credentials_post()
Andreas Schneider [Mon, 19 Jun 2017 12:50:33 +0000 (14:50 +0200)]
s3:popt_common: Reparse the username in popt_common_credentials_post()

When we parse the username in the options handling, the smb.conf file
has not been loaded yet. So we are not aware of a 'winbind separator'
set in the config file.

We need to read and set the username again in the post-processing of the
credentials.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agoselftest: Use 'ad_dc' as the default for testenv
Andreas Schneider [Mon, 19 Jun 2017 12:34:02 +0000 (14:34 +0200)]
selftest: Use 'ad_dc' as the default for testenv

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agoctdb-locking: If a record could not be locked, log the key
Amitay Isaacs [Tue, 13 Jun 2017 05:32:36 +0000 (15:32 +1000)]
ctdb-locking: If a record could not be locked, log the key

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jun 19 19:56:22 CEST 2017 on sn-devel-144

2 years agoctdb-locking: Reduce logging in case of contention
Amitay Isaacs [Wed, 7 Jun 2017 06:44:24 +0000 (16:44 +1000)]
ctdb-locking: Reduce logging in case of contention

Currently, every lock helper will log a message if it cannot get a lock.
This can spam the logs and overwhelm syslog if there are hundreds of
lock helpers waiting for contended record.

Instead keep track of the record for which we have already logged once
with specific timeout interval.  If we get timeout interval larger than
the previously logged interval, then log again once.  This will reduce
the amount of logs for contended records to a single log entry per 10
seconds per record.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-locking: There are no ALLDB locks any more
Amitay Isaacs [Wed, 7 Jun 2017 06:45:50 +0000 (16:45 +1000)]
ctdb-locking: There are no ALLDB locks any more

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-client: Add correct control names to log messages
Amitay Isaacs [Wed, 14 Jun 2017 06:35:50 +0000 (16:35 +1000)]
ctdb-client: Add correct control names to log messages

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-tests: Fix function names in protocol test
Amitay Isaacs [Thu, 6 Apr 2017 06:51:57 +0000 (16:51 +1000)]
ctdb-tests: Fix function names in protocol test

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agos3: VFS: Change SMB_VFS_SYMLINK to use const struct smb_filename * instead of const...
Jeremy Allison [Thu, 8 Jun 2017 23:25:58 +0000 (16:25 -0700)]
s3: VFS: Change SMB_VFS_SYMLINK to use const struct smb_filename * instead of const char *.

We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Jun 18 07:03:18 CEST 2017 on sn-devel-144

2 years agos3: VFS: Change SMB_VFS_READLINK to use const struct smb_filename * instead of const...
Jeremy Allison [Wed, 7 Jun 2017 22:03:37 +0000 (15:03 -0700)]
s3: VFS: Change SMB_VFS_READLINK to use const struct smb_filename * instead of const char *.

We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2 years agos3: VFS: Change SMB_VFS_STATVFS to use const struct smb_filename * instead of const...
Jeremy Allison [Fri, 2 Jun 2017 22:26:06 +0000 (15:26 -0700)]
s3: VFS: Change SMB_VFS_STATVFS to use const struct smb_filename * instead of const char *.

We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2 years agos3: VFS: Change SMB_VFS_LINK to use const struct smb_filename * instead of const...
Jeremy Allison [Fri, 2 Jun 2017 21:21:54 +0000 (14:21 -0700)]
s3: VFS: Change SMB_VFS_LINK to use const struct smb_filename * instead of const char *.

We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2 years agos3: VFS: Change SMB_VFS_GET_QUOTA to use const struct smb_filename * instead of const...
Jeremy Allison [Thu, 1 Jun 2017 18:45:25 +0000 (11:45 -0700)]
s3: VFS: Change SMB_VFS_GET_QUOTA to use const struct smb_filename * instead of const char *.

We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2 years agos3: VFS: Change SMB_VFS_DISK_FREE to use const struct smb_filename * instead of const...
Jeremy Allison [Tue, 23 May 2017 17:40:47 +0000 (10:40 -0700)]
s3: VFS: Change SMB_VFS_DISK_FREE to use const struct smb_filename * instead of const char *.

We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>