]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
5 hours agosmbd: Make reference_smb_fname_fsp_link() static master
Volker Lendecke [Fri, 19 Dec 2025 13:27:41 +0000 (14:27 +0100)] 
smbd: Make reference_smb_fname_fsp_link() static

Only referenced in files.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Aug  3 10:08:42 UTC 2026 on atb-devel-224

6 hours agospnego: Use struct initialization instead of talloc_zero
Volker Lendecke [Fri, 3 Jul 2026 14:02:45 +0000 (16:02 +0200)] 
spnego: Use struct initialization instead of talloc_zero

Also remove some NULL initializations that are implicitly done. I
know, cosmetic change, I like it better this way...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolibcli: Slightly streamline sddl_flags_to_string()
Volker Lendecke [Thu, 30 Jul 2026 12:25:54 +0000 (14:25 +0200)] 
libcli: Slightly streamline sddl_flags_to_string()

Only check for talloc failure once with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agospnego: We have gensec_get_unparsed_target_principal() now
Volker Lendecke [Mon, 6 Jul 2026 11:06:40 +0000 (13:06 +0200)] 
spnego: We have gensec_get_unparsed_target_principal() now

It does exactly what the callers did before this patch.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agospnego: Remove a pointless return;
Volker Lendecke [Fri, 3 Jul 2026 10:00:31 +0000 (12:00 +0200)] 
spnego: Remove a pointless return;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agospnego: Doesn't need base64.h
Volker Lendecke [Fri, 3 Jul 2026 15:54:13 +0000 (17:54 +0200)] 
spnego: Doesn't need base64.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Streamline a struct assignment
Volker Lendecke [Thu, 2 Jul 2026 11:40:04 +0000 (13:40 +0200)] 
lib: Streamline a struct assignment

No need to do the struct assignment and then modify the struct in a separate
step.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agogensec: Simplify domain match check
Volker Lendecke [Mon, 6 Jul 2026 12:02:24 +0000 (14:02 +0200)] 
gensec: Simplify domain match check

We don't have to look for our domain twice, once for the check and
once for the DBG_NOTICE.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agogensec: Declare vars closer to their use
Volker Lendecke [Mon, 6 Jul 2026 11:59:26 +0000 (13:59 +0200)] 
gensec: Declare vars closer to their use

We don't need "workstation" and "domain" in the client case.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolibcli: Use #defines instead of magic numbers
Volker Lendecke [Thu, 30 Jul 2026 11:39:33 +0000 (13:39 +0200)] 
libcli: Use #defines instead of magic numbers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolibcli: Fix whitespace
Volker Lendecke [Thu, 30 Jul 2026 11:40:36 +0000 (13:40 +0200)] 
libcli: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agontlmssp: Tiny simplification of gensec_ntlmssp_server_negotiate()
Volker Lendecke [Mon, 6 Jul 2026 12:13:37 +0000 (14:13 +0200)] 
ntlmssp: Tiny simplification of gensec_ntlmssp_server_negotiate()

Do an early return instead of an else. While there, modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agogensec: Add GENSEC_OID_NEGOEX
Volker Lendecke [Thu, 30 Jul 2026 10:59:15 +0000 (12:59 +0200)] 
gensec: Add GENSEC_OID_NEGOEX

Unused so far, bug so is GENSEC_OID_KERBEROS5_USER2USER

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agontlmssp: Avoid an "else", we return early
Volker Lendecke [Fri, 3 Jul 2026 16:11:14 +0000 (18:11 +0200)] 
ntlmssp: Avoid an "else", we return early

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Make asn1_peek() static
Volker Lendecke [Mon, 26 Jan 2026 10:56:45 +0000 (11:56 +0100)] 
lib: Make asn1_peek() static

Only used in asn1.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agogensec: Fix a copy&paste error
Volker Lendecke [Mon, 6 Jul 2026 10:58:46 +0000 (12:58 +0200)] 
gensec: Fix a copy&paste error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agogensec: Fix a use-after-free error in gensec_external
Volker Lendecke [Mon, 6 Jul 2026 11:34:11 +0000 (13:34 +0200)] 
gensec: Fix a use-after-free error in gensec_external

.length is 0, but the pointer we hand out will be != NULL but free'ed
in the tevent_req_received()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agorpcclient: Align a few integer types
Volker Lendecke [Sat, 11 Jul 2026 11:06:26 +0000 (13:06 +0200)] 
rpcclient: Align a few integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agorpcclient: Use #define
Volker Lendecke [Sat, 11 Jul 2026 10:59:38 +0000 (12:59 +0200)] 
rpcclient: Use #define

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agosmbclient3: Slightly simplify target IP handling
Volker Lendecke [Mon, 11 May 2026 07:12:44 +0000 (09:12 +0200)] 
smbclient3: Slightly simplify target IP handling

Instead of using ?: in a few places, introduce a pointer variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolibsmb: dsgetdcname.h requires NTSTATUS
Volker Lendecke [Tue, 10 Mar 2026 10:34:17 +0000 (11:34 +0100)] 
libsmb: dsgetdcname.h requires NTSTATUS

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agosmbclient3: Remove an unused variable
Volker Lendecke [Mon, 11 May 2026 06:56:48 +0000 (08:56 +0200)] 
smbclient3: Remove an unused variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agosmbd: Fix whitespace, modernize a DEBUG
Volker Lendecke [Tue, 26 May 2026 12:59:28 +0000 (14:59 +0200)] 
smbd: Fix whitespace, modernize a DEBUG

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agodns_server: Use talloc_realloc_zero() to avoid explicit ZERO_STRUCT()
Volker Lendecke [Wed, 17 Jun 2026 06:02:35 +0000 (08:02 +0200)] 
dns_server: Use talloc_realloc_zero() to avoid explicit ZERO_STRUCT()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agovfs_cap: Rename confusing "path" parameter
Volker Lendecke [Mon, 22 Jun 2026 15:25:19 +0000 (17:25 +0200)] 
vfs_cap: Rename confusing "path" parameter

This is the xattr name, not the path

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Make signed/unsigned conversion explicit in asn1_peek()
Volker Lendecke [Tue, 21 Jul 2026 10:38:17 +0000 (12:38 +0200)] 
lib: Make signed/unsigned conversion explicit in asn1_peek()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Make signed/unsigned conversion explicit in asn1_write()
Volker Lendecke [Tue, 21 Jul 2026 10:31:38 +0000 (12:31 +0200)] 
lib: Make signed/unsigned conversion explicit in asn1_write()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Add central error: exit to asn1_write()
Volker Lendecke [Tue, 21 Jul 2026 10:27:42 +0000 (12:27 +0200)] 
lib: Add central error: exit to asn1_write()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agoldap_server: Fix -Wswitch in case we want to implement SICILY
Volker Lendecke [Tue, 21 Jul 2026 09:50:10 +0000 (11:50 +0200)] 
ldap_server: Fix -Wswitch in case we want to implement SICILY

See [MS-ADTS] 5.1.1.1.3 Sicily Authentication

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: One last check before subtraction in asn1_tag_remaining()
Volker Lendecke [Tue, 21 Jul 2026 09:17:33 +0000 (11:17 +0200)] 
lib: One last check before subtraction in asn1_tag_remaining()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Make "remaining" unsigned in asn1_tag_remaining()
Volker Lendecke [Tue, 21 Jul 2026 09:14:33 +0000 (11:14 +0200)] 
lib: Make "remaining" unsigned in asn1_tag_remaining()

We checked it can't go negative, avoid signed/unsigned comparisons

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Check there's data remaining before calculating how much
Volker Lendecke [Tue, 21 Jul 2026 09:06:53 +0000 (11:06 +0200)] 
lib: Check there's data remaining before calculating how much

Better make sure the subtraction does not go negative before we do it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Add some consistency check to asn1_tag_remaining()
Volker Lendecke [Tue, 21 Jul 2026 09:03:59 +0000 (11:03 +0200)] 
lib: Add some consistency check to asn1_tag_remaining()

We can't allow "ofs" to be smaller than "nesting->start". This
assumption is implicitly valid, but better be safe than sorry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Simplify asn1_tag_remaining()
Volker Lendecke [Tue, 21 Jul 2026 08:52:55 +0000 (10:52 +0200)] 
lib: Simplify asn1_tag_remaining()

Introduce common error exit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agolib: Simplify libnet_vampire_cb_apply_schema()
Volker Lendecke [Wed, 15 Jul 2026 11:02:39 +0000 (13:02 +0200)] 
lib: Simplify libnet_vampire_cb_apply_schema()

Use talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agorpc_server: Simplify dcesrv_samr_GetAliasMembership()
Volker Lendecke [Wed, 15 Jul 2026 11:00:27 +0000 (13:00 +0200)] 
rpc_server: Simplify dcesrv_samr_GetAliasMembership()

Use talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agorpcclient: Fix handling of -1 return from tsocket_address_bsd_sockaddr
Volker Lendecke [Mon, 13 Jul 2026 21:55:10 +0000 (23:55 +0200)] 
rpcclient: Fix handling of -1 return from tsocket_address_bsd_sockaddr

socklen_t can be unsigned

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agonetlogond: Fix a typo
Volker Lendecke [Sun, 12 Jul 2026 08:32:52 +0000 (10:32 +0200)] 
netlogond: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agopdb_samba_dsdb: Simplify pdb_samba_dsdb_get_domain_info()
Volker Lendecke [Sun, 12 Jul 2026 08:01:45 +0000 (10:01 +0200)] 
pdb_samba_dsdb: Simplify pdb_samba_dsdb_get_domain_info()

"dom_res" is a talloc child of "info"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agopdb_samba_dsdb: Add a talloc failure check
Volker Lendecke [Sun, 12 Jul 2026 08:01:00 +0000 (10:01 +0200)] 
pdb_samba_dsdb: Add a talloc failure check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agopdb_samba_dsdb: We should not run with a zero domain guid
Volker Lendecke [Sun, 12 Jul 2026 07:59:38 +0000 (09:59 +0200)] 
pdb_samba_dsdb: We should not run with a zero domain guid

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agopdb_samba_dsdb: Simplify pdb_samba_dsdb_search_filter() with a central exit
Volker Lendecke [Sun, 12 Jul 2026 07:38:19 +0000 (09:38 +0200)] 
pdb_samba_dsdb: Simplify pdb_samba_dsdb_search_filter() with a central exit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agopdb_samba_dsdb: Fix an error return
Volker Lendecke [Sun, 12 Jul 2026 07:36:28 +0000 (09:36 +0200)] 
pdb_samba_dsdb: Fix an error return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
6 hours agopdb_samba_dsdb: talloc_stackframe() panics on failure
Volker Lendecke [Sun, 12 Jul 2026 07:35:49 +0000 (09:35 +0200)] 
pdb_samba_dsdb: talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agos4:libcli/resolve: let lpcfg_resolve_context() take an explicit mem_ctx gitlab/master
Stefan Metzmacher [Thu, 30 Jul 2026 19:01:09 +0000 (21:01 +0200)] 
s4:libcli/resolve: let lpcfg_resolve_context() take an explicit mem_ctx

This avoids memory leaks in various places.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-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): Sat Aug  1 09:11:02 UTC 2026 on atb-devel-224

2 days agos4:py_net: make use of self->libnet_ctx->resolve_ctx
Stefan Metzmacher [Thu, 30 Jul 2026 18:58:18 +0000 (20:58 +0200)] 
s4:py_net: make use of self->libnet_ctx->resolve_ctx

There's no need to call lpcfg_resolve_context() every time again.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 days agoctdb-common: Align integer types
Martin Schwenke [Thu, 30 Jul 2026 04:49:16 +0000 (14:49 +1000)] 
ctdb-common: Align integer types

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Jul 31 00:48:24 UTC 2026 on atb-devel-224

3 days agoctdb-common: Avoid Coverity 1697470/1697471
Martin Schwenke [Thu, 30 Jul 2026 02:21:10 +0000 (12:21 +1000)] 
ctdb-common: Avoid Coverity 1697470/1697471

These are listed as: Memory - corruptions (OVERRUN)

While sockaddr_ll only has 8 octets for sll_addr, a sockaddr_storage
is being intentionally used here to provide additional space.  So, the
overrun is a technicality and there is no corruption.

However, the code is incorrect because it does overrun sll_addr[] in
sockaddr_ll.  The assignments into out-of-bounds indices also cause
the -O3 build fail.

So, use an extra variable to point to where sll_addr should start in a
sockaddr_storage and index from there.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 days agoctdb-tests: Add tests for build of IPv6 link-level multicast address
Martin Schwenke [Thu, 30 Jul 2026 03:27:24 +0000 (13:27 +1000)] 
ctdb-tests: Add tests for build of IPv6 link-level multicast address

This is mainly to guard against regressions in known working code.
Test before the changes, test again afterwards...

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 days agotevent: version 0.17.2 tevent-0.17.2
Stefan Metzmacher [Fri, 20 Mar 2026 09:55:08 +0000 (10:55 +0100)] 
tevent: version 0.17.2

* let tevent_common_have_events() ignore fd events without active flags,
  in order to avoid tevent_loop_wait() to loop forever with only
  such events.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 30 19:53:15 UTC 2026 on atb-devel-224

3 days agotevent: ignore fd events without flags in tevent_common_have_events()
Stefan Metzmacher [Fri, 20 Mar 2026 09:51:42 +0000 (10:51 +0100)] 
tevent: ignore fd events without flags in tevent_common_have_events()

Allow callers to use tevent_add_fd() with flags=0 in order
to allocate the memory, but without waiting for any event.

This should not cause tevent_loop_wait() to loop forever
if such an fd event is the only event.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 days agolib: Fix undefined behaviour at fork time in pthreadpool
Volker Lendecke [Tue, 28 Jul 2026 11:25:43 +0000 (13:25 +0200)] 
lib: Fix undefined behaviour at fork time in pthreadpool

If a pthread times out at the same time with a fork, ETIMEDOUT is
overwritten and not being taken care of. This means that we can race
with the forking thread destroying pool->condvar in the next round of
the thread's while(1) loop. pthread_cond_wait() on a condition
variable that has been destroyed is not a good idea.

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

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): Thu Jul 30 17:51:29 UTC 2026 on atb-devel-224

4 days agorpc_server: Simplify dns_split_node_name()
Volker Lendecke [Wed, 15 Jul 2026 10:58:02 +0000 (12:58 +0200)] 
rpc_server: Simplify dns_split_node_name()

Use talloc_asprintf_addsep()

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): Thu Jul 30 14:14:44 UTC 2026 on atb-devel-224

4 days agovfs_ceph_rgw: Simplify normalise_name()
Volker Lendecke [Wed, 15 Jul 2026 10:22:24 +0000 (12:22 +0200)] 
vfs_ceph_rgw: Simplify normalise_name()

Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agosmbd: Simplify msdfs_link_string()
Volker Lendecke [Wed, 15 Jul 2026 10:12:21 +0000 (12:12 +0200)] 
smbd: Simplify msdfs_link_string()

Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agosmbd: Simplify full_path_extend()
Volker Lendecke [Wed, 15 Jul 2026 10:10:42 +0000 (12:10 +0200)] 
smbd: Simplify full_path_extend()

Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agoldb: ldb_dn_get_extended_linearized()
Volker Lendecke [Wed, 15 Jul 2026 10:06:40 +0000 (12:06 +0200)] 
ldb: ldb_dn_get_extended_linearized()

Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agoldb: Slightly simplify ldb_dn_get_extended_linearized()
Volker Lendecke [Tue, 14 Jul 2026 19:55:49 +0000 (21:55 +0200)] 
ldb: Slightly simplify ldb_dn_get_extended_linearized()

Return early with dn->ext_comp_num==0, no need to check further down again.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agoldb: Simplify ldif_write_prefixMap()
Volker Lendecke [Wed, 15 Jul 2026 10:04:45 +0000 (12:04 +0200)] 
ldb: Simplify ldif_write_prefixMap()

Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agoldb: Fix ldif_write_prefixMap()
Volker Lendecke [Wed, 15 Jul 2026 10:03:51 +0000 (12:03 +0200)] 
ldb: Fix ldif_write_prefixMap()

talloc_asprintf_addbuf() deals well with allocation failure, but we
need to check failure after the string has been set up.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agoctdb: Simplify compact_args()
Volker Lendecke [Wed, 15 Jul 2026 10:01:25 +0000 (12:01 +0200)] 
ctdb: Simplify compact_args()

Use talloc_asprintf_addsep()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agotalloc: Add talloc_asprintf_addsep() talloc-2.5.0
Volker Lendecke [Wed, 15 Jul 2026 09:58:55 +0000 (11:58 +0200)] 
talloc: Add talloc_asprintf_addsep()

See the comment in talloc.h for an explanation.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 days agosmbstatus: Split brlocks logic into collect and dump phases
Shachar Sharon [Mon, 23 Mar 2026 09:47:33 +0000 (11:47 +0200)] 
smbstatus: Split brlocks logic into collect and dump phases

Split the logic of 'smbstatus --byterange' into two phases:

1) Collect locks-info into in-memory representation (linked-list) under
   lock of 'locking.tdb'.

2) Print-out (text or json) locks-info _after_ releasing this lock.

This split-logic is needed to avoid deadlock with smbd; in particular,
cases where the output of 'smbstatus -B' is piped-out into another
process, the primary lock may be held for long duration due to blocked
stdout on smbstatus side, thus causing starvation on smbd side.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jul 30 12:41:51 UTC 2026 on atb-devel-224

5 days agos4:torture/smb2: split out smb2.persistent-open-reconnect-contended
Stefan Metzmacher [Fri, 24 Jul 2026 07:04:29 +0000 (09:04 +0200)] 
s4:torture/smb2: split out smb2.persistent-open-reconnect-contended

This means the rule in selftest/skip actually works.

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): Wed Jul 29 08:33:12 UTC 2026 on atb-devel-224

5 days agos3:selftest: use CLUSTERED_PERSISTENT_TESTS = smbtorture4_testsuites("smb2.persistent")
Stefan Metzmacher [Fri, 24 Jul 2026 07:40:22 +0000 (09:40 +0200)] 
s3:selftest: use CLUSTERED_PERSISTENT_TESTS = smbtorture4_testsuites("smb2.persistent")

This is better than list tests manually, so new tests will
be added automatically.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 days agos3:selftest: run all smb2.persistent tests against //fileserver/ca_fo_max_rwh
Stefan Metzmacher [Fri, 24 Jul 2026 07:38:14 +0000 (09:38 +0200)] 
s3:selftest: run all smb2.persistent tests against //fileserver/ca_fo_max_rwh

This makes sure new tests will by default against a useful
share.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 days agoCVE-2026-58222: s4:ldap_server: don't allow untrusted compare requests for confidenti...
Stefan Metzmacher [Wed, 24 Jun 2026 12:42:11 +0000 (14:42 +0200)] 
CVE-2026-58222: s4:ldap_server: don't allow untrusted compare requests for confidential attributes

This means we apply acl checks against the search filter similar
to normal ldb searches.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Tue Jul 28 17:02:13 UTC 2026 on atb-devel-224

5 days agoCVE-2026-58221: s4:dsdb: let rootdse_filter_operations() reject untrusted operations...
Stefan Metzmacher [Wed, 24 Jun 2026 12:01:32 +0000 (14:01 +0200)] 
CVE-2026-58221: s4:dsdb: let rootdse_filter_operations() reject untrusted operations on special DNs

Without this authenticated (also non-admin) users write internal meta
data leading to admin privileges.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 days agoCVE-2026-58221: s4:dsdb: provide dsdb_audit_{log_attributes,operation_human_readable...
Stefan Metzmacher [Mon, 29 Jun 2026 17:09:28 +0000 (19:09 +0200)] 
CVE-2026-58221: s4:dsdb: provide dsdb_audit_{log_attributes,operation_human_readable}() functions

They are useful outside of audit_log.c soon.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
5 days agoCVE-2026-58218: dns_server: Only add a tkey after successful authentication
Volker Lendecke [Wed, 17 Jun 2026 06:58:40 +0000 (08:58 +0200)] 
CVE-2026-58218: dns_server: Only add a tkey after successful authentication

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <dbagnall@samba.org>
5 days agoCVE-2026-58218: dns_server: Fix an error path memleak
Volker Lendecke [Wed, 17 Jun 2026 06:24:47 +0000 (08:24 +0200)] 
CVE-2026-58218: dns_server: Fix an error path memleak

We talloc the new key off "dns->tkeys", which is long-lived. On any
error we never free'd that again. Probably not remotely triggerable,
this is only setting up the gensec context.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <dbagnall@samba.org>
5 days agoCVE-2026-58216: kdc:kpasswd: calculate correct size for password blob
Douglas Bagnall [Sun, 31 May 2026 00:48:11 +0000 (12:48 +1200)] 
CVE-2026-58216: kdc:kpasswd: calculate correct size for password blob

We were making the enc_data_blob 6 bytes too big.

Its payload is an ASN.1 structure that knows its own size, so the
extra bytes are not usually read by Heimdal, but a crafted packet
could force them to be read.

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

Reported-by: Tristan <TristanInSec@gmail.com>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-common: Add comments to ward off vulnerability reports
Martin Schwenke [Tue, 30 Jun 2026 03:58:22 +0000 (13:58 +1000)] 
CVE-2026-58224: ctdb-common: Add comments to ward off vulnerability reports

We can't deal with this in the current CTDB protocol without
disproportionate effort.  So, document reality clearly in the code to
try to stop these from being reported.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-doc: Emphasise that the private network must be private
Martin Schwenke [Wed, 10 Jun 2026 08:45:43 +0000 (18:45 +1000)] 
CVE-2026-58224: ctdb-doc: Emphasise that the private network must be private

Note that the difference in the first couple of lines is leading
whitespace being switch to a TAB.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-common: Secure sock_daemon Unix domain sockets
Martin Schwenke [Thu, 11 Jun 2026 01:25:52 +0000 (11:25 +1000)] 
CVE-2026-58224: ctdb-common: Secure sock_daemon Unix domain sockets

Currently, the mode of the socket depends on the creating process's
umask.  This might allow unwanted access.

It might be preferable to do this just for the eventd socket.
However, there is no useful place to hook this in outside of
sock_daemon.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-protocol: Avoid DoS memory allocations
Martin Schwenke [Wed, 10 Jun 2026 02:37:02 +0000 (12:37 +1000)] 
CVE-2026-58224: ctdb-protocol: Avoid DoS memory allocations

The pull loop already avoids out of bounds accesses beyond the end of
the buffer.  However, it does not avoid a DoS memory allocation due to
an unreasonably large array size.

Check that the number of specified array elements can be pulled from
buffer, which puts a reasonable upper bound on the subsequent memory
allocation.

Use an initialised dummy variable to avoid static analysers
complaining about uninitialised variables being passed.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-protocol: Avoid DoS memory allocations
Martin Schwenke [Wed, 10 Jun 2026 02:15:17 +0000 (12:15 +1000)] 
CVE-2026-58224: ctdb-protocol: Avoid DoS memory allocations

The pull loop already avoids out of bounds accesses beyond the end of
the buffer.  However, it does not avoid a DoS memory allocation due to
an unreasonably large array size.

Check that the number of specified array elements can be pulled from
buffer, which puts a reasonable upper bound on the subsequent memory
allocation.

Use an initialised dummy variable to avoid static analysers
complaining about uninitialised variables being passed.

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

Reported-by: Andrew Tridgell (issue 22)
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-protocol: Always pull the specified number of bytes
Martin Schwenke [Tue, 9 Jun 2026 11:54:20 +0000 (21:54 +1000)] 
CVE-2026-58224: ctdb-protocol: Always pull the specified number of bytes

The string should not contain a premature NUL terminator, which would
cause less than the specified number of bytes to be pulled.  If it
does, consume the specified number of bytes anyway.  The alternative
doesn't make sense.

Note that this is unlikely to be a security issue, where trailing data
in the string field causes the buffer to be overrun.  That would
require an additional protocol bug.  However, include this fix here
for posterity.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-protocol: Avoid off-by-one error for bytes pulled
Martin Schwenke [Tue, 9 Jun 2026 11:48:02 +0000 (21:48 +1000)] 
CVE-2026-58224: ctdb-protocol: Avoid off-by-one error for bytes pulled

As per the comment, if there is no NUL byte in the buffer then don't
count one in the number of bytes pulled.

Note that this is unlikely to be a security issue because it would
take a protocol bug elsewhere to overrun the buffer.  However, include
this fix here for posterity.

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

Reported-by: Andrew Tridgell (issue 16)
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out of bounds data access
Martin Schwenke [Tue, 9 Jun 2026 00:41:25 +0000 (10:41 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access

Instead of checking only that there is enough data for the length
field, check there is enough data for the entire header part of the
struct.  After cross-checking overall lengths, ensure there is enough
data for the key/data in the data element.

While here, modernise the DEBUG.

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

Reported-by: Andrew Tridgell (issue 13)
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out of bounds data access
Martin Schwenke [Sun, 31 May 2026 05:11:39 +0000 (15:11 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access

The first check is clearly needed because m->db_id is referenced.  The
second check is handled by a similar update to
ctdb_control_update_record(), but repeat it in case something else
changes.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out of bounds data access
Martin Schwenke [Sat, 30 May 2026 07:45:56 +0000 (17:45 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access

The count can't exceed the indata buffer size.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out of bounds data access
Martin Schwenke [Sat, 30 May 2026 07:35:23 +0000 (17:35 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access

The count can't exceed the recdata buffer size.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out of bounds data access
Martin Schwenke [Sat, 30 May 2026 05:04:31 +0000 (15:04 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access

If a NUL terminator doesn't appear in the buffer then the database
name is not a valid string.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out-of-bounds data access
Martin Schwenke [Sat, 30 May 2026 04:25:00 +0000 (14:25 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out-of-bounds data access

Do not allow the VNN map's size to extend past the end of the buffer.
This is checked by switching to ctdb_vnn_map_pull(), which also
simplifies the code.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-protocol: Avoid DoS memory allocation
Martin Schwenke [Sat, 30 May 2026 04:38:02 +0000 (14:38 +1000)] 
CVE-2026-58224: ctdb-protocol: Avoid DoS memory allocation

The pull loop already avoids out of bounds accesses beyond the end of
the buffer.  However, it does not avoid a DoS memory allocation due to
an unreasonably large array size.

Check that the number of specified array elements can be pulled from
buffer, which puts a reasonable upper bound on the subsequent memory
allocation.

Use an initialised dummy variable to avoid static analysers
complaining about uninitialised variables being passed.  Variable i
could be reused but that might be confusing, so leave any optimisation
to the compiler.

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

Reported-by: Martin Schwenke <mschwenke@ddn.com>
Reported-by: Also Andrew Tridgell (issue 22)
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-58224: ctdb-daemon: Avoid out of bounds data access
Martin Schwenke [Wed, 27 May 2026 08:59:24 +0000 (18:59 +1000)] 
CVE-2026-58224: ctdb-daemon: Avoid out of bounds data access

Protocol field lengths need to be validated to avoid attempts to
access memory beyond the end of the packet buffer.

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

Reported-by: Tristan Madani <tristan@talencesecurity.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 days agoCVE-2026-6949: s4:dns_server: correctly truncate the buffer for TSIG verification
Stefan Metzmacher [Fri, 29 May 2026 11:12:20 +0000 (13:12 +0200)] 
CVE-2026-6949: s4:dns_server: correctly truncate the buffer for TSIG verification

Calculating the length of the TSIG additional dns_res_rec,
via ndr_push_dns_res_rec() is fragile and may generate
a buffer larger than the original dns_name_packet buffer.

This could underflow the resulting packet_len,
to a very large value and buffer_len to a small value.

Resulting in a memcpy() of a very large size into
a very small buffer. This most likely already
gets a segmentation fault when reading after the
in->data.

This was reported by Arjun Basnet with Securin Labs.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <dbagnall@samba.org>
5 days agoCVE-2026-6949: ndr_dns: let ndr_pull_dns_res_rec() remember the start offset
Stefan Metzmacher [Fri, 29 May 2026 10:43:13 +0000 (12:43 +0200)] 
CVE-2026-6949: ndr_dns: let ndr_pull_dns_res_rec() remember the start offset

In order to verify TSIG signatures we need a reliable way to
truncate the original dns_name_packet buffer before the
last additional dns_res_rec.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <dbagnall@samba.org>
7 days agoctdb-common: Support IPoIB ARPs and IPv6 Neighbor Advertisements
Martin Schwenke [Mon, 22 Jun 2026 07:17:38 +0000 (17:17 +1000)] 
ctdb-common: Support IPoIB ARPs and IPv6 Neighbor Advertisements

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Jul 27 04:48:13 UTC 2026 on atb-devel-224

7 days agoctdb-tests: Handle arbitrary length hardware addresses
Martin Schwenke [Fri, 5 Jun 2026 02:32:51 +0000 (12:32 +1000)] 
ctdb-tests: Handle arbitrary length hardware addresses

While the code can generally handle arbitrary length addresses, known
lengths are used to set the hardware type.  Therefore, tests are
artificially limited to 6 octet addresses (Ethernet) and 20 octet
addresses (IPoIB).

Add some test cases for IPoIB.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Pass hardware address to ip6_na_build()
Martin Schwenke [Thu, 18 Dec 2025 03:07:55 +0000 (14:07 +1100)] 
ctdb-common: Pass hardware address to ip6_na_build()

Use address, length and type in ip6_na_build().

Logically, this generalises the code to handle any hardware address
type/length.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Pass hardware address to arp_build()
Martin Schwenke [Mon, 8 Dec 2025 08:24:33 +0000 (19:24 +1100)] 
ctdb-common: Pass hardware address to arp_build()

Use the address, length and hardware type.  arp_build() now works for
any supported hardware address length.

Update the test code to construct the required sockaddr_ll structure.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Construct IPv6oIB link-level multicast address
Martin Schwenke [Mon, 22 Jun 2026 07:13:13 +0000 (17:13 +1000)] 
ctdb-common: Construct IPv6oIB link-level multicast address

As per the comment in the code: reading RFC4391, section 4 and looking
at example GIDs on a system, suggests a simple method of mapping the
IPv4 broadcast address to an IPv6oIB multicast address.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Encapsulate whole IPv6 sendto() address setup
Martin Schwenke [Tue, 9 Dec 2025 03:16:27 +0000 (14:16 +1100)] 
ctdb-common: Encapsulate whole IPv6 sendto() address setup

Variable sall is no longer used by IPv4.  It is now only used to
construct the sendto() destination address for IPv6 NA.

Replace this variable with a sockaddr_storage so it can fit larger
link-level addresses.  Change the type of ip6_ll_multicast_build() and
use it to set the sockaddr_storage (as a sockaddr_ll), based on the
link-level broadcast address and RFCs.

IPoIB is currently not supported.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Use broadcast address for ARP sendto()
Martin Schwenke [Wed, 17 Jun 2026 04:06:42 +0000 (14:06 +1000)] 
ctdb-common: Use broadcast address for ARP sendto()

Use the retrieved broadcast address, since it may vary for
non-Ethernet link-level protocols.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Bind using hardware address
Martin Schwenke [Mon, 15 Jun 2026 11:42:06 +0000 (21:42 +1000)] 
ctdb-common: Bind using hardware address

Pass the found hardware address directly to bind(), instead of
effectively using sall as a temporary variable.  Calculate the real
length.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Open the socket after finding the interface
Martin Schwenke [Mon, 5 Jan 2026 04:36:19 +0000 (15:36 +1100)] 
ctdb-common: Open the socket after finding the interface

The socket is no longer used to find the interface so avoid having to
close it if a suitable interface is not found.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Find interface using getifaddrs(3)
Martin Schwenke [Fri, 5 Dec 2025 06:39:56 +0000 (17:39 +1100)] 
ctdb-common: Find interface using getifaddrs(3)

This is the first step towards IPoIB ARP/NA support, which uses 20
octet hardware addresses.  See the comment in the code for more
details.

This is a (relatively) minimal change.  find_interface() returns a lot
of duplicate information that isn't yet used.  Also, this is (still)
explicitly restricted to Ethernet.  Improvements and clean up to come
in subsequent commits.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Signed-off-by: Vinit Agnihotri <vagnihotri@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 days agoctdb-common: Add macro CTDB_CAN_SEND_ARPS
Martin Schwenke [Thu, 4 Jun 2026 04:18:58 +0000 (14:18 +1000)] 
ctdb-common: Add macro CTDB_CAN_SEND_ARPS

Later, this will depend on more things.  Make this change now to
minimise the size of a later commit.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>