]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 months agos3:libads: Set NT_STATUS_UNSUCCESSFUL for IP address entry
Andreas Schneider [Wed, 14 Jan 2026 14:50:26 +0000 (15:50 +0100)] 
s3:libads: Set NT_STATUS_UNSUCCESSFUL for IP address entry

This is what we do in libads/ldap.c too.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2 months agoselftest: Set the ‘report_canonical_client_name’ option in krb5.conf
Jennifer Sutton [Tue, 20 Jan 2026 03:53:30 +0000 (16:53 +1300)] 
selftest: Set the ‘report_canonical_client_name’ option in krb5.conf

This will do something later when MIT Kerberos supports this option. For Heimdal
it shouldn’t make a difference.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jan 21 04:46:43 UTC 2026 on atb-devel-224

2 months agoselftest: Add functionality for setting extra krb5.conf options
Jennifer Sutton [Tue, 20 Jan 2026 03:48:36 +0000 (16:48 +1300)] 
selftest: Add functionality for setting extra krb5.conf options

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agoselftest: Disable implicit dollar match without canonicalization for promoted_dc
Jennifer Sutton [Tue, 20 Jan 2026 03:53:27 +0000 (16:53 +1300)] 
selftest: Disable implicit dollar match without canonicalization for promoted_dc

This puts promoted_dc and ad_dc_ntvfs in sync, and avoids an issue in the former
environment where the Heimdal KDC will use the smb.conf from one of the two DCs,
and the MIT KDC will use the smb.conf from the other.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:kdc: Return SDB_ERR_NOENTRY if canonicalization is required
Jennifer Sutton [Tue, 20 Jan 2026 03:42:38 +0000 (16:42 +1300)] 
s4:kdc: Return SDB_ERR_NOENTRY if canonicalization is required

MIT Kerberos maps this error code to KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN, avoiding
problems from the KDC returning KRB5KRB_ERR_GENERIC.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:test: Add kdc-canon-mit tests
Jennifer Sutton [Tue, 20 Jan 2026 03:35:40 +0000 (16:35 +1300)] 
s4:test: Add kdc-canon-mit tests

These are modelled after the kdc-canon-heimdal tests.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agoselftest: Remove unused variables
Jennifer Sutton [Tue, 20 Jan 2026 00:02:10 +0000 (13:02 +1300)] 
selftest: Remove unused variables

These have gone unused since commit bd60c605ca1cf3f3568646dc3c0ca3501f0bfbec.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos3:lib: Remove unused code
Jennifer Sutton [Tue, 20 Jan 2026 21:16:46 +0000 (10:16 +1300)] 
s3:lib: Remove unused code

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agolib:ldb-samba:ildap: fix empty attribute list handling
Gary Lockyer [Thu, 15 Jan 2026 23:48:38 +0000 (12:48 +1300)] 
lib:ldb-samba:ildap: fix empty attribute list handling

An LDB request interprets an empty attribute list as a request for no
attributes, but LDAP interprets an empty list as a request for all attributes,
and ["1.1"] as a request for no attributes, as per
RFC4511:4.5.1.8(SearchRequest.attributes).  We need to convert [] to ["1.1"]
in the ildap module before the request goes out.

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

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jan 21 03:29:23 UTC 2026 on atb-devel-224

2 months agoWHATSNEW: Start release notes for Samba 4.21.0pre1.
Björn Jacke [Tue, 20 Jan 2026 13:47:57 +0000 (14:47 +0100)] 
WHATSNEW: Start release notes for Samba 4.21.0pre1.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Jacke <bjacke@samba.org>
Autobuild-Date(master): Tue Jan 20 15:00:48 UTC 2026 on atb-devel-224

2 months agoVERSION: Bump version up to 4.25.0pre1...
Björn Jacke [Tue, 20 Jan 2026 13:41:27 +0000 (14:41 +0100)] 
VERSION: Bump version up to 4.25.0pre1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 months agoVERSION: Disable GIT_SNAPSHOT for the Samba 4.24.0rc1 release. samba-4.24.0rc1
Björn Jacke [Tue, 20 Jan 2026 13:32:16 +0000 (14:32 +0100)] 
VERSION: Disable GIT_SNAPSHOT for the Samba 4.24.0rc1 release.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 months agoWHATSNEW: Up to Samba 4.24.0rc1.
Björn Jacke [Tue, 20 Jan 2026 13:37:21 +0000 (14:37 +0100)] 
WHATSNEW: Up to Samba 4.24.0rc1.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 months agotdb: version 1.4.15 tdb-1.4.15
Björn Jacke [Tue, 20 Jan 2026 13:35:03 +0000 (14:35 +0100)] 
tdb: version 1.4.15

tdb: Fix parse_hex during `tdbtool storehex`

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2 months agolib: Delay get_iconv_handle() in strchr_m()
Volker Lendecke [Tue, 6 Jan 2026 15:29:30 +0000 (16:29 +0100)] 
lib: Delay get_iconv_handle() in strchr_m()

Do it the same way as in strrchr_m()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jan 20 12:56:27 UTC 2026 on atb-devel-224

2 months agolib: Move a variable declaration closer to its use
Volker Lendecke [Wed, 7 Jan 2026 11:46:42 +0000 (12:46 +0100)] 
lib: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolib: Remove extern const data_blob_null
Volker Lendecke [Wed, 31 Dec 2025 13:57:36 +0000 (14:57 +0100)] 
lib: Remove extern const data_blob_null

This actually saves some .text bytes in the code referencing this constant. The
compiler should be smarter to do the right thing than to copy from a shared
location.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolib: Remove &data_blob_null refs
Volker Lendecke [Tue, 30 Dec 2025 09:34:49 +0000 (10:34 +0100)] 
lib: Remove &data_blob_null refs

The next patch will remove the data_blob_null global constant. The
APIs here are a bit weird in that they don't work fine with a NULL
pointer but require a reference to a NULL blob. But that's few enough
to add the special case in the callers.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Inline oneliners used just once
Volker Lendecke [Sun, 4 Jan 2026 12:05:49 +0000 (13:05 +0100)] 
printing: Inline oneliners used just once

This patch and the 2 previous ones could be squashed, but it's the way those
unfolded :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Simplify mapping permissions
Volker Lendecke [Sun, 4 Jan 2026 12:04:27 +0000 (13:04 +0100)] 
printing: Simplify mapping permissions

Use security_acl_map_generic()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Make structures const static
Volker Lendecke [Sun, 4 Jan 2026 12:02:26 +0000 (13:02 +0100)] 
printing: Make structures const static

While there, remove an unused mapping

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Simplify file_version_is_newer()
Volker Lendecke [Sun, 4 Jan 2026 10:31:17 +0000 (11:31 +0100)] 
printing: Simplify file_version_is_newer()

We don't need to call fstat(), driver_unix_convert() already does it
via filename_convert_dirfsp().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Make file_version_is_newer() more precise
Volker Lendecke [Sun, 4 Jan 2026 10:23:56 +0000 (11:23 +0100)] 
printing: Make file_version_is_newer() more precise

We have timespec_compare, we don't have to loose info.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Fix file_version_is_newer()
Volker Lendecke [Sun, 4 Jan 2026 09:29:26 +0000 (10:29 +0100)] 
printing: Fix file_version_is_newer()

fstring as a function parameter does not really make sense...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Apply some const
Volker Lendecke [Sun, 4 Jan 2026 09:29:12 +0000 (10:29 +0100)] 
printing: Apply some const

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Simplify driver_unix_convert()
Volker Lendecke [Sun, 4 Jan 2026 09:20:31 +0000 (10:20 +0100)] 
printing: Simplify driver_unix_convert()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Remove indentation with a "goto done"
Volker Lendecke [Sat, 3 Jan 2026 11:35:36 +0000 (12:35 +0100)] 
printing: Remove indentation with a "goto done"

Review with "git show -w".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: A little bit of README.Coding in nt_printing.c
Volker Lendecke [Sat, 3 Jan 2026 11:32:14 +0000 (12:32 +0100)] 
printing: A little bit of README.Coding in nt_printing.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Slightly simplify move_driver_file_to_download_area()
Volker Lendecke [Sat, 3 Jan 2026 11:14:09 +0000 (12:14 +0100)] 
printing: Slightly simplify move_driver_file_to_download_area()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Modernize a few DEBUGs
Volker Lendecke [Sat, 3 Jan 2026 11:09:14 +0000 (12:09 +0100)] 
printing: Modernize a few DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agovfs_fruit: Introduce two helper variables
Volker Lendecke [Sat, 3 Jan 2026 14:48:16 +0000 (15:48 +0100)] 
vfs_fruit: Introduce two helper variables

Makes it a bit easier to read for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agovfs_fruit: Move two variable declarations closer to their use
Volker Lendecke [Sat, 3 Jan 2026 14:28:23 +0000 (15:28 +0100)] 
vfs_fruit: Move two variable declarations closer to their use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agovfs_fruit: Fix short-term error path talloc leaks
Volker Lendecke [Sat, 3 Jan 2026 14:25:27 +0000 (15:25 +0100)] 
vfs_fruit: Fix short-term error path talloc leaks

In the error returns we leaked "streams" on "req". Fix this and
simplify the error paths by using "streams" as temporary talloc
context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agovfs_fruit: Introduce a helper variable
Volker Lendecke [Sat, 3 Jan 2026 14:20:46 +0000 (15:20 +0100)] 
vfs_fruit: Introduce a helper variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agovfs_fruit: Modernize DEBUGs
Volker Lendecke [Sat, 3 Jan 2026 09:32:16 +0000 (10:32 +0100)] 
vfs_fruit: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolib: Remove a function unused since 2016
Volker Lendecke [Sat, 3 Jan 2026 09:17:17 +0000 (10:17 +0100)] 
lib: Remove a function unused since 2016

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosrvsvc: Move valid_share_pathname() to where it's used
Volker Lendecke [Sat, 3 Jan 2026 09:12:49 +0000 (10:12 +0100)] 
srvsvc: Move valid_share_pathname() to where it's used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolib: Remove the pointless unix_format() macro
Volker Lendecke [Sat, 3 Jan 2026 08:52:48 +0000 (09:52 +0100)] 
lib: Remove the pointless unix_format() macro

One of the two callers even had a comment what it does...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoprinting: Simplify move_driver_to_download_area()
Volker Lendecke [Sat, 3 Jan 2026 08:38:58 +0000 (09:38 +0100)] 
printing: Simplify move_driver_to_download_area()

No need to call strlen() here. Just came across this while looking at
SMB_VFS_CREATE_FILE callers...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoldb: Avoid a few memset()s with direct structs
Volker Lendecke [Tue, 13 Jan 2026 08:42:36 +0000 (09:42 +0100)] 
ldb: Avoid a few memset()s with direct structs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoauth: Avoid a memset with calloc
Volker Lendecke [Tue, 13 Jan 2026 07:51:29 +0000 (08:51 +0100)] 
auth: Avoid a memset with calloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolib: Reduce indentation with an early return
Volker Lendecke [Fri, 9 Jan 2026 09:45:40 +0000 (10:45 +0100)] 
lib: Reduce indentation with an early return

Review with "git show -w"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Fix a panic message
Volker Lendecke [Fri, 9 Jan 2026 09:44:47 +0000 (10:44 +0100)] 
smbd: Fix a panic message

%s is not a proper file name :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agotorture: Apply some "static const"
Volker Lendecke [Wed, 7 Jan 2026 13:56:12 +0000 (14:56 +0100)] 
torture: Apply some "static const"

Only used in this file and never modified

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoloadparm: Simplify canonicalize_servicename()
Volker Lendecke [Wed, 7 Jan 2026 11:56:28 +0000 (12:56 +0100)] 
loadparm: Simplify canonicalize_servicename()

We have strlower_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoloadparm: Modernize DEBUGs
Volker Lendecke [Wed, 7 Jan 2026 11:52:04 +0000 (12:52 +0100)] 
loadparm: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolibgpo: Use ISDOT/ISDOTDOT
Volker Lendecke [Wed, 14 Jan 2026 09:31:57 +0000 (10:31 +0100)] 
libgpo: Use ISDOT/ISDOTDOT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Remove unused STR_TO_SMB_BIG_UINT
Volker Lendecke [Wed, 14 Jan 2026 09:21:06 +0000 (10:21 +0100)] 
smbd: Remove unused STR_TO_SMB_BIG_UINT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Scan output of get quota command with sscanf
Volker Lendecke [Wed, 14 Jan 2026 09:17:22 +0000 (10:17 +0100)] 
smbd: Scan output of get quota command with sscanf

sscanf can skip white space and also parse uint32/uint64 for us.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Add a NULL check for get quota command output
Volker Lendecke [Wed, 14 Jan 2026 09:12:22 +0000 (10:12 +0100)] 
smbd: Add a NULL check for get quota command output

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Reduce indentation with an early return
Volker Lendecke [Wed, 14 Jan 2026 09:11:18 +0000 (10:11 +0100)] 
smbd: Reduce indentation with an early return

Review with "git show -w"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Replace dfree command output parsing with sscanf
Volker Lendecke [Wed, 14 Jan 2026 07:18:15 +0000 (08:18 +0100)] 
smbd: Replace dfree command output parsing with sscanf

No need to do manual parsing with STR_TO_SMB_BIG_UINT and manually
skipping whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Add a NULL check for dfree command output
Volker Lendecke [Wed, 14 Jan 2026 07:12:13 +0000 (08:12 +0100)] 
smbd: Add a NULL check for dfree command output

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Reduce indentation in handle_dfree_command with early returns
Volker Lendecke [Tue, 13 Jan 2026 21:12:48 +0000 (22:12 +0100)] 
smbd: Reduce indentation in handle_dfree_command with early returns

Review with git show -w

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Factor out handling of dfree command into a separate function
Volker Lendecke [Tue, 13 Jan 2026 21:06:06 +0000 (22:06 +0100)] 
smbd: Factor out handling of dfree command into a separate function

Will enable code simplifications with early returns

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosmbd: Modernize a few DEBUGs
Volker Lendecke [Wed, 14 Jan 2026 07:28:57 +0000 (08:28 +0100)] 
smbd: Modernize a few DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agomanpages/vfs_ceph_new: document fscrypt and keybridge options
John Mulligan [Fri, 29 Aug 2025 15:38:34 +0000 (11:38 -0400)] 
manpages/vfs_ceph_new: document fscrypt and keybridge options

Document the option used to enable fscrypt-style subvolume encryption
on cephfs. Document the options used to get key material for fscrypt
using the varlink-based keybridge local RPC protocol.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Gunther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Jan 20 06:52:32 UTC 2026 on atb-devel-224

2 months agovfs_ceph_new: add keybridge and ceph fscrypt support
John Mulligan [Wed, 6 Aug 2025 17:32:50 +0000 (13:32 -0400)] 
vfs_ceph_new: add keybridge and ceph fscrypt support

Add support for CephFS's new fscrypt feature. Fetch the key material
using the new keybridge varlink local RPC API.

Adds the following configuration parameters for the vfs_ceph_new module:
```
ceph_new:keybridge socket = unix:/run/keybridge.sock
ceph_new:keybridge scope = mem
ceph_new:keybridge name = test
ceph_new:keybridge kind = B64
ceph_new:fscrypt = keybridge
```

Where the various keybridge parameters configure what keybridge server
to use and what key to fetch. The `ceph_new:fscrypt` parameter defaults to
'disabled' and can be set to 'keybridge'. An enum is used here in case
we ever need to support something other than keybridge in the future.

Pair-Programmed-With: Shachar Sharon <ssharon@redhat.com>
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Gunther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agobuild: add '--with-varlink' configure option
John Mulligan [Thu, 5 Jun 2025 20:47:55 +0000 (16:47 -0400)] 
build: add '--with-varlink' configure option

When building with varlink support, require explicit '--with-varlink'
configure option to be set. If set, allow ceph+fscrypt configuration.

Pair-Programmed-With: Shachar Sharon <ssharon@redhat.com>
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Gunther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agovfs: add files to access the varlink keybridge API
John Mulligan [Thu, 5 Jun 2025 20:47:10 +0000 (16:47 -0400)] 
vfs: add files to access the varlink keybridge API

Add a pair of helper files that will allow vfs modules to make use of
the keybridge - a varlink API and server that is defined by the sambacc
project. The keybridge server exists to act as a proxy between smbd and
various possible "secrets management" backends. Currently, the sambacc
keybridge server implements a "mem" backend, for testing only, and a
KMIP backend.

Using a local RPC protocol, like varlink + keybridge allows the smbd
side to be very simple and only know how to talk the keybridge API,
versus having to teach it about various other APIs that may need to
make use of things like mTLS.

Furthermore, samba already has an (currently optional) dependency on
libvarlink so adding another use of varlink seems like a fairly
minimal change to samba's set of dependencies. This feature will
not be built on if libvarlink is not enabled. The plan is to add this
to vfs_ceph_new in a future patch.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Gunther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoWHATSNEW: update with vfs_aio_ratelimit details
Shachar Sharon [Sun, 18 Jan 2026 10:24:27 +0000 (12:24 +0200)] 
WHATSNEW: update with vfs_aio_ratelimit details

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gunther Deschner <gd@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jan 19 14:25:41 UTC 2026 on atb-devel-224

2 months agolib/pthreadpool: protect jobs list from concurrent thread access
Noel Power [Thu, 20 Nov 2025 09:00:35 +0000 (09:00 +0000)] 
lib/pthreadpool: protect jobs list from concurrent thread access

ThreadSanitizer identifies a data race with pool->jobs with concurrent
threads in test added in previous commit.

This commit protects the pool->jobs list

(trace and line numbers are from before glue fix in previous commit)

WARNING: ThreadSanitizer: data race (pid=13574)
  Write of size 8 at 0x7b6000020260 by thread T16:
    #0 pthreadpool_tevent_job_done ../../lib/pthreadpool/pthreadpool_tevent.c:405 (pthreadpool_tevent_unit_test_san+0x407080)
    #1 tevent_common_invoke_immediate_handler ../../lib/tevent/tevent_immediate.c:190 (libtevent-private-samba.so+0x8dbf)
    #2 pthreadpool_tevent_job_fn ../../lib/pthreadpool/pthreadpool_tevent.c:351 (pthreadpool_tevent_unit_test_san+0x406bc4)
    #3 pthreadpool_server ../../lib/pthreadpool/pthreadpool.c:655 (pthreadpool_tevent_unit_test_san+0x4043bd)
    #4 <null> <null> (libtsan.so.0+0x323cf)

  Previous write of size 8 at 0x7b6000020260 by thread T13:
    #0 pthreadpool_tevent_job_send ../../lib/pthreadpool/pthreadpool_tevent.c:342 (pthreadpool_tevent_unit_test_san+0x406a09)
    #1 do_nested_pthread_job ../../lib/pthreadpool/test_pthreadpool_tevent.c:463 (pthreadpool_tevent_unit_test_san+0x408932)
    #2 pthreadpool_tevent_job_fn ../../lib/pthreadpool/pthreadpool_tevent.c:351 (pthreadpool_tevent_unit_test_san+0x406bc4)
    #3 pthreadpool_server ../../lib/pthreadpool/pthreadpool.c:655 (pthreadpool_tevent_unit_test_san+0x4043bd)
    #4 <null> <null> (libtsan.so.0+0x323cf)

  Thread T16 (tid=13591, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x5ed75)
    #1 pthreadpool_create_thread ../../lib/pthreadpool/pthreadpool.c:711 (pthreadpool_tevent_unit_test_san+0x4045ac)
    #2 pthreadpool_add_job ../../lib/pthreadpool/pthreadpool.c:792 (pthreadpool_tevent_unit_test_san+0x40496f)
    #3 pthreadpool_tevent_job_send ../../lib/pthreadpool/pthreadpool_tevent.c:329 (pthreadpool_tevent_unit_test_san+0x4065e2)
    #4 test_pthreadpool_tevent_job_send_multiple_3 ../../lib/pthreadpool/test_pthreadpool_tevent.c:515 (pthreadpool_tevent_unit_test_san+0x408c25)
    #5 cmocka_run_one_test_or_fixture ../../third_party/cmocka/cmocka.c:2948 (libcmocka-private-samba.so+0x6f92)
    #6 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 (libc.so.6+0x40e6b)

  Thread T13 (tid=13588, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x5ed75)
    #1 pthreadpool_create_thread ../../lib/pthreadpool/pthreadpool.c:711 (pthreadpool_tevent_unit_test_san+0x4045ac)
    #2 pthreadpool_add_job ../../lib/pthreadpool/pthreadpool.c:792 (pthreadpool_tevent_unit_test_san+0x40496f)
    #3 pthreadpool_tevent_job_send ../../lib/pthreadpool/pthreadpool_tevent.c:329 (pthreadpool_tevent_unit_test_san+0x4065e2)
    #4 test_pthreadpool_tevent_job_send_multiple_3 ../../lib/pthreadpool/test_pthreadpool_tevent.c:515 (pthreadpool_tevent_unit_test_san+0x408c25)
    #5 cmocka_run_one_test_or_fixture ../../third_party/cmocka/cmocka.c:2948 (libcmocka-private-samba.so+0x6f92)
    #6 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 (libc.so.6+0x40e6b)

SUMMARY: ThreadSanitizer: data race ../../lib/pthreadpool/pthreadpool_tevent.c:405 in pthreadpool_tevent_job_done

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15958
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Jan 18 15:16:59 UTC 2026 on atb-devel-224

2 months agolib/pthreadpool: Fix possible concurrent access to pool->glue_list
Noel Power [Wed, 12 Nov 2025 12:24:59 +0000 (12:24 +0000)] 
lib/pthreadpool: Fix possible concurrent access to pool->glue_list

ThreadSanitizer run against tests added in previous commit
identify a race condition with pool->glue_list with concurrent
thread access

WARNING: ThreadSanitizer: data race (pid=13574)
  Read of size 8 at 0x7b2000000368 by thread T7:
    #0 pthreadpool_tevent_job_signal ../../lib/pthreadpool/pthreadpool_tevent.c:370 (pthreadpool_tevent_unit_test_san+0x406c6e)
    #1 pthreadpool_server ../../lib/pthreadpool/pthreadpool.c:657 (pthreadpool_tevent_unit_test_san+0x40443b)
    #2 <null> <null> (libtsan.so.0+0x323cf)

  Previous write of size 8 at 0x7b2000000368 by main thread:
    #0 pthreadpool_tevent_glue_destructor ../../lib/pthreadpool/pthreadpool_tevent.c:165 (pthreadpool_tevent_unit_test_san+0x405aed)
    #1 _tc_free_internal ../../lib/talloc/talloc.c:1158 (libtalloc-private-samba.so+0x3419)
    #2 _tc_free_internal ../../lib/talloc/talloc.c:1158 (libtalloc-private-samba.so+0x3419)
    #3 cmocka_run_one_test_or_fixture ../../third_party/cmocka/cmocka.c:2948 (libcmocka-private-samba.so+0x6f92)
    #4 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 (libc.so.6+0x40e6b)

  Location is heap block of size 120 at 0x7b2000000300 allocated by main thread:
    #0 malloc <null> (libtsan.so.0+0x35799)
    #1 __talloc_with_prefix ../../lib/talloc/talloc.c:783 (libtalloc-private-samba.so+0x2a99)
    #2 test_pthreadpool_tevent_job_send_multiple_2 ../../lib/pthreadpool/test_pthreadpool_tevent.c:399 (pthreadpool_tevent_unit_test_san+0x40856f)
    #3 cmocka_run_one_test_or_fixture ../../third_party/cmocka/cmocka.c:2948 (libcmocka-private-samba.so+0x6f92)
    #4 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 (libc.so.6+0x40e6b)

  Thread T7 (tid=13582, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x5ed75)
    #1 pthreadpool_create_thread ../../lib/pthreadpool/pthreadpool.c:711 (pthreadpool_tevent_unit_test_san+0x4045ac)
    #2 pthreadpool_add_job ../../lib/pthreadpool/pthreadpool.c:792 (pthreadpool_tevent_unit_test_san+0x40496f)
    #3 pthreadpool_tevent_job_send ../../lib/pthreadpool/pthreadpool_tevent.c:329 (pthreadpool_tevent_unit_test_san+0x4065e2)
    #4 test_pthreadpool_tevent_job_send_multiple_2 ../../lib/pthreadpool/test_pthreadpool_tevent.c:423 (pthreadpool_tevent_unit_test_san+0x4086b2)
    #5 cmocka_run_one_test_or_fixture ../../third_party/cmocka/cmocka.c:2948 (libcmocka-private-samba.so+0x6f92)
    #6 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 (libc.so.6+0x40e6b)

SUMMARY: ThreadSanitizer: data race ../../lib/pthreadpool/pthreadpool_tevent.c:370 in pthreadpool_tevent_job_signal

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15958
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolib/pthreadpool: fix free of already freed glue object
Noel Power [Mon, 17 Nov 2025 08:51:49 +0000 (08:51 +0000)] 
lib/pthreadpool: fix free of already freed glue object

The lines are a bit skewed from actual sources (due to temp
debug lines) but I have inserted the relevant source code below

basically if we free ev_link then this will free the glue object, so
deleting the glue object on the next line is not what we want to do.

==14263== Invalid read of size 4
==14263==    at 0x4D13E90: talloc_chunk_from_ptr (talloc.c:527)
==14263==    by 0x4D1621E: _talloc_free (talloc.c:1770)
  249 #ifdef HAVE_PTHREAD
  250 glue->tctx = tevent_threaded_context_create(glue, ev);
  251 if (glue->tctx == NULL) {
  252 TALLOC_FREE(ev_link);
* 253 TALLOC_FREE(glue);
  254 return ENOMEM;
  250 }
==14263==    by 0x51FA0AF: pthreadpool_tevent_register_ev (pthreadpool_tevent.c:253)
==14263==    by 0x51FA302: pthreadpool_tevent_job_send (pthreadpool_tevent.c:324)
==14263==    by 0x4B01E68: vfswrap_fsync_send (vfs_default.c:1104)
==14263==    by 0x49CD9B1: smb_vfs_call_fsync_send (vfs.c:1998)
==14263==    by 0x49CDBF9: smb_vfs_fsync_sync (vfs.c:2057)
==14263==    by 0x494B1E5: sync_file (fileio.c:320)
==14263==    by 0x497CC77: reply_flush (reply.c:5398)
==14263==    by 0x49E28CB: switch_message (process.c:1726)
==14263==    by 0x49E2AA4: construct_reply (process.c:1762)
==14263==    by 0x49E37F8: process_smb (process.c:2017)
==14263==  Address 0xcb415d0 is 0 bytes inside a block of size 144 free'd
==14263==    at 0x484494B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14263==    by 0x4D14F81: _tc_free_internal (talloc.c:1222)
==14263==    by 0x4D15025: _talloc_free_internal (talloc.c:1248)
==14263==    by 0x4D162ED: _talloc_free (talloc.c:1792)

  190 static int pthreadpool_tevent_glue_link_destructor(
  191  struct pthreadpool_tevent_glue_ev_link *ev_link)
  192 {
* 193  TALLOC_FREE(ev_link->glue);
  194  return 0;
  195 }
==14263==    by 0x51F9EC3: pthreadpool_tevent_glue_link_destructor (pthreadpool_tevent.c:193)
==14263==    by 0x4D14CA9: _tc_free_internal (talloc.c:1158)
==14263==    by 0x4D15025: _talloc_free_internal (talloc.c:1248)
==14263==    by 0x4D162ED: _talloc_free (talloc.c:1792)
  249 #ifdef HAVE_PTHREAD
  250   glue->tctx = tevent_threaded_context_create(glue, ev);
  251   if (glue->tctx == NULL) {
* 252           TALLOC_FREE(ev_link);
  253           TALLOC_FREE(glue);
  254           return ENOMEM;
  250   }
==14263==    by 0x51FA08D: pthreadpool_tevent_register_ev (pthreadpool_tevent.c:252)
==14263==    by 0x51FA302: pthreadpool_tevent_job_send (pthreadpool_tevent.c:324)
==14263==    by 0x4B01E68: vfswrap_fsync_send (vfs_default.c:1104)
==14263==    by 0x49CD9B1: smb_vfs_call_fsync_send (vfs.c:1998)
==14263==  Block was alloc'd at
==14263==    at 0x4841984: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14263==    by 0x4D14339: __talloc_with_prefix (talloc.c:783)
==14263==    by 0x4D144D3: __talloc (talloc.c:825)
==14263==    by 0x4D1486C: _talloc_named_const (talloc.c:982)
==14263==    by 0x4D1734D: _talloc_zero (talloc.c:2421)
==14263==    by 0x51F9F46: pthreadpool_tevent_register_ev (pthreadpool_tevent.c:222)
==14263==    by 0x51FA302: pthreadpool_tevent_job_send (pthreadpool_tevent.c:324)
==14263==    by 0x4B01E68: vfswrap_fsync_send (vfs_default.c:1104)
==14263==    by 0x49CD9B1: smb_vfs_call_fsync_send (vfs.c:1998)
==14263==    by 0x49CDBF9: smb_vfs_fsync_sync (vfs.c:2057)
==14263==    by 0x494B1E5: sync_file (fileio.c:320)
==14263==    by 0x497CC77: reply_flush (reply.c:5398)
==14263==
==14263== Invalid read of size 4
==14263==    at 0x4D13EAE: talloc_chunk_from_ptr (talloc.c:528)
==14263==    by 0x4D1621E: _talloc_free (talloc.c:1770)
==14263==    by 0x51FA0AF: pthreadpool_tevent_register_ev (pthreadpool_tevent.c:253)
==14263==    by 0x51FA302: pthreadpool_tevent_job_send (pthreadpool_tevent.c:324)
==14263==    by 0x4B01E68: vfswrap_fsync_send (vfs_default.c:1104)
==14263==    by 0x49CD9B1: smb_vfs_call_fsync_send (vfs.c:1998)
==14263==    by 0x49CDBF9: smb_vfs_fsync_sync (vfs.c:2057)
==14263==    by 0x494B1E5: sync_file (fileio.c:320)
==14263==    by 0x497CC77: reply_flush (reply.c:5398)
==14263==    by 0x49E28CB: switch_message (process.c:1726)
==14263==    by 0x49E2AA4: construct_reply (process.c:1762)
==14263==    by 0x49E37F8: process_smb (process.c:2017)
==14263==  Address 0xcb415d0 is 0 bytes inside a block of size 144 free'd
==14263==    at 0x484494B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-l

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15957
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agoAdd unit cmocka tests for pthreadpool_tevent
Noel Power [Wed, 26 Nov 2025 16:38:25 +0000 (16:38 +0000)] 
Add unit cmocka tests for pthreadpool_tevent

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15958
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agoAdd basic cmocka unit tests for pthreadpool
Noel Power [Wed, 26 Nov 2025 09:46:23 +0000 (09:46 +0000)] 
Add basic cmocka unit tests for pthreadpool

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15958
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agodocs-xml/manpages: doc for 'vfs_aio_ratelimit' module
Shachar Sharon [Thu, 14 Aug 2025 14:01:16 +0000 (17:01 +0300)] 
docs-xml/manpages: doc for 'vfs_aio_ratelimit' module

Documentation for newly introduced async-I/O rate-limiting module.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gunther Deschner <gd@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sun Jan 18 07:23:19 UTC 2026 on atb-devel-224

2 months agos3:selftest: test vfs_aio_ratelimit module
Shachar Sharon [Thu, 4 Sep 2025 07:45:18 +0000 (10:45 +0300)] 
s3:selftest: test vfs_aio_ratelimit module

Test VFS aio_ratelimit module: ensure that a (read) delay is indeed
injected.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gunther Deschner <gd@samba.org>
2 months agovfs_aio_ratelimit: rate-limiting module for async I/O
Shachar Sharon [Sun, 10 Aug 2025 08:42:42 +0000 (11:42 +0300)] 
vfs_aio_ratelimit: rate-limiting module for async I/O

A new stackable module to allow rate-limiting functionality for async
I/O operations. When the number of IOPS or bytes-per-sec overflow a
user-defined threshold, inject a delay before allowing an operation to
complete, yielding an implicit throughput ceiling. Uses token-based
algorithm to calculate the actual delay.

Pair-Programmed-With: Avan Thakkar <athakkar@redhat.com>
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gunther Deschner <gd@samba.org>
2 months agos4:torture/smb2: add smb2.bench.write test
Stefan Metzmacher [Wed, 17 Dec 2025 19:26:13 +0000 (20:26 +0100)] 
s4:torture/smb2: add smb2.bench.write test

This test opens one file for each loop (for nprocs * qdepth loops)
and for each file it loops in write requests for the first
io_size bytes.

time smbtorture //127.0.0.1/m -Uroot%test smb2.bench.write \
        --option="torture:timelimit=600" \
        --option="torture:nprocs=1" \
        --option="torture:qdepth=4" \
        --option="torture:io_size=4096"

In order to generate constant load for profiles
--option="torture:looplimit=150000" can be used to stop
after the given number of loops before the timelimit hits.

Sometimes the bottleneck is the smbtorture process.
In order to bring the smbd process to 100% cpu, you can use
'--option="libsmb:client_guid=6112f7d3-9528-4a2a-8861-0ca129aae6c4"'
and run multiple instances of the test at the same time,
which both talk to the same smbd process.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 16 16:50:46 UTC 2026 on atb-devel-224

2 months agos4:torture/smb2: let bench.c tests use the initial connection of just once is needed
Stefan Metzmacher [Mon, 15 Dec 2025 13:42:10 +0000 (14:42 +0100)] 
s4:torture/smb2: let bench.c tests use the initial connection of just once is needed

This makes it easier to analyze wireshark traces,
it will be important for smbdirect over roce, as
wireshark has some problems there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 months agos4:torture/smb2: fix using uninitialized memory in test_lease_dynamic_share()
Stefan Metzmacher [Sat, 20 Dec 2025 01:08:18 +0000 (02:08 +0100)] 
s4:torture/smb2: fix using uninitialized memory in test_lease_dynamic_share()

We left basically the Channel value of the SMB2 write with a high chance
of being non 0, which means the server should reject the request
as rdma offload is not used.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 months agos3:smb2_negprot: make use of xconn->transport.type != SMB_TRANSPORT_TYPE_NBT
Stefan Metzmacher [Fri, 19 Dec 2025 18:35:27 +0000 (19:35 +0100)] 
s3:smb2_negprot: make use of xconn->transport.type != SMB_TRANSPORT_TYPE_NBT

This is better than relying on the magic port 139.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 16 12:48:19 UTC 2026 on atb-devel-224

2 months agos3:utils:status_json fix Non-boolean returned
Gary Lockyer [Thu, 15 Jan 2026 03:10:04 +0000 (16:10 +1300)] 
s3:utils:status_json fix Non-boolean returned

Fix cppcheck

source3/utils/status_json.c:1385:3: style: Non-boolean value returned
    from function returning bool [returnNonBoolInBooleanFunction]

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Jan 15 09:18:21 UTC 2026 on atb-devel-224

2 months agos4:client:http_test fix Non-boolean returned
Gary Lockyer [Thu, 15 Jan 2026 03:08:22 +0000 (16:08 +1300)] 
s4:client:http_test fix Non-boolean returned

fix cppcheck

source4/client/http_test.c:85:3: style: Non-boolean value returned from
    function returning bool [returnNonBoolInBooleanFunction]

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agos3:tests: Use awk for parsing hexkeys
Andreas Schneider [Fri, 14 Nov 2025 08:50:47 +0000 (09:50 +0100)] 
s3:tests: Use awk for parsing hexkeys

This just uses valid hex values and doesn't rely on special positions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Jan 15 08:01:36 UTC 2026 on atb-devel-224

2 months agos3:tests: Add debug output to test_net_tdb.sh
Andreas Schneider [Thu, 13 Nov 2025 13:33:00 +0000 (14:33 +0100)] 
s3:tests: Add debug output to test_net_tdb.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agosource3:tests: Fix all shellcheck errors found in test_net_tdb.sh
Andreas Schneider [Fri, 14 Nov 2025 08:20:21 +0000 (09:20 +0100)] 
source3:tests: Fix all shellcheck errors found in test_net_tdb.sh

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agoUpdate WHATSNEW with kerberos changes
Gary Lockyer [Tue, 23 Dec 2025 00:37:19 +0000 (13:37 +1300)] 
Update WHATSNEW with kerberos changes

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Jan 15 02:50:59 UTC 2026 on atb-devel-224

2 months agoci:autobuild: add MIT schema_dc krb5 tests
Douglas Bagnall [Sat, 20 Dec 2025 22:23:15 +0000 (11:23 +1300)] 
ci:autobuild: add MIT schema_dc krb5 tests

The schema_dc environment has the 'require canonicalization = yes' option,
which we want to test with MIT kerberos, but only with relevant tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agopytest:krb5:as_req: adjust for 'require canonicalization'
Douglas Bagnall [Fri, 12 Dec 2025 03:14:02 +0000 (03:14 +0000)] 
pytest:krb5:as_req: adjust for 'require canonicalization'

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agopytest:krb5:ms_kile: adjust for 'require canonicalization'
Douglas Bagnall [Wed, 17 Dec 2025 02:19:55 +0000 (15:19 +1300)] 
pytest:krb5:ms_kile: adjust for 'require canonicalization'

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agopytest:krb5: as_canonicalization recognises require canon option
Douglas Bagnall [Wed, 7 Jan 2026 22:53:58 +0000 (11:53 +1300)] 
pytest:krb5: as_canonicalization recognises require canon option

If the test is run against a

  require canonicalization = yes

server, requests that do not use the canonicalize flag will be
rejected at the preauth stage, so we check that and nothing more.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agos4:test: fix kdc-canon-heimdal tests for 'require canonicalization'
Douglas Bagnall [Wed, 17 Dec 2025 02:17:23 +0000 (15:17 +1300)] 
s4:test: fix kdc-canon-heimdal tests for 'require canonicalization'

The combination of the server 'require canonicalization' option with a
lack of a 'canonicalize' flag from the client will result in AS_REPs
with PRINCIPAL UNKNOWN.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agos4:test: fix kdc-heimdal simple tests for 'require canonicalization'
Douglas Bagnall [Thu, 4 Dec 2025 23:04:59 +0000 (12:04 +1300)] 
s4:test: fix kdc-heimdal simple tests for 'require canonicalization'

The client doesn't request canonicalization here, so we always expect
its AS_REP to be C_PRINCIPAL_UNKNOWN.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agopytest:krb5: notice require canonicalization option
Douglas Bagnall [Wed, 17 Dec 2025 02:19:47 +0000 (15:19 +1300)] 
pytest:krb5: notice require canonicalization option

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agotests: schema_dc krb5 tests with 'require canonicalization = yes'
Douglas Bagnall [Thu, 18 Dec 2025 22:37:25 +0000 (11:37 +1300)] 
tests: schema_dc krb5 tests with 'require canonicalization = yes'

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agos4:kdc: honour "kdc require canonicalization = yes"
Douglas Bagnall [Wed, 26 Nov 2025 20:29:00 +0000 (09:29 +1300)] 
s4:kdc: honour "kdc require canonicalization = yes"

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agoloadparm: add "kdc require canonicalization"
Douglas Bagnall [Wed, 26 Nov 2025 03:48:35 +0000 (16:48 +1300)] 
loadparm: add "kdc require canonicalization"

Has no effect yet.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agopytest:krb5 as_canonicalization checks no implicit $ return code
Douglas Bagnall [Thu, 11 Dec 2025 20:35:44 +0000 (09:35 +1300)] 
pytest:krb5 as_canonicalization checks no implicit $ return code

We check here instead of selftest/expectedfail.d/* in part because
on MIT some of these cases will fail to fail to ask for preauth.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agotests: run more kdc tests with no implicit $ without canonicalization
Douglas Bagnall [Wed, 7 Jan 2026 23:13:11 +0000 (12:13 +1300)] 
tests: run more kdc tests with no implicit $ without canonicalization

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agokdc: match implicit dollar without canon affects AS_REQ client only
Douglas Bagnall [Wed, 26 Nov 2025 22:12:21 +0000 (11:12 +1300)] 
kdc: match implicit dollar without canon affects AS_REQ client only

The smb.conf option

  kdc name match implicit dollar without canonicalization = no

is supposed to avoid the dollar ticket attack by refusing to consider
"foo$" as a match for "foo" unless canonicalization is requested.

This was rather blunt however, as the only time we care about this is for
the client name in an AS_REQ, and we can easily check whether that is the
case.

This makes the option less intrusive, allowing the use of "SERVER" for a
server name rather than "SERVER$". A number of tests no longer fail.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agopytest:krb5:as_canonicalization debug formatting
Douglas Bagnall [Wed, 7 Jan 2026 03:58:18 +0000 (16:58 +1300)] 
pytest:krb5:as_canonicalization debug formatting

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agosamba-tool gpo: remove unused import
Douglas Bagnall [Fri, 5 Dec 2025 01:56:02 +0000 (14:56 +1300)] 
samba-tool gpo: remove unused import

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agotorture: do not zero members more than once
Douglas Bagnall [Thu, 4 Dec 2025 23:07:21 +0000 (12:07 +1300)] 
torture: do not zero members more than once

three lines up is `*suite = talloc_zero(...)`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agoselftest: we no longer use 'testscenarios' or 'subunit.tests.testsuite'
Douglas Bagnall [Thu, 4 Dec 2025 22:09:26 +0000 (11:09 +1300)] 
selftest: we no longer use 'testscenarios' or 'subunit.tests.testsuite'

If 'python3-testscenarios' is installed, the test is bound to fail,
like this:

$ make test TESTS=subunit
[...]
[1(0)/2 at 0s] subunit.tests.test_suite
subunit.tests.test_suite.unittest.loader._FailedTest.subunit(none)
REASON: Exception: Exception: ImportError: Failed to import test module: subunit
Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/loader.py", line 137, in loadTestsFromName
    module = __import__(module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^
     ModuleNotFoundError: No module named 'subunit'

I am not certain when "subunit.tests.test_suite" would have
successfully resolved.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agoselftest: Disable ‘krb5 acceptor report canonical client name’ for fl2008r2dc environment
Jennifer Sutton [Wed, 7 Jan 2026 02:26:53 +0000 (15:26 +1300)] 
selftest: Disable ‘krb5 acceptor report canonical client name’ for fl2008r2dc environment

So that we test with and without the option enabled.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:auth: Implement ‘krb5 acceptor report canonical client name’ option for Heimdal
Jennifer Sutton [Wed, 3 Dec 2025 23:06:47 +0000 (12:06 +1300)] 
s4:auth: Implement ‘krb5 acceptor report canonical client name’ option for Heimdal

Adjust tests to match the new behaviour.

The implementation is simply to set a flag that is already present
in upstream Heimdal.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:torture:auth: Do not break client principal
Jennifer Sutton [Wed, 7 Jan 2026 01:40:09 +0000 (14:40 +1300)] 
s4:torture:auth: Do not break client principal

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agoauth:kerberos: Do not fail if PAC account name doesn’t match ticket principal name
Jennifer Sutton [Wed, 7 Jan 2026 01:56:33 +0000 (14:56 +1300)] 
auth:kerberos: Do not fail if PAC account name doesn’t match ticket principal name

Andrew Bartlett says:

“These days, we can trust that the PAC has been validated by the library, and I
think also that nobody could have put in a false PAC anyway (the KDC should stop
clients setting pre-auth data of that type), so the validation step that fails
isn't doing as much as it did 20 years ago. So I think we could simply patch
[this] check to accept the canonical name and know that we just are working with
that option [‘krb5 acceptor report canonical client name’] having been set.”

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>