gd/samba-autobuild/.git
5 years agosmbd: Fix a panic
Volker Lendecke [Tue, 21 May 2019 13:26:55 +0000 (15:26 +0200)]
smbd: Fix a panic

Opening a file with a stale (smbd died) LEVEL_II oplock makes

vfs_set_filelen-> ... ->contend_level2_oplocks_begin_default

trigger the immediate leading to do_break_to_none. This goes through
because fsp->oplock_type is not initialized yet, thus 0. Also,
file_has_read_oplocks is still valid, because the smbd that has died
could not clean up the brlock.tdb entry.

Later in the code the exclusive oplock is granted, which is then found
by do_break_to_none, making it panic.

This patch just runs the direct FTRUNCATE instead of vfs_set_filelen.
This means the contend_level2_oplock code is skipped.

The relevant break (LEVEL_II to NONE) is now done in delay_for_oplock()
with the nice effect of removing a comment that was very confusing to
me.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13957
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 22 20:09:29 UTC 2019 on sn-devel-184

5 years agosmbtorture: Add a test to make smbd panic
Volker Lendecke [Tue, 21 May 2019 12:53:46 +0000 (14:53 +0200)]
smbtorture: Add a test to make smbd panic

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13957
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agosmbd: Enable "smbd:suicide mode" for smb2
Volker Lendecke [Tue, 21 May 2019 12:52:22 +0000 (14:52 +0200)]
smbd: Enable "smbd:suicide mode" for smb2

The next commit needs an smbd to just exit and leave data behind in the
locking.tdb file. Don't make it harder to eventually phase out SMB1: Do
the test in SMB2.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13957
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 years agos4-ntvfs: Remove untested ntvfs_cifsposix backend
Andrew Bartlett [Tue, 21 May 2019 01:57:57 +0000 (13:57 +1200)]
s4-ntvfs: Remove untested ntvfs_cifsposix backend

It had a note:

WARNING: All file access is done as user root!!!
         Only use this module for testing, with only test data!!!

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): Wed May 22 07:15:43 UTC 2019 on sn-devel-184

5 years agos4-ntvfs: Remove untested stub vfs_print backend
Andrew Bartlett [Tue, 21 May 2019 01:55:16 +0000 (13:55 +1200)]
s4-ntvfs: Remove untested stub vfs_print backend

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agontvfs: Remove unused and untested SMB1 -> SMB2 proxy module
Andrew Bartlett [Mon, 6 May 2019 03:12:56 +0000 (15:12 +1200)]
ntvfs: Remove unused and untested SMB1 -> SMB2 proxy module

While this could have been a very interesting idea (particularly
if it allowed our main SMB server to disable SMB1), it has never
been enabled in our testsuite so relying on it would be quite
brave.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agontvfs: Remove unused nbench vfs module
Andrew Bartlett [Mon, 6 May 2019 03:07:52 +0000 (15:07 +1200)]
ntvfs: Remove unused nbench vfs module

A pass-though NTVFS module to write nbench files is a cute idea,
but this is untested and almost certainly unused.

Found by looking at the LCOV results.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agolibcli/ldap: Remove unsued ldap_transaction()
Andrew Bartlett [Tue, 21 May 2019 03:42:39 +0000 (15:42 +1200)]
libcli/ldap: Remove unsued ldap_transaction()

This is unsued since a87dea2a0894015cf4a3140995791f5468c40038 in 2007
when we moved to using LDB for LDAP in this area of the code.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agolibcli/security: Remove unused dup_sec_desc_buf()
Andrew Bartlett [Tue, 21 May 2019 03:03:06 +0000 (15:03 +1200)]
libcli/security: Remove unused dup_sec_desc_buf()

This has been unused since before
762e7e1dff89cc14b0130fc9a22038b0845630a2 in 2003.

Found by callcatcher

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agolib: Remove "tdb based replacement for gettext"
Andrew Bartlett [Tue, 21 May 2019 02:59:00 +0000 (14:59 +1200)]
lib: Remove "tdb based replacement for gettext"

This is unused since SWAT was removed in Samba 4.1

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agos4-rpc_server: Remove unused dnsserver_find_partition()
Andrew Bartlett [Tue, 21 May 2019 02:41:06 +0000 (14:41 +1200)]
s4-rpc_server: Remove unused dnsserver_find_partition()

This has been unused since it was introduced by
5673e2cec946502da84956f866658718e7632a3e in 2011.

Found by callcatcher

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agolibcli/auth: Remove des_crypt64() from smbdes
Andrew Bartlett [Tue, 21 May 2019 02:35:52 +0000 (14:35 +1200)]
libcli/auth: Remove des_crypt64() from smbdes

This has been unused since it was introduced by
ad8b47a2ba4e81420bc2272e8438a727cc2223ee in 2006

Found by callcatcher

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodsdb: Remove unsued dsdb_class_by_cn()
Andrew Bartlett [Tue, 21 May 2019 02:24:43 +0000 (14:24 +1200)]
dsdb: Remove unsued dsdb_class_by_cn()

The callers moved to dsdb_class_by_cn_ldb_val() with
43aa546ecc3f05845793b1a7354685d50a77c170 in 2009.

Found by callcatcher

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoRemove unused auth_get_challenge_not_implemented
Andrew Bartlett [Tue, 21 May 2019 02:15:36 +0000 (14:15 +1200)]
Remove unused auth_get_challenge_not_implemented

This became unused after eba87995145b0e14672c1f6993f7aa3422d62541 in 2012

Found by callcatcher

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoMakefile: add lcov command
Joe Guo [Thu, 16 May 2019 02:38:25 +0000 (14:38 +1200)]
Makefile: add lcov command

A helper cmd to generate .info file from .gcno and .gcda file,
and then generate html report from .info file.

Usage:

./configure --enable-coverage
make -j
make test TESTS=mytest
make lcov

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: ldbdump key and pack format version comments
Aaron Haslett [Mon, 20 May 2019 04:19:51 +0000 (16:19 +1200)]
ldb: ldbdump key and pack format version comments

For testing we need to know the actual KV level key of records and each
record's pack format version. This patch makes ldbdump add comments with
that info. We will parse it out in python tests.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May 22 05:58:17 UTC 2019 on sn-devel-184

5 years agoldb: ldb_key_value_test fix
Aaron Haslett [Fri, 17 May 2019 01:27:20 +0000 (13:27 +1200)]
ldb: ldb_key_value_test fix

In future commits we'll be adding more logging to LDB, which breaks the
ldb_key_value_test suite. By removing the debug handler, a bug
involving an expired debug_string variable being written to is avoided.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: removing unnecessary module pointer
Aaron Haslett [Wed, 15 May 2019 22:53:38 +0000 (10:53 +1200)]
ldb: removing unnecessary module pointer

We want to reuse the reindex context struct for repacking, but it has an
unnecessary module pointer on it. Turns out the existing code doesn't
need it either, so this patch deletes the pointer.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: Release ldb 2.0.2
Aaron Haslett [Tue, 21 May 2019 00:34:38 +0000 (12:34 +1200)]
ldb: Release ldb 2.0.2

 * Checking pack format is version 1 and erroring if not (will change soon)
 * Pack format routines for unpack and pack version 2 (but not used)
 * Test fixes for issues caused by upcoming repack functionality for upgrade
 * Making ldbdump print out pack format info and keys so we have low level visibility for testing in python

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: pack function for new pack format
Aaron Haslett [Fri, 10 May 2019 06:10:55 +0000 (18:10 +1200)]
ldb: pack function for new pack format

Pack function for new pack format with values separated from other data
so that while unpacking, the value section (which is probably large)
doesn't have to be loaded into cache/memory.
The new format is disabled for now.
Two tests are added that operate on a detailed binary breakdown of the
new format.

NOTE: Configure with --abi-check-disable to build this commit. This
patch is part of a set of LDB ABI changes, and the version update is
done on the last commit.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: unpack function for new pack format
Aaron Haslett [Wed, 1 May 2019 01:36:36 +0000 (13:36 +1200)]
ldb: unpack function for new pack format

Unpack function for new pack format with values separated from other
data so that while unpacking, the value section (which is probably large)
doesn't have to be loaded into cache/memory.
Additionally, width of length field can now vary per-element to save space.
The old unpack routine is still present and is called if the old pack
format version number is found.
LDB torture suite is modified to run relevant tests on both old and new
pack format.

NOTE: Configure with --abi-check-disable to build this commit. This
patch is part of a set of LDB ABI changes, and the version update is
done on the last commit.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: replacing length increments with constants in pack
Aaron Haslett [Tue, 21 May 2019 03:18:10 +0000 (15:18 +1200)]
ldb: replacing length increments with constants in pack

Since we're about to introduce a new packing format, it's a good time to
improve our code style and change some magic numbers into explicit
constants.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: push and pull macros for pack format
Aaron Haslett [Fri, 17 May 2019 04:34:52 +0000 (16:34 +1200)]
ldb: push and pull macros for pack format

Replacing push and pull functions (which may cause issues with Undefined
Sanitizer) with Andreas Schneider's excellent macros which are a work in
progress and not yet merged into master. Once his work is upstream, I'll
rebase and change this code to import his headers.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldb: baseinfo pack format check on init
Aaron Haslett [Fri, 10 May 2019 06:10:51 +0000 (18:10 +1200)]
ldb: baseinfo pack format check on init

We will be adding a new packing format in forthcoming commits and there
may be more versions in the future. We need to make sure the database
contains records in a format we know how to read and write.
Done by fetching the @BASEINFO record and reading the first 4
bytes which contain the packing format version.

NOTE: Configure with --abi-check-disable to build this commit. This
patch is part of a set of LDB ABI changes, and the version update is
done on the last commit.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agos4 librpc rpc pyrpc: Fix flapping dcerpc.bare tests
Gary Lockyer [Tue, 21 May 2019 23:43:54 +0000 (11:43 +1200)]
s4 librpc rpc pyrpc: Fix flapping dcerpc.bare tests

Commit d65b7641c84976c543ded8f0de5ab2da3c19b407 had the parameters to
talloc_reparent reversed.  This caused the dcerpc.bare tests to flap.

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

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

5 years agolib:crypto: Remove obsolete MD5 and HMAC MD5
Andreas Schneider [Tue, 6 Nov 2018 16:22:53 +0000 (17:22 +0100)]
lib:crypto: Remove obsolete MD5 and HMAC MD5

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 21 01:18:08 UTC 2019 on sn-devel-184

5 years agos4:torture: Use GnuTLS MD5 for samba3rpc
Andreas Schneider [Tue, 6 Nov 2018 16:13:23 +0000 (17:13 +0100)]
s4:torture: Use GnuTLS MD5 for samba3rpc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:torture: Use GnuTLS MD5 for samr password
Andreas Schneider [Tue, 6 Nov 2018 15:30:39 +0000 (16:30 +0100)]
s4:torture: Use GnuTLS MD5 for samr password

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:torture: Use GnuTLS MD5 in samr password tests
Andreas Schneider [Tue, 6 Nov 2018 16:07:24 +0000 (17:07 +0100)]
s4:torture: Use GnuTLS MD5 in samr password tests

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:torture: Use GnuTLS MD5 in ntp_signd test
Andreas Schneider [Tue, 6 Nov 2018 16:00:59 +0000 (17:00 +0100)]
s4:torture: Use GnuTLS MD5 in ntp_signd test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:torture: Use GnuTLS MD5 and HMAC MD5 in samlogon test
Andreas Schneider [Tue, 30 Oct 2018 15:52:26 +0000 (16:52 +0100)]
s4:torture: Use GnuTLS MD5 and HMAC MD5 in samlogon test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:torture: Use GnuTLS MD5
Andreas Schneider [Mon, 5 Nov 2018 17:26:02 +0000 (18:26 +0100)]
s3:torture: Use GnuTLS MD5

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:messaging: Use GnuTLS MD5 in messaging test
Andreas Schneider [Tue, 6 Nov 2018 11:49:35 +0000 (12:49 +0100)]
s4:messaging: Use GnuTLS MD5 in messaging test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:rpc_server: Use GnuTLS MD5 for samr password
Andreas Schneider [Tue, 6 Nov 2018 15:30:39 +0000 (16:30 +0100)]
s4:rpc_server: Use GnuTLS MD5 for samr password

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:ntp_signd: Use GnuTLS MD5 in signd
Andreas Schneider [Tue, 6 Nov 2018 15:25:00 +0000 (16:25 +0100)]
s4:ntp_signd: Use GnuTLS MD5 in signd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:libnet: Use GnuTLS MD5 for samr passwords
Andreas Schneider [Tue, 6 Nov 2018 14:13:40 +0000 (15:13 +0100)]
s4:libnet: Use GnuTLS MD5 for samr passwords

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:libcli: Use GnuTLS MD5 for smb singing
Andreas Schneider [Tue, 6 Nov 2018 13:42:17 +0000 (14:42 +0100)]
s3:libcli: Use GnuTLS MD5 for smb singing

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:dsdb: Use GnuTLS MD5 in password_hash module
Andreas Schneider [Mon, 5 Nov 2018 17:31:35 +0000 (18:31 +0100)]
s4:dsdb: Use GnuTLS MD5 in password_hash module

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:rpc_client: Use GnuTLS MD5 for samr
Andreas Schneider [Mon, 5 Nov 2018 17:10:55 +0000 (18:10 +0100)]
s3:rpc_client: Use GnuTLS MD5 for samr

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:profile: Use GnuTLS MD5
Andreas Schneider [Mon, 5 Nov 2018 17:03:51 +0000 (18:03 +0100)]
s3:profile: Use GnuTLS MD5

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:vfs: Use GnuTLS MD5 in vfs_fruit
Andreas Schneider [Mon, 5 Nov 2018 16:58:37 +0000 (17:58 +0100)]
s3:vfs: Use GnuTLS MD5 in vfs_fruit

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:vfs: Use GnuTLS MD5 in vfs_streams_xattr
Andreas Schneider [Mon, 5 Nov 2018 16:41:42 +0000 (17:41 +0100)]
s3:vfs: Use GnuTLS MD5 in vfs_streams_xattr

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos3:smbd: Return NTSTATUS for srv_calculate_sign_mac()
Andreas Schneider [Thu, 11 Apr 2019 08:22:26 +0000 (10:22 +0200)]
s3:smbd: Return NTSTATUS for srv_calculate_sign_mac()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:gensec: Return NTSTATUS for netsec_do_seq_num()
Andreas Schneider [Thu, 11 Apr 2019 08:43:13 +0000 (10:43 +0200)]
auth:gensec: Return NTSTATUS for netsec_do_seq_num()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:gensec: Use GnuTLS HMAC MD5 and MD5 in netsec_do_sign()
Andreas Schneider [Wed, 15 May 2019 06:33:18 +0000 (08:33 +0200)]
auth:gensec: Use GnuTLS HMAC MD5 and MD5 in netsec_do_sign()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:gensec: Use GnuTLS HMAC MD5 in netsec_do_seal()
Andreas Schneider [Wed, 15 May 2019 06:32:58 +0000 (08:32 +0200)]
auth:gensec: Use GnuTLS HMAC MD5 in netsec_do_seal()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:gensec: Use GnuTLS HMAC MD5 in netsec_do_seq_num()
Andreas Schneider [Wed, 15 May 2019 06:32:24 +0000 (08:32 +0200)]
auth:gensec: Use GnuTLS HMAC MD5 in netsec_do_seq_num()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:creds: Use GnuTLS MD5 in ntlm creds
Andreas Schneider [Tue, 30 Oct 2018 15:56:54 +0000 (16:56 +0100)]
auth:creds: Use GnuTLS MD5 in ntlm creds

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:ntlmssp: Use GnuTLS MD5 and HMAC MD5 in ntlmssp sign
Andreas Schneider [Tue, 30 Oct 2018 15:43:03 +0000 (16:43 +0100)]
auth:ntlmssp: Use GnuTLS MD5 and HMAC MD5 in ntlmssp sign

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:ntlmssp: Use GnuTLS MD5 and HMAC MD5 in ntlmssp server
Andreas Schneider [Tue, 30 Oct 2018 09:31:11 +0000 (10:31 +0100)]
auth:ntlmssp: Use GnuTLS MD5 and HMAC MD5 in ntlmssp server

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoauth:ntlmssp: Use GnuTLS HMAC MD5 in ntlmssp client
Andreas Schneider [Tue, 30 Oct 2018 08:31:19 +0000 (09:31 +0100)]
auth:ntlmssp: Use GnuTLS HMAC MD5 in ntlmssp client

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:smb: Return NTSTATUS for smb_key_derivation()
Andreas Schneider [Thu, 11 Apr 2019 08:29:04 +0000 (10:29 +0200)]
libcli:smb: Return NTSTATUS for smb_key_derivation()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:smb: Check return code of smb_signing_md5()
Andreas Schneider [Thu, 11 Apr 2019 08:24:49 +0000 (10:24 +0200)]
libcli:smb: Check return code of smb_signing_md5()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:smb: Return NTSTATUS for smb_signing_sign_pdu()
Andreas Schneider [Thu, 11 Apr 2019 08:19:16 +0000 (10:19 +0200)]
libcli:smb: Return NTSTATUS for smb_signing_sign_pdu()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:smb: Return NTSTATUS for smb_signing_md5()
Andreas Schneider [Thu, 11 Apr 2019 08:14:43 +0000 (10:14 +0200)]
libcli:smb: Return NTSTATUS for smb_signing_md5()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:smb: Use GnuTLS HMAC MD5 in smb_key_derivation()
Andreas Schneider [Wed, 15 May 2019 06:09:35 +0000 (08:09 +0200)]
libcli:smb: Use GnuTLS HMAC MD5 in smb_key_derivation()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:smb: Use GnuTLS MD5 and HMAC MD5 in smb_signing_md5()
Andreas Schneider [Mon, 29 Oct 2018 17:16:09 +0000 (18:16 +0100)]
libcli:smb: Use GnuTLS MD5 and HMAC MD5 in smb_signing_md5()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:drsuapi: Use GnuTLS MD5 in drsuapi_encrypt_attribute_value()
Andreas Schneider [Wed, 15 May 2019 06:08:15 +0000 (08:08 +0200)]
libcli:drsuapi: Use GnuTLS MD5 in drsuapi_encrypt_attribute_value()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:drsuapi: Use GnuTLS MD5 in drsuapi_decrypt_attribute_value()
Andreas Schneider [Wed, 15 May 2019 06:07:32 +0000 (08:07 +0200)]
libcli:drsuapi: Use GnuTLS MD5 in drsuapi_decrypt_attribute_value()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Add return codes for netlogon_creds_init_128bit()
Andreas Schneider [Thu, 6 Dec 2018 13:49:40 +0000 (14:49 +0100)]
libcli:auth: Add return codes for netlogon_creds_init_128bit()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 and HMAC MD5 in netlogon_creds_init_128bit
Andreas Schneider [Fri, 26 Oct 2018 12:59:58 +0000 (14:59 +0200)]
libcli:auth: Use GnuTLS MD5 and HMAC MD5 in netlogon_creds_init_128bit

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use 'bool ok' in ntv2_owf_gen()
Andreas Schneider [Tue, 4 Dec 2018 08:49:17 +0000 (09:49 +0100)]
libcli:auth: Use 'bool ok' in ntv2_owf_gen()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 HMAC in SMBsesskeygen_ntv2()
Andreas Schneider [Wed, 15 May 2019 06:25:36 +0000 (08:25 +0200)]
libcli:auth: Use GnuTLS MD5 HMAC in SMBsesskeygen_ntv2()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 HMAC in SMBOWFencrypt_ntv2()
Andreas Schneider [Wed, 15 May 2019 06:05:38 +0000 (08:05 +0200)]
libcli:auth: Use GnuTLS MD5 HMAC in SMBOWFencrypt_ntv2()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 HMAC in ntv2_owf_gen()
Andreas Schneider [Wed, 15 May 2019 06:05:11 +0000 (08:05 +0200)]
libcli:auth: Use GnuTLS MD5 HMAC in ntv2_owf_gen()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 in decode_wkssvc_join_password_buffer()
Andreas Schneider [Wed, 15 May 2019 06:04:08 +0000 (08:04 +0200)]
libcli:auth: Use GnuTLS MD5 in decode_wkssvc_join_password_buffer()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 in encode_or_decode_arc4_passwd_buffer()
Andreas Schneider [Wed, 15 May 2019 06:02:59 +0000 (08:02 +0200)]
libcli:auth: Use GnuTLS MD5 in encode_or_decode_arc4_passwd_buffer()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 in encode_wkssvc_join_password_buffer()
Andreas Schneider [Wed, 15 May 2019 06:03:31 +0000 (08:03 +0200)]
libcli:auth: Use GnuTLS MD5 in encode_wkssvc_join_password_buffer()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 in encode_or_decode_arc4_passwd_buffer()
Andreas Schneider [Wed, 15 May 2019 06:02:59 +0000 (08:02 +0200)]
libcli:auth: Use GnuTLS MD5 in encode_or_decode_arc4_passwd_buffer()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolibcli:auth: Use GnuTLS MD5 for E_md5hash() in smbcrypt
Andreas Schneider [Wed, 15 May 2019 06:02:18 +0000 (08:02 +0200)]
libcli:auth: Use GnuTLS MD5 for E_md5hash() in smbcrypt

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotorture: Address flapping samba4.rpc.altercontext test
Andrew Bartlett [Wed, 15 May 2019 04:07:16 +0000 (16:07 +1200)]
torture: Address flapping samba4.rpc.altercontext test

NT_STATUS_CONNECTION_DISCONNECTED and NT_STATUS_CONNECTION_RESET are
equivilent for the purposes of this test, both come from the server
shutting down the connection, the difference comes from two different
unix error numbers that can come from this.

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

5 years agoldap_server: Run ldapsrv_queue_reply() in the ldb callback, rather than waiting for...
Andrew Bartlett [Wed, 3 Apr 2019 04:11:01 +0000 (17:11 +1300)]
ldap_server: Run ldapsrv_queue_reply() in the ldb callback, rather than waiting for the full result

Based on earlier work by Garming Sam.

This allows the server to stop working on a reply that will never
be sent to the client as it is too large.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldap_server: chunk the writev() calls at 25MB
Andrew Bartlett [Tue, 14 May 2019 00:08:03 +0000 (12:08 +1200)]
ldap_server: chunk the writev() calls at 25MB

This should limit the amount we send to GENSEC at a
time where it may help avoid large realloc or memcpy calls.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldap_server: Add explict repsonse size limit of 256MB
Andrew Bartlett [Wed, 8 May 2019 02:03:50 +0000 (14:03 +1200)]
ldap_server: Add explict repsonse size limit of 256MB

This allows us to replace the implicit limit via data_blob_append()
removed in the previous commit.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldap_server: Use an array of struct iovec to avoid data_blob_append()
Andrew Bartlett [Thu, 4 Apr 2019 04:25:30 +0000 (17:25 +1300)]
ldap_server: Use an array of struct iovec to avoid data_blob_append()

This avoids a the implicit 256MB limit on LDAP replies (allowing this
to be increased in the future) and means we copy less memory around.

However because we can only have 1024 entries in a struct iovec (on Linux)
we will need to call tstream_writev_queue_send() multiple times.

Calling it in chunks of 1024 seems a reasonable compromise, the
gensec layer will chunk it out smaller if required.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldap_server: Run the ldap_encode() step in ldapsrv_queue_reply()
Andrew Bartlett [Thu, 4 Apr 2019 03:52:17 +0000 (16:52 +1300)]
ldap_server: Run the ldap_encode() step in ldapsrv_queue_reply()

This avoids holding the memory for the response twice,
by the time the result is queued it is only ASN.1 encoded.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoldap_server: Remove success_limit
Andrew Bartlett [Wed, 3 Apr 2019 03:48:33 +0000 (16:48 +1300)]
ldap_server: Remove success_limit

This was always set to 0 so was poinless.  Any LDAP scope can return 0 entries,
even a SCOPE_BASE if the filter does not match.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agoselftest: Remove gensec.FEATURE_SEAL from samba4.ldap.notification
Andrew Bartlett [Mon, 8 Apr 2019 02:54:04 +0000 (14:54 +1200)]
selftest: Remove gensec.FEATURE_SEAL from samba4.ldap.notification

This made it much harder to watch under wireshark and is not required (no password setting).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodsdb: lock metadata.tdb during lock_read in partitions module
Andrew Bartlett [Wed, 15 May 2019 22:44:42 +0000 (10:44 +1200)]
dsdb: lock metadata.tdb during lock_read in partitions module

metadata.tdb was being locked during transactions, but not during read, and
we should ensure we take all our locks in order for consistency

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodsdb/partition: Remove teardown of data->metadata on partition_metadata_set_sequence_...
Andrew Bartlett [Thu, 16 May 2019 04:15:39 +0000 (16:15 +1200)]
dsdb/partition: Remove teardown of data->metadata on partition_metadata_set_sequence_number() failure

This changes variables that are not the responsiblity of this function, the unlock
implied by partition_del_trans() needs to be done carefully in the right spot.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodsdb/partition: Move in_transaction decrement to end of partition_del_trans()
Andrew Bartlett [Thu, 16 May 2019 03:12:55 +0000 (15:12 +1200)]
dsdb/partition: Move in_transaction decrement to end of partition_del_trans()

It makes no sense for this to be mid-function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodsdb/partition: Ensure metadata.tdb is opened early in partition_reload_if_required()
Andrew Bartlett [Thu, 16 May 2019 02:35:00 +0000 (14:35 +1200)]
dsdb/partition: Ensure metadata.tdb is opened early in partition_reload_if_required()

This allows metadata.tdb to be locked in the correct place in
in the lock order, as partition_reload_if_required() implicitly
calls partition_lock_read().

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agodsdb: Add random values to names in tests for large LDAP responses
Andrew Bartlett [Mon, 13 May 2019 03:32:23 +0000 (15:32 +1200)]
dsdb: Add random values to names in tests for large LDAP responses

This test is run agianst multiple DCs in the same domain, so there can
be a race with replication.  Therefore avoid using the same name twice
by adding a random suffix.

This is an improvement to a demonstrator for this bug in TDB:
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13952

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
5 years agos3: torture: Fix return values
Rikard Falkeborn [Thu, 16 May 2019 19:43:46 +0000 (21:43 +0200)]
s3: torture: Fix return values

Torture tests should return true on success and false on failure.
Returning -1 is the same as returning true and returning 0 is the same
as returning false. Change the return values to true and false to fix
the return values.

Detected by the help of cppcheck.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun May 19 18:48:01 UTC 2019 on sn-devel-184

5 years agos3: libsmbclient: Fix return value if cli_open() fails
Rikard Falkeborn [Thu, 16 May 2019 19:03:42 +0000 (21:03 +0200)]
s3: libsmbclient: Fix return value if cli_open() fails

Returning -1 in a function with bool as return value type is the same
as returning true. Change to false to indicate the error.

Detected by the help of cppcheck.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_gpfs: Fix return value if getting data fails
Rikard Falkeborn [Thu, 16 May 2019 19:29:52 +0000 (21:29 +0200)]
vfs_gpfs: Fix return value if getting data fails

Returning -1 in a function with bool as return value type is the same
as returning true. Change to false to indicate the error.

Detected by the help of cppcheck.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agovfs_catia: Fix return value in lock functions
Rikard Falkeborn [Thu, 16 May 2019 19:21:11 +0000 (21:21 +0200)]
vfs_catia: Fix return value in lock functions

Returning -1 in a function with bool as return value type is the same
as returning true. Change to false to indicate the error.

Detected by the help of cppcheck.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoFix uClibc build on 64bit platforms by including stdint.h
Fabrice Fontaine [Sat, 18 May 2019 10:42:17 +0000 (12:42 +0200)]
Fix uClibc build on 64bit platforms by including stdint.h

Fixes an error detected by buildroot autobuilders:
http://autobuild.buildroot.net/results/573/573e2268e205e10d1352fa81122d8f225fdb4575/build-end.log

/home/rclinux/rc-buildroot-test/scripts/instance-1/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/stdint.h:122:27:
error: conflicting types for 'uintptr_t'
 typedef unsigned long int uintptr_t;
                           ^
In file included from ../lib/ldb/tests/ldb_msg.c:17:0:
../third_party/cmocka/cmocka.h:126:28: note: previous declaration of 'uintptr_t' was here
       typedef unsigned int uintptr_t;

The define __WORDSIZE is missing when cmocka.h decides how to
define uintptr_t, this patch includes stdint.h when needed.

Patch sent upstream:
https://lists.samba.org/archive/samba-technical/2018-January/125306.html

[updated for samba-4.8.4, v2 sent upstream
 https://lists.samba.org/archive/samba-technical/2018-August/129732.html,
 updated for samba-4.9.1]

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/samba4/0003-Fix-uClibc-build-on-64bit-platforms-by-including-std.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agodocs: Fix typo
Juergen Hoetzel [Sun, 19 May 2019 09:24:28 +0000 (11:24 +0200)]
docs: Fix typo

Signed-off-by: Juergen Hoetzel <juergen@archlinux.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Send "share_file_id" with the rename msg
Volker Lendecke [Fri, 17 May 2019 08:44:23 +0000 (10:44 +0200)]
smbd: Send "share_file_id" with the rename msg

file_id plus share_file_id remotely specify the fsp. This avoids the
explicit loop in the receiver.

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 May 18 20:18:55 UTC 2019 on sn-devel-184

5 years agosmbd: Add file_rename_message in idl
Volker Lendecke [Fri, 17 May 2019 08:41:25 +0000 (10:41 +0200)]
smbd: Add file_rename_message in idl

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib:util: Add a test for byteorder.h
Andreas Schneider [Thu, 16 May 2019 06:31:40 +0000 (08:31 +0200)]
lib:util: Add a test for byteorder.h

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): Fri May 17 20:44:36 UTC 2019 on sn-devel-184

5 years agolib:util: Move VWV macro to smb_constants.h
Andreas Schneider [Thu, 17 Jan 2019 10:03:14 +0000 (11:03 +0100)]
lib:util: Move VWV macro to smb_constants.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolib:util: Remove PPC big endian asm optimized code in byteorder.h
Andreas Schneider [Fri, 21 Dec 2018 08:43:01 +0000 (09:43 +0100)]
lib:util: Remove PPC big endian asm optimized code in byteorder.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agolib:util: Remove unused ALIGN marcos from byteorder.h
Andreas Schneider [Thu, 20 Dec 2018 09:01:03 +0000 (10:01 +0100)]
lib:util: Remove unused ALIGN marcos from byteorder.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotdb: Release tdb 1.4.1
Andrew Bartlett [Fri, 17 May 2019 02:16:43 +0000 (14:16 +1200)]
tdb: Release tdb 1.4.1

* Do not propogate any errors from tdb_repack() to to tdb_transaction_commit()

  The repack may fail due to lock ordering or memory limits, but the original data has
  been written so the call must succeed.  (bug 13952)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 17 08:21:52 UTC 2019 on sn-devel-184

5 years agodsdb: Add tests for large LDAP responses
Andrew Bartlett [Mon, 13 May 2019 03:32:23 +0000 (15:32 +1200)]
dsdb: Add tests for large LDAP responses

This behaviour is Samba-specific, we have not traditionally cut of responses at 1000
or so as Windows does, and we need to change that behaviour carefully.

This triggers this bug in TDB:
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13952

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agotdb: Do not return errors from tdb_repack() in the tail of tdb_transaction_commit()
Andrew Bartlett [Thu, 16 May 2019 04:14:13 +0000 (16:14 +1200)]
tdb: Do not return errors from tdb_repack() in the tail of tdb_transaction_commit()

The call to tdb_repack() inside tdb_transaction_commit()
is an optimization, not part of the transaction itself,
so failing due to lock or other errors isn't a fatal error
that should cause the caller to think the transaction was
a failure by returning -1.

The tdb transaction itself has finished and been committed
onto stable storage via fsync and all locks released at the
point tdb_repack() is called.

tdb_repack() is only called here as it's a convenient point
to attempt to reduce tdb fragmentation without having to add
a timer call to repack in all users of tdb.

This causes lock ordering issues in Samba, showing up as:

ldb: ltdb: tdb(../private/sam.ldb.d/DC=SAMBA2008R2,DC=EXAMPLE,DC=COM.ldb): tdb_transaction_prepare_commit: failed to upgrade hash locks: Locking error

This is because Samba has multiple tdb databases open, and the lock order between them
is important.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Do oplock break messages in ndr
Volker Lendecke [Thu, 16 May 2019 13:38:26 +0000 (15:38 +0200)]
smbd: Do oplock break messages in ndr

The previous scheme was overloaded, a idl definition is easier to
print, and it clarifies what data is actually needed

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 May 16 23:48:18 UTC 2019 on sn-devel-184

5 years agosmbd: Use send_break_message() in send_break_to_none()
Volker Lendecke [Thu, 16 May 2019 13:34:37 +0000 (15:34 +0200)]
smbd: Use send_break_message() in send_break_to_none()

Centralize the marshalling code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>