]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
13 hours agoWHATSNEW: Cluster functional level master
Stefan Metzmacher [Mon, 27 Jul 2026 18:21:45 +0000 (20:21 +0200)] 
WHATSNEW: Cluster functional level

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug  4 10:55:37 UTC 2026 on atb-devel-224

14 hours agos3:utils: introduce 'net clusterlevel [features|show|showall|upgrade]' commands
Stefan Metzmacher [Fri, 24 Jul 2026 14:54:17 +0000 (16:54 +0200)] 
s3:utils: introduce 'net clusterlevel [features|show|showall|upgrade]' commands

These commands are able to manage the cluster functional level.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:cluster_level_db: add cluster_level_db_upgrade()
Stefan Metzmacher [Fri, 31 Jul 2026 08:07:58 +0000 (10:07 +0200)] 
s3:cluster_level_db: add cluster_level_db_upgrade()

This verifies all nodes are supporting the same ranges
and then upgrades to the highest possible level.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:messages: add MSG_CLUSTER_LEVEL_UPGRADED handler
Stefan Metzmacher [Mon, 27 Jul 2026 14:08:54 +0000 (16:08 +0200)] 
s3:messages: add MSG_CLUSTER_LEVEL_UPGRADED handler

This makes it possible notify all processes
connected ctdbd to reload the cluster functional level
from cluster_level.tdb.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agomessaging.idl: define MSG_CLUSTER_LEVEL_UPGRADED
Stefan Metzmacher [Mon, 27 Jul 2026 12:47:16 +0000 (14:47 +0200)] 
messaging.idl: define MSG_CLUSTER_LEVEL_UPGRADED

This will be used to inform all processes connected
to ctdbd that the cluster functional level was
upgraded and processes should re-check the value
stored in cluster_level.tdb.

The message itself doesn't have any payload.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:cluster_level_db: add cluster_level_db_nodes_foreach()
Stefan Metzmacher [Fri, 31 Jul 2026 07:50:16 +0000 (09:50 +0200)] 
s3:cluster_level_db: add cluster_level_db_nodes_foreach()

This allows the caller to get information about the supported
ranges of all (non-deleted) nodes together with information
about the node.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:ctdbd_conn: add ctdbd_nodes_foreach() helper
Stefan Metzmacher [Fri, 24 Jul 2026 16:01:41 +0000 (18:01 +0200)] 
s3:ctdbd_conn: add ctdbd_nodes_foreach() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:cluster_support: add SMB_ASSERT(!lp_clustering()); to cluster_level_activate_latest()
Stefan Metzmacher [Sat, 18 Jul 2026 13:52:48 +0000 (15:52 +0200)] 
s3:cluster_support: add SMB_ASSERT(!lp_clustering()); to cluster_level_activate_latest()

The cluster cases should use cluster_level_activate() instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:messages: let messaging_init_internal() call cluster_level_db_check_or_update()
Stefan Metzmacher [Wed, 15 Jul 2026 18:07:08 +0000 (20:07 +0200)] 
s3:messages: let messaging_init_internal() call cluster_level_db_check_or_update()

This makes sure we prepare the cluster level state before
we do any real work.

We only call cluster_level_db_check_or_update() if needed.

It also prepares the global state so that
cluster_level_activated() can work as desired.

Review with: git show -w --patience

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:cluster_level_db: add cluster_level_db_check_or_update()
Stefan Metzmacher [Thu, 16 Jul 2026 12:39:41 +0000 (14:39 +0200)] 
s3:cluster_level_db: add cluster_level_db_check_or_update()

This creates the global record for the active level,
when there's none.

And it creates/updates the per node record of supported
level ranges.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:lib: introduce cluster_level_db.[ch] with cluster_level_db_check()
Stefan Metzmacher [Tue, 14 Jul 2026 16:17:37 +0000 (18:17 +0200)] 
s3:lib: introduce cluster_level_db.[ch] with cluster_level_db_check()

This implements getting the global cluster functional level
state (struct cluster_level_active) in read-only mode from
cluster_level.tdb, supposed to be used by the low-level
ctdbd_connection code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:ctdbd_conn: add ctdbd_conn_{get,set}_cluster_level() helper functions
Stefan Metzmacher [Wed, 15 Jul 2026 13:30:11 +0000 (15:30 +0200)] 
s3:ctdbd_conn: add ctdbd_conn_{get,set}_cluster_level() helper functions

These will be used in the next steps...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:messages: call cluster_level_activate_latest() in messaging_init_internal()
Stefan Metzmacher [Fri, 17 Jul 2026 19:04:03 +0000 (21:04 +0200)] 
s3:messages: call cluster_level_activate_latest() in messaging_init_internal()

This is just the first step to always use the latest level
defined by the software.

A following commit will change the logic for the clustered case
and call cluster_level_activate() instead, which a value found
in a cluster wide database.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:lib: add cluster_level related functions to cluster_support.[ch]
Stefan Metzmacher [Tue, 14 Jul 2026 16:14:33 +0000 (18:14 +0200)] 
s3:lib: add cluster_level related functions to cluster_support.[ch]

This represents our global state related to cluster functional levels.

This doesn't really depend on enabled cluserter support,
but allows the core code to work without #ifdef's.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:librpc: add cluster_level.idl
Stefan Metzmacher [Tue, 14 Jul 2026 14:59:07 +0000 (16:59 +0200)] 
s3:librpc: add cluster_level.idl

This defines the basic structure to implement
a cluster wide functional level.

Upstream (master) will basically update the major number
if a incompatible change was made, similar to
SMB_VFS_INTERFACE_VERSION, at the same time
minor latest is changes to 0.

For any backport the minor number needs to
be updated there.

See also the large comments in the file itself.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:ctdbd_conn: let ctdbd_init_connection_internal() get the pid and start_time of...
Stefan Metzmacher [Tue, 14 Jul 2026 14:31:21 +0000 (16:31 +0200)] 
s3:ctdbd_conn: let ctdbd_init_connection_internal() get the pid and start_time of ctdbd

This will allow the caller to identify database records valid for
the lifetime of the current ctdbd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:dbwrap_open: protect db_open() against recursive calls
Stefan Metzmacher [Sat, 18 Jul 2026 11:36:03 +0000 (13:36 +0200)] 
s3:dbwrap_open: protect db_open() against recursive calls

Callers need to use db_open_ex() instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:dbwrap_ctdb: let db_open_ctdb_ex() use g_lock_ctx_init_ex()
Stefan Metzmacher [Thu, 16 Jul 2026 09:17:17 +0000 (11:17 +0200)] 
s3:dbwrap_ctdb: let db_open_ctdb_ex() use g_lock_ctx_init_ex()

This will allow db_open_ctdb_ex() to work without
global state to be setup first.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:g_lock: split out g_lock_ctx_init_ex()
Stefan Metzmacher [Thu, 16 Jul 2026 09:10:35 +0000 (11:10 +0200)] 
s3:g_lock: split out g_lock_ctx_init_ex()

This prepares us to allow to open a
persistent database in read-write mode
with transactions during early startup
where we don't have global state yet.

This asserts that g_lock_ctx_init() can't
be called recursively.

It will be used in db_open_ctdb_ex()
in the next step.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:dbwrap_open: split out db_open_ex()
Stefan Metzmacher [Thu, 16 Jul 2026 09:04:15 +0000 (11:04 +0200)] 
s3:dbwrap_open: split out db_open_ex()

This will allow us to open a persistent database
in read-only mode without allowing transactions.

It allows otherwise global state to be passed down
to db_open_ctdb_ex().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:dbwrap_ctdb: split out db_open_ctdb_ex()
Stefan Metzmacher [Tue, 14 Jul 2026 11:45:53 +0000 (13:45 +0200)] 
s3:dbwrap_ctdb: split out db_open_ctdb_ex()

This will allow us to open a persistent database
in read-only mode without allowing transactions.

We'll use that in order to implement a
"cluster_level.tdb" in order to
add support for controlled cluster upgrades
in the next steps.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:global_contexts: add global_messaging_context_raw()
Stefan Metzmacher [Sat, 18 Jul 2026 10:51:29 +0000 (12:51 +0200)] 
s3:global_contexts: add global_messaging_context_raw()

This gets the global context without trying to
create a fresh one.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:g_lock: let g_lock_trylock() debug if exclusive locker died
Stefan Metzmacher [Fri, 17 Jul 2026 11:21:26 +0000 (13:21 +0200)] 
s3:g_lock: let g_lock_trylock() debug if exclusive locker died

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:ctdbd_conn: remove unused ctdbd_reinit_connection()
Stefan Metzmacher [Thu, 16 Jul 2026 10:05:07 +0000 (12:05 +0200)] 
s3:ctdbd_conn: remove unused ctdbd_reinit_connection()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agolib/replace: add BUILD_ASSERT()
Stefan Metzmacher [Wed, 4 Mar 2026 15:39:10 +0000 (16:39 +0100)] 
lib/replace: add BUILD_ASSERT()

This uses _Static_assert() from C11...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agos3:utils: don't allow misc options to 'net join'
Stefan Metzmacher [Tue, 21 Jul 2026 10:19:01 +0000 (12:19 +0200)] 
s3:utils: don't allow misc options to 'net join'

The code from net_ads_join looks at misc options in argv
and also gets a domain name, which might not be our workgroup
nor realm.

The net_rpc_join doesn't do that, instead of uses
the misc options as join type and the domain from
lp_workgroup().

This means the generic 'net join' can't handle
misc options in a sane way.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agoselftest:Samba3: remove useless 'member' argument and use 'net ads join'
Stefan Metzmacher [Tue, 21 Jul 2026 10:16:50 +0000 (12:16 +0200)] 
selftest:Samba3: remove useless 'member' argument and use 'net ads join'

The net_ads_join code path tries to join a domain called 'MEMBER'
and only the fallback to net_rpc_join lets this work at all.

The net_rpc_join code path tries to convert the argument
to a join type.

So use a command real admins will use.

I noticed this as I was wondering about the message:

 ADS join did not work, falling back to RPC...

on the screen when starting the 'clusteredmember'
environment.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 hours agonet.8.xml: document 'net serverid wipedbs --persistent'
Stefan Metzmacher [Wed, 29 Jul 2026 11:38:22 +0000 (13:38 +0200)] 
net.8.xml: document 'net serverid wipedbs --persistent'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
37 hours agosmbd: Make reference_smb_fname_fsp_link() static gitlab/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

38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
38 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>
3 days agos4:libcli/resolve: let lpcfg_resolve_context() take an explicit mem_ctx
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

3 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>
4 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

5 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>
5 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>
5 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

5 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>
5 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

5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

6 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

6 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>
6 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>
7 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

7 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>
7 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>
7 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>
7 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>
7 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>