amitay/samba.git
4 years agoctdb-recoverd: Fix typo in previous fix
Martin Schwenke [Tue, 27 Aug 2019 02:13:51 +0000 (12:13 +1000)]
ctdb-recoverd: Fix typo in previous fix

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

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 Aug 27 15:29:11 UTC 2019 on sn-devel-184

4 years agoWHATSNEW: Document new GnuTLS 3.4.7 requirement
Andrew Bartlett [Mon, 26 Aug 2019 02:39:40 +0000 (14:39 +1200)]
WHATSNEW: Document new GnuTLS 3.4.7 requirement

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): Tue Aug 27 06:01:50 UTC 2019 on sn-devel-184

4 years agos3:smbd: Prefer AES-GCM over AES-CCM with GnuTLS
Andreas Schneider [Fri, 15 Mar 2019 15:28:12 +0000 (16:28 +0100)]
s3:smbd: Prefer AES-GCM over AES-CCM with GnuTLS

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adapted to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Prefer AES-GCM over AES-CCM with GnuTLS
Andreas Schneider [Fri, 15 Mar 2019 15:25:28 +0000 (16:25 +0100)]
libcli:smb: Prefer AES-GCM over AES-CCM with GnuTLS

The AES-GCM implementation in GnuTLS is faster.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adapted to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_encrypt_pdu()
Andreas Schneider [Fri, 23 Aug 2019 07:28:28 +0000 (09:28 +0200)]
libcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_encrypt_pdu()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Use smb2_signing_key in smb2_signing_encrypt_pdu()
Andreas Schneider [Thu, 14 Mar 2019 09:27:06 +0000 (10:27 +0100)]
libcli:smb: Use smb2_signing_key in smb2_signing_encrypt_pdu()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adaped to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_decrypt_pdu()
Andreas Schneider [Fri, 23 Aug 2019 07:27:35 +0000 (09:27 +0200)]
libcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_decrypt_pdu()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Use smb2_signing_key in smb2_signing_decrypt_pdu()
Andreas Schneider [Thu, 14 Mar 2019 09:53:23 +0000 (10:53 +0100)]
libcli:smb: Use smb2_signing_key in smb2_signing_decrypt_pdu()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adaped to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Support GnuTLS AES CCM and GCM in smb2_signing_decrypt_pdu()
Andreas Schneider [Tue, 26 Feb 2019 15:43:36 +0000 (16:43 +0100)]
libcli:smb: Support GnuTLS AES CCM and GCM in smb2_signing_decrypt_pdu()

This requires GnuTLS >= 3.4.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adapted to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:smb: Support GnuTLS AES CCM and GCM in smb2_signing_encrypt_pdu()
Andreas Schneider [Mon, 25 Feb 2019 17:05:16 +0000 (18:05 +0100)]
libcli:smb: Support GnuTLS AES CCM and GCM in smb2_signing_encrypt_pdu()

This requires GnuTLS >= 3.4.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adapted to remove Samba AES support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agoldb: Extend the ldb_dn_explode test matrix
Andrew Bartlett [Tue, 27 Aug 2019 01:16:50 +0000 (13:16 +1200)]
ldb: Extend the ldb_dn_explode test matrix

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: Do not read beyond the end of the extended DN component when printing
Andrew Bartlett [Tue, 27 Aug 2019 01:16:18 +0000 (13:16 +1200)]
ldb: Do not read beyond the end of the extended DN component when printing

The print functions used in Samba NULL terminate, but do not assume they will

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: Add test with == true or false to boolean if statements in ldb_dn_explode()
Andrew Bartlett [Wed, 21 Aug 2019 23:09:55 +0000 (11:09 +1200)]
ldb: Add test with == true or false to boolean if statements in ldb_dn_explode()

This is beyond the normal level of clarity we expect in Samba, and is of course
rudundent, but this is a complex routine that has confusing tests, some of
pointers and some of boolean state values.

This tries to make the code as clear as possible pending a more comprehensive
rewrite.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: Rework all pointer NULL tests to use Samba's normal style
Andrew Bartlett [Wed, 21 Aug 2019 22:59:07 +0000 (10:59 +1200)]
ldb: Rework all pointer NULL tests to use Samba's normal style

Also avoid if () without braces

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: add some dn explode tests
Douglas Bagnall [Thu, 25 Jul 2019 00:09:16 +0000 (12:09 +1200)]
ldb: add some dn explode tests

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: don't try to save a value that isn't there
Douglas Bagnall [Thu, 25 Jul 2019 21:49:13 +0000 (09:49 +1200)]
ldb: don't try to save a value that isn't there

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: Call TALLOC_FREE(filtered_msg->elements) on ldb_filter_attrs() failure
Andrew Bartlett [Mon, 26 Aug 2019 02:50:15 +0000 (14:50 +1200)]
ldb: Call TALLOC_FREE(filtered_msg->elements) on ldb_filter_attrs() failure

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): Tue Aug 27 01:16:33 UTC 2019 on sn-devel-184

4 years agoldb: use TALLOC_FREE() over talloc_free() in ldb_filter_attrs()
Andrew Bartlett [Mon, 26 Aug 2019 02:48:52 +0000 (14:48 +1200)]
ldb: use TALLOC_FREE() over talloc_free() in ldb_filter_attrs()

This is a macro that sets the pointer to NULL after the talloc_free()
and is part of our standard coding practices.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb: Correct Pigeonhole principle validation in ldb_filter_attrs()
Andrew Bartlett [Mon, 26 Aug 2019 01:04:07 +0000 (13:04 +1200)]
ldb: Correct Pigeonhole principle validation in ldb_filter_attrs()

Thankfully this only fails if the DB is corrupt and has a duplicate record.

The test was at the wrong end of the loop, and was for the
wrong boundary condition.  A write after the end of the array would
occour before the condition was hit.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 years agoldb tests: Fix ldb_lmdb_size_test
Gary Lockyer [Mon, 26 Aug 2019 04:34:29 +0000 (16:34 +1200)]
ldb tests: Fix ldb_lmdb_size_test

Fix the lmdb size test which ensures that databases > 4GiB can be
written by the lmdb backend.  This test is not run as part of the normal
CI run as it exhausts the available disk on the test runners.

It was broken by changes to LDB allowing the lmdb map size to be
specified, and requiring GUID indexing by default.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoctdb-tests: fix mem leak in ltdb_fetch
Swen Schillig [Mon, 19 Aug 2019 12:52:13 +0000 (14:52 +0200)]
ctdb-tests: fix mem leak in ltdb_fetch

Direct leak of 256 byte(s) in 8 object(s) allocated from:
    #0 0x7f11b90d9c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f11b8f395df in tdb_alloc_read ../../../lib/tdb/common/io.c:696
    #2 0x7f11b8f290ee in _tdb_fetch ../../../lib/tdb/common/tdb.c:274
    #3 0x7f11b8f29379 in tdb_fetch ../../../lib/tdb/common/tdb.c:283
    #4 0x473ecc in ltdb_fetch ../../tests/src/fake_ctdbd.c:904
    #5 0x478b40 in ltdb_transaction_update ../../tests/src/fake_ctdbd.c:993
    #6 0x41fef2 in ctdb_rec_buffer_traverse ../../protocol/protocol_types.c:1656
    #7 0x48108b in ltdb_transaction ../../tests/src/fake_ctdbd.c:1026
    #8 0x48108b in control_trans3_commit ../../tests/src/fake_ctdbd.c:2878
    #9 0x48108b in client_process_control ../../tests/src/fake_ctdbd.c:4147
    #10 0x48108b in client_process_packet ../../tests/src/fake_ctdbd.c:3839
    #11 0x4847f5 in client_read_handler ../../tests/src/fake_ctdbd.c:3806
    #12 0x44f620 in comm_read_done ../../common/comm.c:208
    #13 0x7f11b8f94fe8 in _tevent_req_notify_callback ../../../lib/tevent/tevent_req.c:141
    #14 0x7f11b8f951fd in tevent_req_finish ../../../lib/tevent/tevent_req.c:193
    #15 0x7f11b8f95265 in _tevent_req_done ../../../lib/tevent/tevent_req.c:199
    #16 0x44e876 in pkt_read_handler ../../common/pkt_read.c:133
    #17 0x44f315 in comm_fd_handler ../../common/comm.c:412
    #18 0x7f11b8f92896 in tevent_common_invoke_fd_handler ../../../lib/tevent/tevent_fd.c:138
    #19 0x7f11b8fa6937 in epoll_event_loop ../../../lib/tevent/tevent_epoll.c:736
    #20 0x7f11b8fa6937 in epoll_event_loop_once ../../../lib/tevent/tevent_epoll.c:937
    #21 0x7f11b8f9f53e in std_event_loop_once ../../../lib/tevent/tevent_standard.c:110
    #22 0x7f11b8f90f34 in _tevent_loop_once ../../../lib/tevent/tevent.c:772
    #23 0x7f11b8f955f1 in tevent_req_poll ../../../lib/tevent/tevent_req.c:300
    #24 0x485a04 in start_server ../../tests/src/fake_ctdbd.c:4450
    #25 0x485a04 in main ../../tests/src/fake_ctdbd.c:4544
    #26 0x7f11b8c60412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Aug 26 10:19:30 UTC 2019 on sn-devel-184

4 years agopthreadpool: Remove wrong comment.
Christof Schmitt [Fri, 23 Aug 2019 18:24:50 +0000 (11:24 -0700)]
pthreadpool: Remove wrong comment.

Commit e45d33e9 removed the sync fallback path for the case that no
thread could be created. Remove the comment for that fallback as it does
not make sense anymore.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Fri Aug 23 23:09:12 UTC 2019 on sn-devel-184

4 years agos3: VFS: Complete the replacement of SMB_VFS_READLINK() -> SMB_VFS_READLINKAT().
Jeremy Allison [Thu, 22 Aug 2019 21:59:05 +0000 (14:59 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_READLINK() -> SMB_VFS_READLINKAT().

Signed-off-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): Fri Aug 23 20:06:22 UTC 2019 on sn-devel-184

4 years agos3: VFS: vfs_time_audit. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:53:25 +0000 (14:53 -0700)]
s3: VFS: vfs_time_audit. Remove readlink_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mknod_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_full_audit. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:52:43 +0000 (14:52 -0700)]
s3: VFS: vfs_full_audit. Remove readlink_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mknod_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_unityed_media. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:51:17 +0000 (14:51 -0700)]
s3: VFS: vfs_unityed_media. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_snapper. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:50:42 +0000 (14:50 -0700)]
s3: VFS: vfs_snapper. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:49:54 +0000 (14:49 -0700)]
s3: VFS: vfs_shadow_copy2. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:49:08 +0000 (14:49 -0700)]
s3: VFS: vfs_media_harmony. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:48:17 +0000 (14:48 -0700)]
s3: VFS: vfs_glusterfs. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_expand_msdfs. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:47:30 +0000 (14:47 -0700)]
s3: VFS: vfs_expand_msdfs. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph_snapshots. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:46:40 +0000 (14:46 -0700)]
s3: VFS: vfs_ceph_snapshots. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:44:41 +0000 (14:44 -0700)]
s3: VFS: vfs_ceph. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap. Remove readlink_fn(). No longer used.
Jeremy Allison [Thu, 22 Aug 2019 21:43:53 +0000 (14:43 -0700)]
s3: VFS: vfs_cap. Remove readlink_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: Change process_symlink_open() to call SMB_VFS_READLINKAT().
Jeremy Allison [Thu, 22 Aug 2019 21:41:27 +0000 (14:41 -0700)]
s3: smbd: Change process_symlink_open() to call SMB_VFS_READLINKAT().

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: Change smbd_do_qfilepathinfo(): case SMB_QUERY_FILE_UNIX_LINK: to call...
Jeremy Allison [Thu, 22 Aug 2019 21:39:56 +0000 (14:39 -0700)]
s3: smbd: Change smbd_do_qfilepathinfo(): case SMB_QUERY_FILE_UNIX_LINK: to call SMB_VFS_READLINKAT().

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: Change is_msdfs_link_internal() to call SMB_VFS_READLINKAT().
Jeremy Allison [Thu, 22 Aug 2019 21:38:01 +0000 (14:38 -0700)]
s3: smbd: Change is_msdfs_link_internal() to call SMB_VFS_READLINKAT().

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: torture: Change cmd_readlink to call SMB_VFS_READLINKAT().
Jeremy Allison [Thu, 22 Aug 2019 21:34:13 +0000 (14:34 -0700)]
s3: torture: Change cmd_readlink to call SMB_VFS_READLINKAT().

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_unityed_media. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:31:29 +0000 (14:31 -0700)]
s3: VFS: vfs_unityed_media. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_time_audit. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:29:45 +0000 (14:29 -0700)]
s3: VFS: vfs_time_audit. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_snapper. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:28:26 +0000 (14:28 -0700)]
s3: VFS: vfs_snapper. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:26:47 +0000 (14:26 -0700)]
s3: VFS: vfs_shadow_copy2. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:24:49 +0000 (14:24 -0700)]
s3: VFS: vfs_media_harmony. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:22:55 +0000 (14:22 -0700)]
s3: VFS: vfs_glusterfs. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_full_audit. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:21:23 +0000 (14:21 -0700)]
s3: VFS: vfs_full_audit. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_expand_msdfs. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:18:16 +0000 (14:18 -0700)]
s3: VFS: vfs_expand_msdfs. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph_snapshots. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 21:10:31 +0000 (14:10 -0700)]
s3: VFS: vfs_ceph_snapshots. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 20:51:28 +0000 (13:51 -0700)]
s3: VFS: vfs_ceph. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap. Implement readlinkat().
Jeremy Allison [Thu, 22 Aug 2019 20:49:28 +0000 (13:49 -0700)]
s3: VFS: vfs_cap. Implement readlinkat().

Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: Add SMB_VFS_READLINKAT().
Jeremy Allison [Thu, 22 Aug 2019 20:42:26 +0000 (13:42 -0700)]
s3: VFS: Add SMB_VFS_READLINKAT().

Currently identical to SMB_VFS_READLINK().

Next, add to all VFS modules that implement
readlink and eventually remove readlink.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agovfs_glusterfs: Use pthreadpool for scheduling aio operations
Poornima G [Wed, 24 Jul 2019 09:45:33 +0000 (15:15 +0530)]
vfs_glusterfs: Use pthreadpool for scheduling aio operations

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

Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 23 18:40:08 UTC 2019 on sn-devel-184

4 years agos4-dns: Deprecate BIND9_FLATFILE and remove "rndc command"
Andrew Bartlett [Fri, 5 Jul 2019 04:46:04 +0000 (16:46 +1200)]
s4-dns: Deprecate BIND9_FLATFILE and remove "rndc command"

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug 22 21:24:00 UTC 2019 on sn-devel-184

4 years agodocs: Deprecate "rndc command" for Samba 4.11
Andrew Bartlett [Fri, 16 Aug 2019 18:59:33 +0000 (06:59 +1200)]
docs: Deprecate "rndc command" for Samba 4.11

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3: VFS: Complete the replacement of SMB_VFS_MKNOD() -> SMB_VFS_MKNODAT().
Jeremy Allison [Wed, 21 Aug 2019 21:49:05 +0000 (14:49 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_MKNOD() -> SMB_VFS_MKNODAT().

Signed-off-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 Aug 22 19:17:07 UTC 2019 on sn-devel-184

4 years agos3: VFS: vfs_time_audit. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 21:44:20 +0000 (14:44 -0700)]
s3: VFS: vfs_time_audit. Remove mknod_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mknod_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_full_audit. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:57:58 +0000 (13:57 -0700)]
s3: VFS: vfs_full_audit. Remove mknod_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the mknod_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_unityed_media. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:55:37 +0000 (13:55 -0700)]
s3: VFS: vfs_unityed_media. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_syncops. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:54:52 +0000 (13:54 -0700)]
s3: VFS: vfs_syncops. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_snapper. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:54:02 +0000 (13:54 -0700)]
s3: VFS: vfs_snapper. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:53:22 +0000 (13:53 -0700)]
s3: VFS: vfs_shadow_copy2. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:52:04 +0000 (13:52 -0700)]
s3: VFS: vfs_media_harmony. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:48:50 +0000 (13:48 -0700)]
s3: VFS: vfs_glusterfs. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph_snapshots. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:47:54 +0000 (13:47 -0700)]
s3: VFS: vfs_ceph_snapshots. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:45:52 +0000 (13:45 -0700)]
s3: VFS: vfs_ceph. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap. Remove mknod_fn(). No longer used.
Jeremy Allison [Wed, 21 Aug 2019 20:45:02 +0000 (13:45 -0700)]
s3: VFS: vfs_cap. Remove mknod_fn(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: Make smb_unix_mknod() call SMB_VFS_MKNODAT() instead of SMB_VFS_MKNOD()
Jeremy Allison [Wed, 21 Aug 2019 19:15:01 +0000 (12:15 -0700)]
s3: smbd: Make smb_unix_mknod() call SMB_VFS_MKNODAT() instead of SMB_VFS_MKNOD()

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: torture: Change cmd_mknod to call SMB_VFS_MKNODAT().
Jeremy Allison [Wed, 21 Aug 2019 19:11:44 +0000 (12:11 -0700)]
s3: torture: Change cmd_mknod to call SMB_VFS_MKNODAT().

Use conn->cwd_fsp as current fsp.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_time_audit. Implement mknodat().
Jeremy Allison [Wed, 21 Aug 2019 19:09:24 +0000 (12:09 -0700)]
s3: VFS: vfs_time_audit. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_full_audit. Implement mknodat().
Jeremy Allison [Wed, 21 Aug 2019 18:36:48 +0000 (11:36 -0700)]
s3: VFS: vfs_full_audit. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_unityed_media. Implement mknodat().
Jeremy Allison [Wed, 21 Aug 2019 18:08:27 +0000 (11:08 -0700)]
s3: VFS: vfs_unityed_media. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_syncops. Implement mknodat().
Jeremy Allison [Wed, 21 Aug 2019 18:06:17 +0000 (11:06 -0700)]
s3: VFS: vfs_syncops. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_snapper. Implement mknodat().
Jeremy Allison [Wed, 21 Aug 2019 18:03:41 +0000 (11:03 -0700)]
s3: VFS: vfs_snapper. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2. Implement mknodat().
Jeremy Allison [Tue, 20 Aug 2019 23:57:24 +0000 (16:57 -0700)]
s3: VFS: vfs_shadow_copy2. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony. Implement mknodat().
Jeremy Allison [Tue, 20 Aug 2019 23:55:55 +0000 (16:55 -0700)]
s3: VFS: vfs_media_harmony. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs. Implement mknodat().
Jeremy Allison [Tue, 20 Aug 2019 23:54:05 +0000 (16:54 -0700)]
s3: VFS: vfs_glusterfs. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years ago3: VFS: vfs_ceph_snapshots. Implement mknodat().
Jeremy Allison [Tue, 20 Aug 2019 23:52:36 +0000 (16:52 -0700)]
3: VFS: vfs_ceph_snapshots. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph. Implement mknodat().
Jeremy Allison [Tue, 20 Aug 2019 23:50:57 +0000 (16:50 -0700)]
s3: VFS: vfs_ceph. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap. Implement mknodat().
Jeremy Allison [Tue, 20 Aug 2019 23:33:57 +0000 (16:33 -0700)]
s3: VFS: vfs_cap. Implement mknodat().

Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: Add SMB_VFS_MKNODAT().
Jeremy Allison [Tue, 20 Aug 2019 23:31:00 +0000 (16:31 -0700)]
s3: VFS: Add SMB_VFS_MKNODAT().

Currently identical to SMB_VFS_MKNOD().

Next, add to all VFS modules that implement
mknod and eventually remove mknod.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: smbd: Add sys_mknodat() wrapper call.
Jeremy Allison [Tue, 20 Aug 2019 23:28:18 +0000 (16:28 -0700)]
s3: smbd: Add sys_mknodat() wrapper call.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: Remove extraneous enum/struct values for removed SMB_VFS_OP_LINK.
Jeremy Allison [Wed, 21 Aug 2019 21:38:03 +0000 (14:38 -0700)]
s3: VFS: Remove extraneous enum/struct values for removed SMB_VFS_OP_LINK.

Forgot this in removal of SMB_VFS_LINK() patch previously pushed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3:net: load registry shares too in 'net vfs stream2adouble'
Ralph Wuerthner [Mon, 19 Aug 2019 11:18:23 +0000 (13:18 +0200)]
s3:net: load registry shares too in 'net vfs stream2adouble'

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.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): Thu Aug 22 17:41:20 UTC 2019 on sn-devel-184

4 years agodocs-xml: fix problamatic quotes from panic action example
Björn Jacke [Thu, 22 Aug 2019 11:51:59 +0000 (13:51 +0200)]
docs-xml: fix problamatic quotes from panic action example

those quotes work for smbd but do not work for the samba binary. Without quotes
it works with both.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Thu Aug 22 13:46:14 UTC 2019 on sn-devel-184

4 years agopython: use os.urandom, which is available in python by definition
Björn Jacke [Thu, 4 Jul 2019 18:38:50 +0000 (20:38 +0200)]
python: use os.urandom, which is available in python by definition

os.urandom also uses CSPRNG methods like getrandom() when the underlying OS
provides those.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolib: free popt context in texpect
Swen Schillig [Mon, 19 Aug 2019 11:09:25 +0000 (13:09 +0200)]
lib: free popt context in texpect

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug 22 01:41:37 UTC 2019 on sn-devel-184

4 years agos4: free popt context in dnsserver
Swen Schillig [Mon, 19 Aug 2019 12:33:33 +0000 (14:33 +0200)]
s4: free popt context in dnsserver

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos4: free popt context in utils
Swen Schillig [Mon, 19 Aug 2019 12:31:23 +0000 (14:31 +0200)]
s4: free popt context in utils

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos4: free popt context in client
Swen Schillig [Mon, 19 Aug 2019 12:29:22 +0000 (14:29 +0200)]
s4: free popt context in client

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos4: free popt context in torture
Swen Schillig [Mon, 19 Aug 2019 12:18:06 +0000 (14:18 +0200)]
s4: free popt context in torture

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agorpcclient: free popt context when done
Swen Schillig [Mon, 19 Aug 2019 12:11:54 +0000 (14:11 +0200)]
rpcclient: free popt context when done

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: free popt context in utils
Swen Schillig [Mon, 19 Aug 2019 11:29:03 +0000 (13:29 +0200)]
s3: free popt context in utils

If done with popt context it should be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agotorture: fix mem leak found by ASAN (smb2_connect)
Swen Schillig [Mon, 5 Aug 2019 09:19:49 +0000 (11:19 +0200)]
torture: fix mem leak found by ASAN (smb2_connect)

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f0b16624c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f0b15e4ba5c in __talloc_with_prefix ../../lib/talloc/talloc.c:782
    #2 0x7f0b15e4ba5c in __talloc ../../lib/talloc/talloc.c:824
    #3 0x7f0b15e4ba5c in _talloc_named_const ../../lib/talloc/talloc.c:981
    #4 0x7f0b15e4ba5c in talloc_named_const ../../lib/talloc/talloc.c:1748
    #5 0x55ffdd30d591 in torture_smb2_connect ../../source4/torture/smb2/connect.c:199
    #6 0x7f0b12723772 in wrap_simple_test ../../lib/torture/torture.c:633
    #7 0x7f0b1272775e in internal_torture_run_test ../../lib/torture/torture.c:442
    #8 0x7f0b12728543 in torture_run_tcase_restricted ../../lib/torture/torture.c:507
    #9 0x7f0b12728dd5 in torture_run_suite_restricted ../../lib/torture/torture.c:357
    #10 0x7f0b12729434 in torture_run_suite ../../lib/torture/torture.c:339
    #11 0x55ffdd10c54a in run_matching ../../source4/torture/smbtorture.c:93
    #12 0x55ffdd10df56 in torture_run_named_tests ../../source4/torture/smbtorture.c:143
    #13 0x55ffdd11199d in main ../../source4/torture/smbtorture.c:691
    #14 0x7f0b0aa45412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Aug 21 15:42:43 UTC 2019 on sn-devel-184

4 years agoctdb-tests: Clear deleted record via recovery instead of vacuuming
Martin Schwenke [Tue, 13 Aug 2019 04:45:33 +0000 (14:45 +1000)]
ctdb-tests: Clear deleted record via recovery instead of vacuuming

This test has been flapping because sometimes the record is not
vacuumed within the expected time period, perhaps even because the
check for the record can interfere with vacuuming.  However, instead
of waiting for vacuuming the record can be cleared by doing a
recovery.  This should be much more reliable.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
RN: Fix flapping CTDB tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Aug 21 13:06:57 UTC 2019 on sn-devel-184

4 years agoctdb-tests: Wait for child process when killing cluster mutex helper
Martin Schwenke [Wed, 7 Aug 2019 06:58:37 +0000 (16:58 +1000)]
ctdb-tests: Wait for child process when killing cluster mutex helper

The following test sometimes fails:

==================================================
Running "cluster_mutex_test lock-unlock-lock-unlock ./tests/var/cluster_mutex.lockfile"
--------------------------------------------------
Output (Exit status: 134):
--------------------------------------------------
LOCK
UNLOCK
CONTENTION
NOLOCK
cluster_mutex_test: ../../tests/src/cluster_mutex_test.c:307: test_lock_unlock_lock_unlock: Assertion `dl2->mh != NULL' failed.
--------------------------------------------------
Required output (Exit status: 0):
--------------------------------------------------
LOCK
UNLOCK
LOCK
UNLOCK

FAILED
==========================================================================
TEST FAILED: tests/cunit/cluster_mutex_001.sh (status 1) (duration: 0s)
==========================================================================

This is due to a race in the test.  For the first UNLOCK a signal is
sent to the cluster mutex handler but the test tries to retake the
lock before that process is scheduled and the signal is processed.
Therefore, the fcntl() lock is still held and contention is seen.

After unlocking, tests need to wait until the child has gone, so build
this into ctdb_kill().  This is one of the only places where the PID
is accessible.

Outside of testing, on a real system, nothing will never try
to (re)take the lock so quickly.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Strengthen volatile DB traverse test
Martin Schwenke [Mon, 29 Jul 2019 07:22:50 +0000 (17:22 +1000)]
ctdb-tests: Strengthen volatile DB traverse test

Check the record count more often, from multiple nodes.  Add a case
with multiple records.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-recoverd: Only check for LMASTER nodes in the VNN map
Martin Schwenke [Wed, 21 Aug 2019 04:35:09 +0000 (14:35 +1000)]
ctdb-recoverd: Only check for LMASTER nodes in the VNN map

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Don't retrieve the VNN map from target node for notlmaster
Martin Schwenke [Mon, 29 Jul 2019 06:45:07 +0000 (16:45 +1000)]
ctdb-tests: Don't retrieve the VNN map from target node for notlmaster

Use the VNN map from the node running node_has_status().

This means that

  wait_until_node_has_status 1 notlmaster 10 0

will run "ctdb status" on node 0 and check (for up to 10 seconds) if
node 1 is in the VNN map.

If the LMASTER capability has been dropped on node 1 then the above
will wait for the VNN map to be updated on node 0.  This will happen
as part of the recovery that is triggered by the change of LMASTER
capability.  The next command will then only be able to attach to
$TESTDB after the recovery is complete thus guaranteeing a sane state
for the test to continue.

This stops simple/79_volatile_db_traverse.sh from going into recovery
during the traverse or at some other inconvenient time.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Handle special cases first and return
Martin Schwenke [Mon, 29 Jul 2019 06:43:09 +0000 (16:43 +1000)]
ctdb-tests: Handle special cases first and return

All the other cases involve matching bits.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Inline handling of recovered and notlmaster statuses
Martin Schwenke [Mon, 29 Jul 2019 05:45:41 +0000 (15:45 +1000)]
ctdb-tests: Inline handling of recovered and notlmaster statuses

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Drop unused node statuses frozen/unfrozen
Martin Schwenke [Mon, 29 Jul 2019 05:40:16 +0000 (15:40 +1000)]
ctdb-tests: Drop unused node statuses frozen/unfrozen

Silently drop unused local variable mpat.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>