]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
9 months agolibsmb: Fix trailing whitespace
Volker Lendecke [Wed, 25 Sep 2024 14:54:11 +0000 (16:54 +0200)] 
libsmb: Fix trailing whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolsasrv: Simplify dcesrv_lsa_AddRemoveAccountRights()
Volker Lendecke [Fri, 20 Sep 2024 13:46:01 +0000 (15:46 +0200)] 
lsasrv: Simplify dcesrv_lsa_AddRemoveAccountRights()

Use dom_sid_string_buf, no need to talloc.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolib: Simplify nybble_to_hex_*
Volker Lendecke [Tue, 10 Sep 2024 06:46:30 +0000 (08:46 +0200)] 
lib: Simplify nybble_to_hex_*

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agoldb: User hexchars_upper from replace.h
Volker Lendecke [Tue, 10 Sep 2024 08:02:04 +0000 (10:02 +0200)] 
ldb: User hexchars_upper from replace.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibreplace: Introduce hexchars_{upper|lower}
Volker Lendecke [Tue, 10 Sep 2024 06:45:31 +0000 (08:45 +0200)] 
libreplace: Introduce hexchars_{upper|lower}

We use that in quite a few places in our code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibcli: Convert an int to a size_t
Volker Lendecke [Tue, 15 Oct 2024 11:46:05 +0000 (13:46 +0200)] 
libcli: Convert an int to a size_t

More appropriate for an array length

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolib: Modernize a DEBUG
Volker Lendecke [Thu, 3 Oct 2024 09:04:15 +0000 (11:04 +0200)] 
lib: Modernize a DEBUG

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agoidl: Fix trailing whitespace
Volker Lendecke [Mon, 30 Sep 2024 10:55:25 +0000 (12:55 +0200)] 
idl: Fix trailing whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolib: simplify smbpasswd_sethexpwd() with hex_encode_buf()
Volker Lendecke [Fri, 20 Sep 2024 13:17:33 +0000 (15:17 +0200)] 
lib: simplify smbpasswd_sethexpwd() with hex_encode_buf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolib: simplify smbpasswd_gethexpwd() with strhex_to_str()
Volker Lendecke [Fri, 20 Sep 2024 13:14:48 +0000 (15:14 +0200)] 
lib: simplify smbpasswd_gethexpwd() with strhex_to_str()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibcli: Try to fix CID 1609583 Overflowed constant
Volker Lendecke [Mon, 4 Nov 2024 17:26:43 +0000 (18:26 +0100)] 
libcli: Try to fix CID 1609583 Overflowed constant

Coverity does not like the --i

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agovfs_fruit: Align a few integer types
Volker Lendecke [Mon, 4 Nov 2024 17:19:48 +0000 (18:19 +0100)] 
vfs_fruit: Align a few integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agovfs_fruit: Simplify filter_empty_rsrc_stream()
Volker Lendecke [Mon, 4 Nov 2024 17:17:16 +0000 (18:17 +0100)] 
vfs_fruit: Simplify filter_empty_rsrc_stream()

Inspired by Coverity finding CID 1609584 Overflowed constant -- not
sure it fixes it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibndr: Early overflow detection
Volker Lendecke [Mon, 30 Sep 2024 13:45:16 +0000 (15:45 +0200)] 
libndr: Early overflow detection

This is an addition without an overflow check. Do it right there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibndr: Simplify data flow in ndr_push_relative_ptr2
Volker Lendecke [Mon, 30 Sep 2024 10:07:30 +0000 (12:07 +0200)] 
libndr: Simplify data flow in ndr_push_relative_ptr2

Consolidate saving/replacing ndr->offset right around the push_uint32

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 months agolibgpo:admx:: s/the the\b/the/
Douglas Bagnall [Fri, 13 Sep 2024 02:23:12 +0000 (14:23 +1200)] 
libgpo:admx:: s/the the\b/the/

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Nov 12 09:21:53 UTC 2024 on atb-devel-224

9 months agolib/replace: memset_explicit() only takes three arguments
Thomas Klausner [Sun, 10 Nov 2024 07:37:17 +0000 (08:37 +0100)] 
lib/replace: memset_explicit() only takes three arguments

Signed-off-by: Thomas Klausner <wiz@gatalith.at>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 16:47:46 UTC 2024 on atb-devel-224

9 months agoWHATSNEW: Add client netlogon ping protocol parameter
Volker Lendecke [Fri, 8 Nov 2024 15:39:42 +0000 (16:39 +0100)] 
WHATSNEW: Add client netlogon ping protocol parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 15:15:29 UTC 2024 on atb-devel-224

9 months agotests: Run ad members with new netlogon ping protocol settings
Volker Lendecke [Wed, 6 Nov 2024 13:30:30 +0000 (14:30 +0100)] 
tests: Run ad members with new netlogon ping protocol settings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli: Make cldap_error_reply() static to cldap_server.c
Volker Lendecke [Fri, 1 Nov 2024 11:49:55 +0000 (12:49 +0100)] 
libcli: Make cldap_error_reply() static to cldap_server.c

Only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli: Remove two unused functions
Volker Lendecke [Fri, 1 Nov 2024 11:44:42 +0000 (12:44 +0100)] 
libcli: Remove two unused functions

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet: Simplify becomeDC
Volker Lendecke [Fri, 25 Oct 2024 12:53:09 +0000 (14:53 +0200)] 
libnet: Simplify becomeDC

Checking for "" does not need a call to strcmp

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agodocs: Fix a typo in a parameter file name
Volker Lendecke [Thu, 24 Oct 2024 14:44:09 +0000 (16:44 +0200)] 
docs: Fix a typo in a parameter file name

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli: Move "struct cldap_netlogon" definition to torture
Volker Lendecke [Fri, 1 Nov 2024 11:41:57 +0000 (12:41 +0100)] 
libcli: Move "struct cldap_netlogon" definition to torture

This structure is only used in torture/ldap/netlogon.c now for
historic reasons. Replacing it with something else would be the right
thing to do...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli: Remove cldap_netlogon() and friends
Volker Lendecke [Fri, 1 Nov 2024 11:39:58 +0000 (12:39 +0100)] 
libcli: Remove cldap_netlogon() and friends

Replaced with netlogon_pings()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotorture4: Replace direct netlogon ping calls with netlogon_pings()
Volker Lendecke [Fri, 1 Nov 2024 11:36:59 +0000 (12:36 +0100)] 
torture4: Replace direct netlogon ping calls with netlogon_pings()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotorture4: Add ldap.netlogon-ping test
Volker Lendecke [Fri, 1 Nov 2024 09:07:16 +0000 (10:07 +0100)] 
torture4: Add ldap.netlogon-ping test

This will supersede the direct cldap based netlogon tests

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotorture4: Use netlogon_pings() in rpc.lsa tests
Volker Lendecke [Wed, 30 Oct 2024 17:22:57 +0000 (18:22 +0100)] 
torture4: Use netlogon_pings() in rpc.lsa tests

Allow LDAPS netlogon ping

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotorture4: Use netlogon_pings_send/recv in bench-cldap
Volker Lendecke [Thu, 31 Oct 2024 17:05:00 +0000 (18:05 +0100)] 
torture4: Use netlogon_pings_send/recv in bench-cldap

This slightly changes behaviour: It uses separate client sockets per
ping instead of just one, but it allows to compare CLDAP with LDAP and
LDAPS (spoiler: LDAPS is *much* slower...)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Use netlogon_pings() in finddcs_cldap
Volker Lendecke [Tue, 29 Oct 2024 14:35:37 +0000 (15:35 +0100)] 
libnet4: Use netlogon_pings() in finddcs_cldap

Enable LDAPS lookups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Use netlogon_pings() in unbecome_dc
Volker Lendecke [Tue, 29 Oct 2024 12:06:13 +0000 (13:06 +0100)] 
libnet4: Use netlogon_pings() in unbecome_dc

Enable LDAPS lookups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Use netlogon_pings() in become_dc
Volker Lendecke [Tue, 29 Oct 2024 11:43:53 +0000 (12:43 +0100)] 
libnet4: Use netlogon_pings() in become_dc

Allow LDAPS netlogon pings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Use netlogon_pings() in findsite
Volker Lendecke [Tue, 29 Oct 2024 11:12:57 +0000 (12:12 +0100)] 
libnet4: Use netlogon_pings() in findsite

Enable LDAPS lookups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet: Initialize variables in libnet_FindSite()
Volker Lendecke [Mon, 28 Oct 2024 12:52:30 +0000 (13:52 +0100)] 
libnet: Initialize variables in libnet_FindSite()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet: Simplify error return in libnet_FindSite()
Volker Lendecke [Mon, 28 Oct 2024 07:58:54 +0000 (08:58 +0100)] 
libnet: Simplify error return in libnet_FindSite()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet: Save a few lines with talloc_move()
Volker Lendecke [Mon, 28 Oct 2024 07:55:33 +0000 (08:55 +0100)] 
libnet: Save a few lines with talloc_move()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Move check_cldap_reply_required_flags() to netlogon_ping.c
Volker Lendecke [Mon, 28 Oct 2024 14:01:57 +0000 (15:01 +0100)] 
libads: Move check_cldap_reply_required_flags() to netlogon_ping.c

netlogon_ping.c depends on it but itself has fewer dependencies than
cldap.c, so we can use it in more places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Simplify ads_fill_cldap_reply()
Volker Lendecke [Mon, 28 Oct 2024 12:20:56 +0000 (13:20 +0100)] 
libads: Simplify ads_fill_cldap_reply()

Both callers now guarantee via the filter in netlogon_pings() that the
reply contains DCs that have the required flags set. Remove those
checks from ads_fill_cldap_reply()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Pass "required_flags" through ads_cldap_netlogon_5()
Volker Lendecke [Mon, 28 Oct 2024 12:19:08 +0000 (13:19 +0100)] 
libads: Pass "required_flags" through ads_cldap_netlogon_5()

... down to netlogon_pings(). Passing 0 right now, this will change
for some callers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Pass "required_flags" through ads_cldap_netlogon()
Volker Lendecke [Mon, 28 Oct 2024 12:16:46 +0000 (13:16 +0100)] 
libads: Pass "required_flags" through ads_cldap_netlogon()

... down to netlogon_pings()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Make ads_cldap_netlogon() static
Volker Lendecke [Mon, 28 Oct 2024 11:08:42 +0000 (12:08 +0100)] 
libads: Make ads_cldap_netlogon() static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: remove cldap_multi_netlogon
Volker Lendecke [Fri, 25 Oct 2024 15:42:18 +0000 (17:42 +0200)] 
libads: remove cldap_multi_netlogon

Replaced by netlogon_pings()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibsmb: Use netlogon_pings() in dsgetdcname
Volker Lendecke [Mon, 28 Oct 2024 11:06:05 +0000 (12:06 +0100)] 
libsmb: Use netlogon_pings() in dsgetdcname

Use parallel requests and req_flags filtering provided by
netlogon_pings()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agokerberos: Use netlogon_pings()
Volker Lendecke [Fri, 25 Oct 2024 15:38:04 +0000 (17:38 +0200)] 
kerberos: Use netlogon_pings()

This also makes sure we've got a KDC via DS_KDC_REQUIRED

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agoldap: Use netlogon_pings
Volker Lendecke [Fri, 25 Oct 2024 15:25:13 +0000 (17:25 +0200)] 
ldap: Use netlogon_pings

This already requests the flags that ads_fill_cldap_reply() will later
check for, so netlogon_pings will only feed sufficient DCs into
ads_fill_cldap_reply.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agocldap: Use netlogon_pings()
Volker Lendecke [Fri, 25 Oct 2024 14:45:29 +0000 (16:45 +0200)] 
cldap: Use netlogon_pings()

Allow LDAPS for ads_cldap_netlogon()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibads: Add netlogon_pings()
Volker Lendecke [Thu, 24 Oct 2024 11:55:35 +0000 (13:55 +0200)] 
libads: Add netlogon_pings()

This encapsulates our logic that we send CLDAP requests on UDP/389,
sending them with 100msec timeouts until someone replies. It also
contains the code to do this over LDAP/389 or LDAPS/636.

It also contains code to filter for domain controller flags like
DS_ONLY_LDAP_NEEDED, this logic exists in several places right now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotldap: Add tldap_context_create_from_plain_stream()
Volker Lendecke [Thu, 31 Oct 2024 16:04:44 +0000 (17:04 +0100)] 
tldap: Add tldap_context_create_from_plain_stream()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agoparam: Add "client netlogon ping protocol"
Volker Lendecke [Thu, 24 Oct 2024 14:52:46 +0000 (16:52 +0200)] 
param: Add "client netlogon ping protocol"

Allow "net ads join" in environments where UDP/389 is blocked. Code
will follow.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolib: Add a few required includes
Volker Lendecke [Thu, 24 Oct 2024 14:15:55 +0000 (16:15 +0200)] 
lib: Add a few required includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agobuild: Remove the big samba3util dependency from TLDAP
Volker Lendecke [Mon, 28 Oct 2024 09:44:47 +0000 (10:44 +0100)] 
build: Remove the big samba3util dependency from TLDAP

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agobuild: Make util_tsock its own subsystem
Volker Lendecke [Mon, 28 Oct 2024 09:40:26 +0000 (10:40 +0100)] 
build: Make util_tsock its own subsystem

One step to strip TLDAP deps

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agoparam: Remove parameter "cldap port"
Volker Lendecke [Mon, 28 Oct 2024 12:46:20 +0000 (13:46 +0100)] 
param: Remove parameter "cldap port"

This was not used consistently across all of our code base, and I
don't see a reason why this should ever not be port 389.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agocldap: Make finddcs.out.netlogon a pointer
Volker Lendecke [Wed, 30 Oct 2024 10:10:28 +0000 (11:10 +0100)] 
cldap: Make finddcs.out.netlogon a pointer

struct netlogon_samlogon_response has subpointers, this patch enables
a proper talloc hierarchy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agocldap: Make cldap_netlogon.out.netlogon a pointer
Volker Lendecke [Wed, 30 Oct 2024 10:07:53 +0000 (11:07 +0100)] 
cldap: Make cldap_netlogon.out.netlogon a pointer

struct netlogon_samlogon_response has subpointers, this patch enables
a proper talloc hierarchy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolib: Fix trailing whitespace
Volker Lendecke [Wed, 30 Oct 2024 09:54:12 +0000 (10:54 +0100)] 
lib: Fix trailing whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agocldap: Remove cldap_netlogon->in.map_response
Volker Lendecke [Tue, 29 Oct 2024 08:02:19 +0000 (09:02 +0100)] 
cldap: Remove cldap_netlogon->in.map_response

We should not pass booleans down where the caller can do the same
thing with equal effort

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 08:01:43 +0000 (09:01 +0100)] 
libnet4: Call map_netlogon_samlogon_response directly

Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 08:00:34 +0000 (09:00 +0100)] 
libnet4: Call map_netlogon_samlogon_response directly

Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibnet4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 07:59:29 +0000 (08:59 +0100)] 
libnet4: Call map_netlogon_samlogon_response directly

Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agolibcli4: Call map_netlogon_samlogon_response directly
Volker Lendecke [Tue, 29 Oct 2024 07:57:53 +0000 (08:57 +0100)] 
libcli4: Call map_netlogon_samlogon_response directly

Avoid using a boolean flag passed down

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotorture4: Simplifiy [tcp|udp]_ldap_netlogon()
Volker Lendecke [Tue, 29 Oct 2024 07:55:13 +0000 (08:55 +0100)] 
torture4: Simplifiy [tcp|udp]_ldap_netlogon()

Both callers set "map_response=true", so we don't need that flag here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotldap_tls: Remove tldap_[gs]et_starttls_needed()
Volker Lendecke [Thu, 7 Nov 2024 10:17:12 +0000 (11:17 +0100)] 
tldap_tls: Remove tldap_[gs]et_starttls_needed()

The caller setting up a tldap connection is aware of whether to use
starttls, which is one single ldap extended operation before the tls
crypto starts. There is no complex logic behind this that is
worthwhile to be hidden behind a flag and an API. If there was more to
it than just a simple call to tldap_extended(), I would all be for
passing down that flag, but for this case I would argue the logic
after this patch is simpler.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotldap_tls: Move creation of tls_params out of tldap_tls_connect()
Volker Lendecke [Thu, 7 Nov 2024 09:53:48 +0000 (10:53 +0100)] 
tldap_tls: Move creation of tls_params out of tldap_tls_connect()

Soon we will have a tldap user which does not want to verify the
certs. Instead of passing another boolean down, hand in pre-created
tstream_tls_params.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agotstream_tls: Add tstream_tls_params_peer_name()
Volker Lendecke [Thu, 7 Nov 2024 09:48:52 +0000 (10:48 +0100)] 
tstream_tls: Add tstream_tls_params_peer_name()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 months agosmbtorture: use torture_assert_ntstatus_equal_goto() in CHECK_STATUS() in unlink.c
Ralph Boehme [Sat, 2 Nov 2024 14:49:41 +0000 (16:49 +0200)] 
smbtorture: use torture_assert_ntstatus_equal_goto() in CHECK_STATUS() in unlink.c

fixup

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Nov 11 14:01:18 UTC 2024 on atb-devel-224

9 months agosmbtorture: move hardlink test in test_ntrename() to its own test
Ralph Boehme [Fri, 8 Nov 2024 13:13:28 +0000 (14:13 +0100)] 
smbtorture: move hardlink test in test_ntrename() to its own test

Some filesystems may not support hardlinks.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
9 months agosmbtorture: remove more allocation size checks
Ralph Boehme [Fri, 8 Nov 2024 12:09:15 +0000 (13:09 +0100)] 
smbtorture: remove more allocation size checks

If the requested allocation size was 0, the resulting allocation size may be
larger due to xattrs and other filesystem dependent factors.

Cf commits fba4b290856faaf17305103efc65f6383ea4f61c and
55b2f247f9ba56516efba52481418966a777343e.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
9 months agolib/util: Include grp.h for setgroups during autoconf
Samuel Thibault [Tue, 5 Nov 2024 23:57:37 +0000 (00:57 +0100)] 
lib/util: Include grp.h for setgroups during autoconf

Otherwise setresuid and friends don't get detected on GNU/Hurd because the
inclusion of <grp.h> is missing for the declaration of setgroups.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 12:51:17 UTC 2024 on atb-devel-224

9 months agoctdb: Include replace.h for PATH_MAX
Samuel Thibault [Sun, 10 Nov 2024 00:59:39 +0000 (01:59 +0100)] 
ctdb: Include replace.h for PATH_MAX

Fixes build on GNU/Hurd.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 11 10:28:24 UTC 2024 on atb-devel-224

9 months agoDescribe implication of upstream ICU-22610
Earl Chew [Fri, 27 Sep 2024 13:50:31 +0000 (06:50 -0700)] 
Describe implication of upstream ICU-22610

Add commentary to link commit 86c7688 (MR !3447) to the upstream
fix for ICU-22610 in case there is subsequent breakage.

Signed-off-by: Earl Chew <earl_chew@yahoo.com>
Reviewed-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 Nov  8 00:20:38 UTC 2024 on atb-devel-224

9 months agosmbd: initialize delete_on_close in smbd_smb2_setinfo_lease_break_fsp_check()
Ralph Boehme [Thu, 7 Nov 2024 13:11:48 +0000 (14:11 +0100)] 
smbd: initialize delete_on_close in smbd_smb2_setinfo_lease_break_fsp_check()

CID 1634488:  Uninitialized variables  (UNINIT)

/source3/smbd/smb2_setinfo.c: 475 in smbd_smb2_setinfo_lease_break_fsp_check()
469      &delete_on_close);
470      if (tevent_req_nterror(req, status)) {
471      return;
472      }
473      }
474
>>>     CID 1634488:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "delete_on_close".
475      if (!rename && !delete_on_close) {
476      return;
477      }
478
479      state->lck = get_existing_share_mode_lock(state, fsp->file_id);
480      if (state->lck == NULL) {

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov  7 17:21:53 UTC 2024 on atb-devel-224

9 months agolibcli/auth: make use of netlogon_creds_cli_check_transport() in more places
Stefan Metzmacher [Wed, 6 Nov 2024 16:18:58 +0000 (17:18 +0100)] 
libcli/auth: make use of netlogon_creds_cli_check_transport() in more places

This was somehow missing in commit
7a5ad9f64a905f5744430c6e0796c646baf9432e

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

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): Thu Nov  7 09:14:33 UTC 2024 on atb-devel-224

9 months agoctdb-scripts: Add configuration variable CTDB_KILLTCP_USE_SS_KILL
Martin Schwenke [Tue, 22 Aug 2023 02:13:44 +0000 (12:13 +1000)] 
ctdb-scripts: Add configuration variable CTDB_KILLTCP_USE_SS_KILL

This allows CTDB to be configured to use "ss -K" to reset TCP
connections on "releaseip".  This is only supported when the kernel is
configured with CONFIG_INET_DIAG_DESTROY enabled.

From the documentation:

   ss -K has been supported in ss since iproute 4.5 in March 2016 and
   in the Linux kernel since 4.4 in December 2015.  However, the
   required kernel configuration item CONFIG_INET_DIAG_DESTROY is
   disabled by default.  Although enabled in Debian kernels since
   ~2017 and in Ubuntu since at least 18.04,, this has only recently
   been enabled in distributions such as RHEL.  There seems to be no
   way, including running ss -K, to determine if this is supported, so
   use of this feature needs to be configurable.  When available, it
   should be the fastest, most reliable way of killing connections.

For RHEL and derivatives, this was enabled as follows:

* RHEL 8 via https://bugzilla.redhat.com/show_bug.cgi?id=2230213,
  arriving in version kernel-4.18.0-513.5.1.el8_9

* RHEL 9 via https://issues.redhat.com/browse/RHEL-212, arriving in
  kernel-5.14.0-360.el9

Enabling this option results in a small behaviour change because ss -K
always does a 2-way kill (i.e. it also sends a RST to the client).
Only a 1-way kill is done for SMB connections when ctdb_killtcp is
used - the reasons for this are shrouded in history and the 2-way kill
seems to work fine.

For the summary that is logged, when CTDB_KILLTCP_USE_SS_KILL is "yes"
or "try", always log the method used, even the fallback to
ctdb_killtcp.  However, when set to "no", maintain the existing
output.

The decision to use -K rather than --kill is because short options are
trivial to implement in test stubs.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Nov  7 00:12:34 UTC 2024 on atb-devel-224

9 months agoctdb-scripts: Factor out function kill_tcp_summarise()
Martin Schwenke [Fri, 25 Aug 2023 00:00:57 +0000 (10:00 +1000)] 
ctdb-scripts: Factor out function kill_tcp_summarise()

This will be used in a slightly different context in a subsequent
commit.  In that case, the number of killed connections will be passed
instead of the total number of connections, so support this here via
different modes instead of churning later.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Track connections for all ports for public IPs
Martin Schwenke [Mon, 23 Oct 2023 03:17:36 +0000 (14:17 +1100)] 
ctdb-scripts: Track connections for all ports for public IPs

Currently TCP ports like NFS lock manager are not tracked.  It is
easier to track all connections than to add a configuration system to
try to track specified ports, so do that.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Get connections after tickle list
Martin Schwenke [Mon, 30 Sep 2024 00:50:00 +0000 (10:50 +1000)] 
ctdb-scripts: Get connections after tickle list

Running ss to get current connections before running ctdb gettickles
means the ss output might be out of date when the 2 lists are
compared.  Some tickles might have been added after ss was run by some
other means (e.g. SMB tickles, added internally) and they would be
deleted according to the stale ss output.

This isn't currently a problem because update_tickles() is currently
only called with port 2049, so all tickles are managed by this code.
That will change in a subsequent commit.

Changing the order means the reverse problem can occur, where
update_tickles() attempts to delete an already deleted tickle.  That
may happen occasionally but is harmless because it doesn't result in
missing information.  It (currently) just causes a message to be
logged at DEBUG level.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Move connection tracking to 10.interface
Martin Schwenke [Mon, 23 Oct 2023 03:05:21 +0000 (14:05 +1100)] 
ctdb-scripts: Move connection tracking to 10.interface

This should really be done for all connections to public IP addresses.
Leave the port number there for now - this is just the first step.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Use ctdb_connection_same() to simplify
Martin Schwenke [Mon, 30 Sep 2024 02:21:59 +0000 (12:21 +1000)] 
ctdb-server: Use ctdb_connection_same() to simplify

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb: Don't leak a pointer on talloc_realloc failure
Volker Lendecke [Wed, 6 Nov 2024 10:51:04 +0000 (11:51 +0100)] 
ctdb: Don't leak a pointer on talloc_realloc failure

We should not directly overwrite the pointer we are realloc'ing

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agoctdb: Save a few lines with talloc_zero()
Volker Lendecke [Wed, 6 Nov 2024 10:49:36 +0000 (11:49 +0100)] 
ctdb: Save a few lines with talloc_zero()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 months agoctdb-server: Remove duplicate logic
Martin Schwenke [Mon, 30 Sep 2024 02:40:57 +0000 (12:40 +1000)] 
ctdb-server: Remove duplicate logic

Initialise the pointer to NULL and fall through to let
talloc_realloc() do the allocation.  talloc_realloc() does the right
thing with a NULL pointer...

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Handle pre-existing connection first
Martin Schwenke [Mon, 30 Sep 2024 02:37:57 +0000 (12:37 +1000)] 
ctdb-server: Handle pre-existing connection first

This is cheap when tcparray is NULL and let's the code that now
follows be simplified.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Drop an unnecessary variable
Martin Schwenke [Mon, 30 Sep 2024 02:34:18 +0000 (12:34 +1000)] 
ctdb-server: Drop an unnecessary variable

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Drop a log message to DEBUG level
Martin Schwenke [Mon, 30 Sep 2024 02:30:13 +0000 (12:30 +1000)] 
ctdb-server: Drop a log message to DEBUG level

This is harmless, so it doesn't generally need to be logged.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-server: Clean up connection tracking functions
Martin Schwenke [Mon, 30 Sep 2024 02:22:46 +0000 (12:22 +1000)] 
ctdb-server: Clean up connection tracking functions

Apply README.Coding, modernise logging, pre-render connection as a
string for logging, switch terminology from "tickle" to "connection",
tidy up comments.

No changes in functionality.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Use ss -H option to simplify
Martin Schwenke [Mon, 16 Sep 2024 02:26:53 +0000 (12:26 +1000)] 
ctdb-scripts: Use ss -H option to simplify

This option has been available since ~2018 and has been implemented in
the stub since then.  I guess we didn't use it because CentOS 7?

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Remove superseded compatibility code
Martin Schwenke [Mon, 23 Oct 2023 03:23:45 +0000 (14:23 +1100)] 
ctdb-scripts: Remove superseded compatibility code

Since commit 224e99804efef960ef4ce2ff2f4f6dced1e74146, square brackets
have been parsed by daemon and tool code, so drop the compatibility
code from here.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: update_tickles() should use the public IPs cache
Martin Schwenke [Thu, 19 Sep 2024 04:32:46 +0000 (14:32 +1000)] 
ctdb-scripts: update_tickles() should use the public IPs cache

This avoids duplicating logic.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Don't list connections when not hosting IPs
Martin Schwenke [Thu, 19 Sep 2024 03:52:48 +0000 (13:52 +1000)] 
ctdb-scripts: Don't list connections when not hosting IPs

With an empty IP filter, all incoming connections to port 2049 will be
listed, not just those to public IP addresses.  This causes error
messages like the following to be logged:

  ctdb-eventd[...]: 60.nfs: Failed to add 1 tickles

since the connection being added seems to be for a random NFS mount
that doesn't use a public IP addresses.

This has been a problem for a long time (probably since commit
04fe9e20749985c71fef1bce7f6e4c439fe11c81 in 2015).  It isn't currently
a huge deal because it only affects NFS connections.  However, this
code will soon be used to track connections to public IP addresses on
all ports.  This would result in a constant stream of log messages,
since there will always be some active connections.

The theory behind the fix is that if a node hosts no public IPs then
it should have no relevant connections and has no business changing
the list of registered tickles.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"
Martin Schwenke [Fri, 13 Sep 2024 06:21:24 +0000 (16:21 +1000)] 
ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn"

Massage a couple of lines manually so they're formatted sanely given
the new indentation.   Re-run shfmt to ensure no further changes.

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-doc: Improve 10.interface documentation and comments
Martin Schwenke [Tue, 22 Aug 2023 02:12:50 +0000 (12:12 +1000)] 
ctdb-doc: Improve 10.interface documentation and comments

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-tests: Fix ss -a not supported
Martin Schwenke [Mon, 16 Sep 2024 02:32:02 +0000 (12:32 +1000)] 
ctdb-tests: Fix ss -a not supported

This is currently just a series of typos.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-tests: Drop unsupported long options from ss stub usage
Martin Schwenke [Mon, 16 Sep 2024 02:19:00 +0000 (12:19 +1000)] 
ctdb-tests: Drop unsupported long options from ss stub usage

These have not been supported since commit
896c77df1ce2645c6dd7898b59ea802e204dc7d9 in 2018.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agoctdb-tests: Ensure ss stub handles square brackets around addresses
Martin Schwenke [Fri, 27 Oct 2023 00:06:23 +0000 (11:06 +1100)] 
ctdb-tests: Ensure ss stub handles square brackets around addresses

It isn't unreasonable for unit test cases to use square brackets in
their input.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
9 months agolibndr: specialise ndr_token_find() for key pointer comparison
Douglas Bagnall [Thu, 17 Oct 2024 02:54:22 +0000 (15:54 +1300)] 
libndr: specialise ndr_token_find() for key pointer comparison

Usually we are doing a pointer comparison. Because we are doing it
in a tight loop, the cost of the comparison function call can be
noticeable.

There is a fuzz case that before f43ae1ab1a8803d8c5ad4e5f3dad63ccbe91aa54
took 3.957s, after that took 6.438s, and now again takes 3.960s.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Nov  6 12:06:04 UTC 2024 on atb-devel-224

9 months agoldb:test:lmdb_free_list: s/the the/to the/ in comment
Douglas Bagnall [Fri, 13 Sep 2024 02:31:54 +0000 (14:31 +1200)] 
ldb:test:lmdb_free_list: s/the the/to the/ in comment

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos4:reg: s/the there/there/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:31:09 +0000 (14:31 +1200)] 
s4:reg: s/the there/there/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos4: s/the the\b/the/ in miscellaneous comments
Douglas Bagnall [Fri, 13 Sep 2024 02:30:42 +0000 (14:30 +1200)] 
s4: s/the the\b/the/ in miscellaneous comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 months agos4:ldb_mods:group_audit: s/the the/the/ in comments
Douglas Bagnall [Fri, 13 Sep 2024 02:28:52 +0000 (14:28 +1200)] 
s4:ldb_mods:group_audit: s/the the/the/ in comments

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>