samba.git
4 years agoauth/gensec: Use gnutls_error_to_ntstatus() consistently in schannel
Andrew Bartlett [Fri, 16 Aug 2019 03:43:01 +0000 (15:43 +1200)]
auth/gensec: Use gnutls_error_to_ntstatus() consistently in schannel

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agoauth:gensec: Use GnuTLS AES128 CFB8 in netsec_do_seq_num()
Andreas Schneider [Fri, 1 Mar 2019 16:55:02 +0000 (17:55 +0100)]
auth:gensec: Use GnuTLS AES128 CFB8 in netsec_do_seq_num()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoauth/credentials: Check NTSTATUS return from netlogon_creds_aes_encrypt()
Andrew Bartlett [Fri, 16 Aug 2019 02:29:45 +0000 (14:29 +1200)]
auth/credentials: Check NTSTATUS return from netlogon_creds_aes_encrypt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3-librpc: Remove unused init_netr_CryptPassword()
Andrew Bartlett [Fri, 16 Aug 2019 02:22:42 +0000 (14:22 +1200)]
s3-librpc: Remove unused init_netr_CryptPassword()

Unused since 38d4dba37406515181e4d6f1a1faffc18e652e27 in 2013

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4-rpc_server: Check NTSTATUS return value from netlogon_creds_aes_decrypt()
Andrew Bartlett [Fri, 16 Aug 2019 02:15:45 +0000 (14:15 +1200)]
s4-rpc_server: Check NTSTATUS return value from netlogon_creds_aes_decrypt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos3-rpc_server: Check NTSTATUS return value from netlogon_creds_aes_decrypt()
Andrew Bartlett [Fri, 16 Aug 2019 02:05:38 +0000 (14:05 +1200)]
s3-rpc_server: Check NTSTATUS return value from netlogon_creds_aes_decrypt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli:auth Check NTSTATUS from netlogon_creds_aes_{en,de}crypt()
Andrew Bartlett [Fri, 16 Aug 2019 01:55:49 +0000 (13:55 +1200)]
libcli:auth Check NTSTATUS from netlogon_creds_aes_{en,de}crypt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agocrypto: Update REQUIREMENTS file with new minimum version
Andrew Bartlett [Fri, 16 Aug 2019 01:52:36 +0000 (13:52 +1200)]
crypto: Update REQUIREMENTS file with new minimum version

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli:auth Return NTSTATUS from netlogon_creds_aes_decrypt()
Andrew Bartlett [Fri, 16 Aug 2019 00:34:28 +0000 (12:34 +1200)]
libcli:auth Return NTSTATUS from netlogon_creds_aes_decrypt()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agolibcli:auth: Use GnuTLS AES128 CFB for netlogon_creds_aes_decrypt()
Andreas Schneider [Mon, 18 Mar 2019 14:13:08 +0000 (15:13 +0100)]
libcli:auth: Use GnuTLS AES128 CFB for netlogon_creds_aes_decrypt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Return NTSTATUS for netlogon_creds_aes_encrypt()
Andreas Schneider [Wed, 29 May 2019 14:38:09 +0000 (16:38 +0200)]
libcli:auth: Return NTSTATUS for netlogon_creds_aes_encrypt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adapted by Andrew Bartlett to use gnutls_error_to_ntstatus()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Use GnuTLS AES128 CFB for netlogon_creds_aes_encrypt()
Andreas Schneider [Fri, 1 Mar 2019 16:41:11 +0000 (17:41 +0100)]
libcli:auth: Use GnuTLS AES128 CFB for netlogon_creds_aes_encrypt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agolibcli:auth: Use netlogon_creds_aes_encrypt() in netlogon_creds_step_crypt()
Andreas Schneider [Fri, 1 Mar 2019 16:33:01 +0000 (17:33 +0100)]
libcli:auth: Use netlogon_creds_aes_encrypt() in netlogon_creds_step_crypt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agowaf: Check for GNUTLS AES CFB support
Andreas Schneider [Fri, 1 Mar 2019 16:35:02 +0000 (17:35 +0100)]
waf: Check for GNUTLS AES CFB support

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:samdb: Only include necessary header files in encrypted_secrets
Andreas Schneider [Tue, 26 Feb 2019 17:33:09 +0000 (18:33 +0100)]
s4:samdb: Only include necessary header files in encrypted_secrets

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:samdb: Remove dual-stack mode from (test_)encrypted_secrets
Andreas Schneider [Tue, 26 Feb 2019 17:32:34 +0000 (18:32 +0100)]
s4:samdb: Remove dual-stack mode from (test_)encrypted_secrets

Now we either build with GnuTLS or Samba crypto. If a modern GnuTLS
version is detected that will be used and Samba crypto wont be
available.

This removes the dual-stack mode that encrypted with one and decrypted
with the other in the testsuite.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Commit message clarified by Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
4 years agoencrypted_secrets: Add known and expected value test
Andrew Bartlett [Thu, 15 Aug 2019 03:27:30 +0000 (15:27 +1200)]
encrypted_secrets: Add known and expected value test

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agos4:samdb: Add test_gnutls_value_decryption()
Andreas Schneider [Mon, 29 Jul 2019 07:21:11 +0000 (09:21 +0200)]
s4:samdb: Add test_gnutls_value_decryption()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos3: net: net_ads: fix a typo in comment
Marco Wang [Wed, 14 Aug 2019 06:05:05 +0000 (14:05 +0800)]
s3: net: net_ads: fix a typo in comment

Signed-off-by: Marco Wang <m.aesophor@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 21 08:39:43 UTC 2019 on sn-devel-184

4 years agotalloc: ASAN fix for test_magic_protection
Swen Schillig [Thu, 15 Aug 2019 12:43:22 +0000 (14:43 +0200)]
talloc: ASAN fix for test_magic_protection

Direct leak of 1152 byte(s) in 1 object(s) allocated from:
     #0 0x7f06393dfc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
     #1 0x7f06392cfd59 in __talloc_with_prefix ../../talloc.c:782
     #2 0x7f06392cfd59 in _talloc_pool ../../talloc.c:837
     #3 0x7f06392cfd59 in talloc_pool ../../talloc.c:859
     #4 0x40b83c in test_magic_protection ../../testsuite.c:1960
     #5 0x40b83c in torture_local_talloc ../../testsuite.c:2164
     #6 0x402603 in main ../../testsuite_main.c:32
     #7 0x7f063908a412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
4 years agotalloc: ASAN fix for test_rusty
Swen Schillig [Thu, 15 Aug 2019 12:39:58 +0000 (14:39 +0200)]
talloc: ASAN fix for test_rusty

Direct leak of 100 byte(s) in 1 object(s) allocated from:
     #0 0x7f06393dfc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
     #1 0x7f06392d1af3 in __talloc_with_prefix ../../talloc.c:782
     #2 0x7f06392d1af3 in __talloc ../../talloc.c:824
     #3 0x7f06392d1af3 in __talloc_strlendup ../../talloc.c:2455
     #4 0x7f06392d1af3 in talloc_strdup ../../talloc.c:2471
     #5 0x40b4f0 in test_rusty ../../testsuite.c:1543
     #6 0x40b4f0 in torture_local_talloc ../../testsuite.c:2146
     #7 0x402603 in main ../../testsuite_main.c:32
     #8 0x7f063908a412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
4 years agotalloc: ASAN fix for test_pool_nest
Swen Schillig [Thu, 15 Aug 2019 12:36:59 +0000 (14:36 +0200)]
talloc: ASAN fix for test_pool_nest

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f06393dfc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f06392d0c45 in __talloc_with_prefix ../../talloc.c:782
    #2 0x7f06392d0c45 in __talloc ../../talloc.c:824
    #3 0x7f06392d0c45 in _talloc_named_const ../../talloc.c:981
    #4 0x7f06392d0c45 in talloc_named_const ../../talloc.c:1748
    #5 0x40901e in test_pool_nest ../../testsuite.c:1451
    #6 0x40901e in torture_local_talloc ../../testsuite.c:2096
    #7 0x402603 in main ../../testsuite_main.c:32
    #8 0x7f063908a412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
4 years agotalloc: ASAN fix for test_talloc_free_in_destructor
Swen Schillig [Thu, 15 Aug 2019 12:33:32 +0000 (14:33 +0200)]
talloc: ASAN fix for test_talloc_free_in_destructor

Indirect leak of 104 byte(s) in 1 object(s) allocated from:
    #0 0x7f06393dfc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7f06392d0c45 in __talloc_with_prefix ../../talloc.c:782
    #2 0x7f06392d0c45 in __talloc ../../talloc.c:824
    #3 0x7f06392d0c45 in _talloc_named_const ../../talloc.c:981
    #4 0x7f06392d0c45 in talloc_named_const ../../talloc.c:1748
    #5 0x409edd in test_talloc_free_in_destructor ../../testsuite.c:1256
    #6 0x409edd in torture_local_talloc ../../testsuite.c:2138
    #7 0x402603 in main ../../testsuite_main.c:32
    #8 0x7f063908a412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
4 years agotalloc: ASAN fix for test_realloc_on_destructor_parent
Swen Schillig [Thu, 15 Aug 2019 12:22:46 +0000 (14:22 +0200)]
talloc: ASAN fix for test_realloc_on_destructor_parent

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7fd52c00dc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
    #1 0x7fd52befec45 in __talloc_with_prefix ../../talloc.c:782
    #2 0x7fd52befec45 in __talloc ../../talloc.c:824
    #3 0x7fd52befec45 in _talloc_named_const ../../talloc.c:981
    #4 0x7fd52befec45 in talloc_named_const ../../talloc.c:1748
    #5 0x4099bd in test_realloc_on_destructor_parent ../../testsuite.c:1000
    #6 0x4099bd in torture_local_talloc ../../testsuite.c:2129
    #7 0x402603 in main ../../testsuite_main.c:32
    #8 0x7fd52bcb8412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
4 years agos3: VFS: Complete the replacement of SMB_VFS_LINK() -> SMB_VFS_LINKAT().
Jeremy Allison [Fri, 16 Aug 2019 23:40:37 +0000 (16:40 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_LINK() -> SMB_VFS_LINKAT().

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): Tue Aug 20 22:26:17 UTC 2019 on sn-devel-184

4 years agos3: VFS: vfs_time_audit. Remove link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:29:11 +0000 (16:29 -0700)]
s3: VFS: vfs_time_audit. Remove link_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the rename_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:21:42 +0000 (16:21 -0700)]
s3: VFS: vfs_full_audit. Remove link_fn(). No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the rename_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:28:16 +0000 (16:28 -0700)]
s3: VFS: vfs_unityed_media. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:27:25 +0000 (16:27 -0700)]
s3: VFS: vfs_syncops. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:26:34 +0000 (16:26 -0700)]
s3: VFS: vfs_snapper. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:25:37 +0000 (16:25 -0700)]
s3: VFS: vfs_shadow_copy2. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:24:53 +0000 (16:24 -0700)]
s3: VFS: vfs_media_harmony. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:24:38 +0000 (16:24 -0700)]
s3: VFS: vfs_glusterfs. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:21:04 +0000 (16:21 -0700)]
s3: VFS: vfs_ceph_snapshots. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:19:22 +0000 (16:19 -0700)]
s3: VFS: vfs_ceph. Remove link_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 link_fn(). No longer used.
Jeremy Allison [Fri, 16 Aug 2019 23:18:34 +0000 (16:18 -0700)]
s3: VFS: vfs_cap. Remove link_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 hardlink_internals() call SMB_VFS_LINKAT() instead of SMB_VFS_LINK()
Jeremy Allison [Fri, 16 Aug 2019 23:16:48 +0000 (16:16 -0700)]
s3: smbd: Make hardlink_internals() call SMB_VFS_LINKAT() instead of SMB_VFS_LINK()

Use conn->cwd_fsp as current src and dst fsp's.

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_link to call SMB_VFS_LINKAT().
Jeremy Allison [Fri, 16 Aug 2019 23:14:03 +0000 (16:14 -0700)]
s3: torture: Change cmd_link to call SMB_VFS_LINKAT().

Use conn->cwd_fsp as current src and dst fsp's.

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 linkat().
Jeremy Allison [Fri, 16 Aug 2019 23:08:22 +0000 (16:08 -0700)]
s3: VFS: vfs_unityed_media. Implement linkat().

Currently identical to link().

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

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_syncops. Implement linkat().
Jeremy Allison [Fri, 16 Aug 2019 23:04:02 +0000 (16:04 -0700)]
s3: VFS: vfs_syncops. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_snapper. Implement linkat().
Jeremy Allison [Fri, 16 Aug 2019 23:01:22 +0000 (16:01 -0700)]
s3: VFS: vfs_snapper. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_shadow_copy2. Implement linkat().
Jeremy Allison [Fri, 16 Aug 2019 22:59:27 +0000 (15:59 -0700)]
s3: VFS: vfs_shadow_copy2. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_media_harmony. Implement linkat().
Jeremy Allison [Fri, 16 Aug 2019 22:57:15 +0000 (15:57 -0700)]
s3: VFS: vfs_media_harmony. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs. Implement linkat().
Jeremy Allison [Wed, 14 Aug 2019 20:01:39 +0000 (13:01 -0700)]
s3: VFS: vfs_glusterfs. Implement linkat().

Currently identical to link().

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

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph_snapshots. Implement linkat().
Jeremy Allison [Wed, 14 Aug 2019 18:38:23 +0000 (11:38 -0700)]
s3: VFS: vfs_ceph_snapshots. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_ceph. Implement linkat().
Jeremy Allison [Wed, 14 Aug 2019 18:32:30 +0000 (11:32 -0700)]
s3: VFS: vfs_ceph. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: vfs_cap. Implement linkat().
Jeremy Allison [Tue, 13 Aug 2019 21:59:05 +0000 (14:59 -0700)]
s3: VFS: vfs_cap. Implement linkat().

Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agos3: VFS: Add SMB_VFS_LINKAT().
Jeremy Allison [Mon, 12 Aug 2019 23:49:26 +0000 (16:49 -0700)]
s3: VFS: Add SMB_VFS_LINKAT().

Currently identical to SMB_VFS_LINK().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agovfs_glusterfs: Enable profiling for file system operations
Anoop C S [Mon, 5 Aug 2019 05:15:01 +0000 (10:45 +0530)]
vfs_glusterfs: Enable profiling for file system operations

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

Signed-off-by: Anoop C S <anoopcs@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): Tue Aug 20 19:25:28 UTC 2019 on sn-devel-184

4 years agotdb: Release tdb 1.4.2 tdb-1.4.2
Stefan Metzmacher [Tue, 20 Aug 2019 12:55:27 +0000 (14:55 +0200)]
tdb: Release tdb 1.4.2

* Build fixes
* Improve the performance by inlining the tdb_oob() checks

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 20 14:45:41 UTC 2019 on sn-devel-184

4 years agoctdb-daemon: Make node inactive in the NODE_STOP control
Martin Schwenke [Mon, 19 Aug 2019 11:48:04 +0000 (21:48 +1000)]
ctdb-daemon: Make node inactive in the NODE_STOP control

Currently some of this is supported by a periodic check in the
recovery daemon's main_loop(), which notices the flag change, sets
recovery mode active and freezes databases.  If STOP_NODE returns
immediately then the associated recovery can complete and the node can
be continued before databases are actually frozen.

Instead, immediately do all of the things that make a node inactive.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087
RN: Stop "ctdb stop" from completing before freezing databases

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 20 08:32:27 UTC 2019 on sn-devel-184

4 years agoctdb-daemon: Drop unused function ctdb_local_node_got_banned()
Martin Schwenke [Tue, 20 Aug 2019 01:29:42 +0000 (11:29 +1000)]
ctdb-daemon: Drop unused function ctdb_local_node_got_banned()

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-daemon: Switch banning code to use ctdb_node_become_inactive()
Martin Schwenke [Mon, 19 Aug 2019 11:52:57 +0000 (21:52 +1000)]
ctdb-daemon: Switch banning code to use ctdb_node_become_inactive()

There's no reason to avoid immediately setting recovery mode to active
and initiating freeze of databases.

This effectively reverts the following commits:

  d8f3b490bbb691c9916eed0df5b980c1aef23c85
  b4357a79d916b1f8ade8fa78563fbef0ce670aa9

The latter is now implemented using a control, resulting in looser
coupling.

See also the following commit:

  f8141e91a693912ea1107a49320e83702a80757a

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-daemon: Factor out new function ctdb_node_become_inactive()
Martin Schwenke [Mon, 19 Aug 2019 11:47:03 +0000 (21:47 +1000)]
ctdb-daemon: Factor out new function ctdb_node_become_inactive()

This is a superset of ctdb_local_node_got_banned() so will replace
that function, and will also be used in the NODE_STOP control.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agobuild: fix mandatory typo in zlib configure check
David Disseldorp [Sun, 18 Aug 2019 09:24:37 +0000 (11:24 +0200)]
build: fix mandatory typo in zlib configure check

This ensures that waf correctly fails during configure if zlib is
missing.
msg can also be dropped as it matches the waf validate_cfg() default
(ignoring the quotes).

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 20 06:58:12 UTC 2019 on sn-devel-184

4 years agoldb: Free memory when repacking database
Tim Beale [Tue, 30 Jul 2019 22:54:29 +0000 (10:54 +1200)]
ldb: Free memory when repacking database

The msg for each database record is allocated on the module context, but
never freed. The module seems like it could be a long-running context (as
the database would normally get repacked by the samba executable).

Even if it's not a proper leak, it shouldn't hurt to cleanup the memory.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue Aug 20 04:57:10 UTC 2019 on sn-devel-184

4 years agoldb: Log the partition we're repacking
Tim Beale [Tue, 30 Jul 2019 22:33:49 +0000 (10:33 +1200)]
ldb: Log the partition we're repacking

Firstly, with Samba AD this looks a little weird because we log the same
message 5 times (once for every partition). If we log that we're doing
this to records in different partitions, hopefully someone with a little
Samba knowledge can figure out what's going on.

Secondly, the info about what partitions are actually changing might be
useful. E.g. if we hit a fatal error repacking the 3rd partition, and
the transaction doesn't abort properly, then it would be useful to know
what partitions were repacked and which ones weren't.

There doesn't appear to be a useful name for the partition
(ldb_kv->kv_ops->name() doesn't seem any more intelligible to a user),
so just log the first record that we update. We can use that to infer
the partition database).

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agoldb: Log pack format in user-friendly way
Tim Beale [Tue, 30 Jul 2019 04:40:55 +0000 (16:40 +1200)]
ldb: Log pack format in user-friendly way

The "format 0x26011968" log confused me (and I'm a developer).
We can subtract the base offset from the pack format to get a more
user-friendly number, e.g. v0 (not actually used), v1, v2, etc.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agoldb: Change pack format defines to enum
Tim Beale [Tue, 30 Jul 2019 03:15:40 +0000 (15:15 +1200)]
ldb: Change pack format defines to enum

The main reason is so that any future pack formats will continue
incrementing this number in a sequential fashion.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agoldb: Move where we update the pack format version
Tim Beale [Tue, 30 Jul 2019 03:02:25 +0000 (15:02 +1200)]
ldb: Move where we update the pack format version

Store it on the repack context so that we can log a more informative
message "Repacking from format x to format y".

While this is not really a big deal currently, it could be worth
recording for potential future scenarios (i.e. supporting three or more
pack versions), where upgrades could potentially skip an intermediary
pack format version.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agoldb: Always log when the database pack format changes
Tim Beale [Tue, 30 Jul 2019 04:40:55 +0000 (16:40 +1200)]
ldb: Always log when the database pack format changes

LDB_DEBUG_WARNING gets logged by Samba as level 2, whereas the default
log level for Samba is 0. It's not really fair to the user to change the
format of their database on disk and potentially not tell them.

This patch adds a log with level zero (using a alias define, as this
technically isn't a fatal problem).

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agodowngradedatabase: installing script
Aaron Haslett [Mon, 22 Jul 2019 01:35:21 +0000 (13:35 +1200)]
downgradedatabase: installing script

Installing downgrade script so people don't need the source tree for it.

Exception added in usage test because running the script without arguments
is valid. (This avoids the need to knownfail it).

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

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agodowngradedatabase: Add man-page documentation
Aaron Haslett [Mon, 22 Jul 2019 01:35:21 +0000 (13:35 +1200)]
downgradedatabase: Add man-page documentation

A man-page is needed so that we can install this tool as part of the
Samba package.

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

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agodowngradedatabase: rename to samba_downgrade_db
Tim Beale [Mon, 29 Jul 2019 01:39:04 +0000 (13:39 +1200)]
downgradedatabase: rename to samba_downgrade_db

Just so that it's slightly less of a mouthful for users.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agotests: Avoid hardcoding relative filepath
Tim Beale [Mon, 29 Jul 2019 01:35:08 +0000 (13:35 +1200)]
tests: Avoid hardcoding relative filepath

If we move the test file, the test will break.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agodowngradedatabase: comply with samba.tests.source
Aaron Haslett [Mon, 22 Jul 2019 03:29:03 +0000 (15:29 +1200)]
downgradedatabase: comply with samba.tests.source

In next commit we'll install the script, samba.tests.source picked up the
lack of a copyright message and some whitespace errors, so this patch
fixes that stuff first.

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

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
4 years agosmbd: Move lease type detection in delay_for_oplock()
Volker Lendecke [Tue, 13 Aug 2019 14:56:58 +0000 (16:56 +0200)]
smbd: Move lease type detection in delay_for_oplock()

Walk the share_modes array only once.

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 Aug 20 00:33:12 UTC 2019 on sn-devel-184

4 years agosmbd: Merge grant_fsp_oplock_type() into delay_for_oplock()
Volker Lendecke [Sat, 10 Aug 2019 19:23:24 +0000 (21:23 +0200)]
smbd: Merge grant_fsp_oplock_type() into delay_for_oplock()

This is a preparation for the next commit: Only walk the share_modes[]
array once when handling oplocks and leases.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Move delay_for_oplock() down
Volker Lendecke [Sat, 10 Aug 2019 19:17:05 +0000 (21:17 +0200)]
smbd: Move delay_for_oplock() down

We'll merge grant_fsp_oplock_type() into this function. This makes the next
commit smaller, and the newly extended delay_for_oplocks will for example
reference static file_has_brlocks() above. Make forward declarations
unnecessary.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Make delay_for_oplock() return NTSTATUS
Volker Lendecke [Sat, 10 Aug 2019 19:15:22 +0000 (21:15 +0200)]
smbd: Make delay_for_oplock() return NTSTATUS

A further commit will merge grant_fsp_oplock_type (returning NTSTATUS)
into delay_for_oplock(). Make that commit smaller.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Slightly simplify grant_fsp_oplock_type()
Volker Lendecke [Fri, 9 Aug 2019 11:39:34 +0000 (13:39 +0200)]
smbd: Slightly simplify grant_fsp_oplock_type()

This is never called with INTERNAL_OPENs anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Slightly simplify delay_for_oplock()
Volker Lendecke [Fri, 9 Aug 2019 11:38:40 +0000 (13:38 +0200)]
smbd: Slightly simplify delay_for_oplock()

This is never called for INTERNAL_OPENs anymore, see
handle_share_mode_lease()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Introduce handle_share_mode_lease()
Volker Lendecke [Wed, 7 Aug 2019 10:15:45 +0000 (12:15 +0200)]
smbd: Introduce handle_share_mode_lease()

This consolidates the core share_mode_lock access of open_file_ntcreate
into one routine.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Move set_share_mode() out of grant_fsp_oplock_type()
Volker Lendecke [Tue, 6 Aug 2019 14:28:29 +0000 (16:28 +0200)]
smbd: Move set_share_mode() out of grant_fsp_oplock_type()

This shows that "req", "share_access" and "access_mask" are not needed
for the core logic of grant_fsp_oplock_type() and it separates
concerns a bit: open_directory() also does the set_share_mode() in the
main open routine, not in a helper like grant_fsp_oplock_type()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Move grant_fsp_oplock_type() close to delay_for_oplock()
Volker Lendecke [Thu, 25 Jul 2019 14:31:17 +0000 (16:31 +0200)]
smbd: Move grant_fsp_oplock_type() close to delay_for_oplock()

Note that this is not a cut&paste: Instead of fsp->access_mask we use
the access_mask the client requested. At the new code location
fsp->access_mask (a.k.a. open_access_mask) might have FILE_WRITE_DATA
from O_TRUNC (a.k.a. FILE_OVERWRITE).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Slightly simplify open_file_ntcreate()
Volker Lendecke [Fri, 2 Aug 2019 13:24:16 +0000 (15:24 +0200)]
smbd: Slightly simplify open_file_ntcreate()

There is no reference to "file_existed" after this point anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Remove a late ref to "file_existed" in open_file_ntcreate()
Volker Lendecke [Fri, 2 Aug 2019 13:21:49 +0000 (15:21 +0200)]
smbd: Remove a late ref to "file_existed" in open_file_ntcreate()

If you follow "existing_dos_attributes" through the routine, this can
only ever be !=0 if SMB_VFS_GET_DOS_ATTRIBUTES() was successful. This
can only have been successful if the file existed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Move resetting "oplock_request" to before delay_for_oplock()
Volker Lendecke [Thu, 25 Jul 2019 09:52:21 +0000 (11:52 +0200)]
smbd: Move resetting "oplock_request" to before delay_for_oplock()

It seems to make little sense to me to do the oplock break with one
setting and then later on grant_fsp_oplock_type with another
one. Survives tests, I can't think of any scenario where this (to me)
simplification would break anything

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: For kernel-oplocked files don't call delay_for_oplock()
Volker Lendecke [Sun, 18 Aug 2019 06:57:38 +0000 (08:57 +0200)]
smbd: For kernel-oplocked files don't call delay_for_oplock()

The kernel has already sent the signal. We don't have to send another
message. Instead, just directly wait for the downgrade to happen via
the watch on the share mode lock assuming it's there. Also setup the
polling interval: I could imagine that in some race situation the file
has already been closed and re-opened by a nonsamba process while we
were waiting.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Optionally wait for a share mode record in setup_poll_open()
Volker Lendecke [Sun, 18 Aug 2019 06:55:14 +0000 (08:55 +0200)]
smbd: Optionally wait for a share mode record in setup_poll_open()

This will be used when waiting for a oplock break that has been
signalled via a kernel oplock break.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Simplify has_other_nonposix_opens()
Volker Lendecke [Wed, 14 Aug 2019 19:27:53 +0000 (21:27 +0200)]
smbd: Simplify has_other_nonposix_opens()

We pick quite some information from "fsp" already, so from an API design
perspecitve it's only fair to only use its implicit server_id. This is
what all the callers did anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Align integer types
Volker Lendecke [Wed, 14 Aug 2019 19:39:50 +0000 (21:39 +0200)]
smbd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Simplify delay_for_oplock()
Volker Lendecke [Sat, 10 Aug 2019 13:01:24 +0000 (15:01 +0200)]
smbd: Simplify delay_for_oplock()

Use is_same_lease()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Move is_same_lease() up in the file
Volker Lendecke [Sat, 10 Aug 2019 13:01:00 +0000 (15:01 +0200)]
smbd: Move is_same_lease() up in the file

The next commit will need it there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Simplify is_same_lease()
Volker Lendecke [Sat, 10 Aug 2019 12:28:51 +0000 (14:28 +0200)]
smbd: Simplify is_same_lease()

It does not use "struct share_mode_data"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Optimize delay_for_oplock()
Volker Lendecke [Sat, 10 Aug 2019 12:44:08 +0000 (14:44 +0200)]
smbd: Optimize delay_for_oplock()

get_lease_type() can involve a database access. Do that only if
necessary, and that is at most once in this loop.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agolib: Remove a duplicate function prototype
Volker Lendecke [Sat, 10 Aug 2019 14:45:30 +0000 (16:45 +0200)]
lib: Remove a duplicate function prototype

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Remove a misleading comment
Volker Lendecke [Fri, 9 Aug 2019 11:48:53 +0000 (13:48 +0200)]
smbd: Remove a misleading comment

open_mode_check() is done before the oplock breaks.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Merge two DEBUGs into one
Volker Lendecke [Mon, 12 Aug 2019 10:12:48 +0000 (12:12 +0200)]
smbd: Merge two DEBUGs into one

This looks easier to understand to me, less lines in logfiles

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Avoid casts in share_conflict()
Volker Lendecke [Mon, 12 Aug 2019 09:44:39 +0000 (11:44 +0200)]
smbd: Avoid casts in share_conflict()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agosmbd: Save two lines in find_share_mode_entry
Volker Lendecke [Sat, 10 Aug 2019 20:15:05 +0000 (22:15 +0200)]
smbd: Save two lines in find_share_mode_entry

Directly initialized variables give compilers less reason to complain

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agolib: Micro-optimization for db_tdb_do_locked()
Volker Lendecke [Tue, 13 Aug 2019 12:43:08 +0000 (14:43 +0200)]
lib: Micro-optimization for db_tdb_do_locked()

We don't need the tdb lock for the talloc_free(buf) anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
4 years agothird_party: Remove historical tombstone about zlib divergance
Andrew Bartlett [Fri, 16 Aug 2019 08:58:32 +0000 (20:58 +1200)]
third_party: Remove historical tombstone about zlib divergance

Now this has been recorded in the git history, we can remove it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Aug 17 05:10:48 UTC 2019 on sn-devel-184

4 years agothird_party: Remove zlib from third_party
Andrew Bartlett [Fri, 16 Aug 2019 05:43:51 +0000 (17:43 +1200)]
third_party: Remove zlib from third_party

We require zlib 1.2.3.

We stopped requring a patched zlib with 5631a1b9bc03d6cf31af66b13872255f18979fe8

As discussed on samba-technical here:

https://lists.samba.org/archive/samba-technical/2019-May/133476.html

In short, zlib contains some (old, now broken) crypto code that while not compiled
in Samba is best left out of our tarball to ease crypto audits.  It is also very
very out of date and is a slightly modified copy of something otherwise very
likely available on our supported host OSs.  It would be strange to say that
GnuTLS and dependencies are an acceptable burden to install but say zlib is
a step to far.

So it is removed from Samba's third_party with this commit.

The diff between zlib in Samba and official zlib 1.2.3 is included
in third_party/zlib/last-samba-from-1.2.3.diff

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
4 years agoPrevent samba-tool online backup crash
David Mulder [Tue, 6 Aug 2019 17:31:08 +0000 (11:31 -0600)]
Prevent samba-tool online backup crash

On some GPOs, getting a files ntacl throws an
NT_STATUS_ACCESS_DENIED. Catch and log the
failure when this happens.

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

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
4 years agoctdb-tcp: Mark node as disconnected if incoming connection goes away
Martin Schwenke [Tue, 13 Aug 2019 07:08:43 +0000 (17:08 +1000)]
ctdb-tcp: Mark node as disconnected if incoming connection goes away

To make it easy to pass the node data to the upcall, the private data
for ctdb_tcp_read_cb() needs to be changed from tnode to node.

RN: Avoid marking a node as connected before it can receive packets
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084

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): Fri Aug 16 22:50:35 UTC 2019 on sn-devel-184

4 years agoctdb-tcp: Only mark a node connected if both directions are up
Martin Schwenke [Fri, 9 Aug 2019 05:33:05 +0000 (15:33 +1000)]
ctdb-tcp: Only mark a node connected if both directions are up

Nodes are currently marked as up if the outgoing connection is
established.  However, if the incoming connection is not yet
established then this node could send a request where the replying
node can not queue its reply.  Wait until both directions are up
before marking a node as connected.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tcp: Create outbound queue when the connection becomes writable
Martin Schwenke [Thu, 15 Aug 2019 05:57:31 +0000 (15:57 +1000)]
ctdb-tcp: Create outbound queue when the connection becomes writable

Since commit ddd97553f0a8bfaada178ec4a7460d76fa21f079
ctdb_queue_send() doesn't queue a packet if the connection isn't yet
established (i.e. when fd == -1).  So, don't bother creating the
outbound queue during initialisation but create it when the connection
becomes writable.

Now the presence of the queue indicates that the outbound connection
is up.

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

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