]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
2 months agos4:kdc:sdb_to_hdb strong/flexible certificate mappings
Gary Lockyer [Sun, 7 Sep 2025 22:29:36 +0000 (10:29 +1200)] 
s4:kdc:sdb_to_hdb strong/flexible certificate mappings

Map the content of sdb_certificate_mappings to the hdb extension
HDB_Ext_CertificateMapping

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Fri Oct 10 02:30:06 UTC 2025 on atb-devel-224

2 months agos4:kdc:sdb Support Windows flexible cert mappings
Gary Lockyer [Mon, 1 Sep 2025 21:59:13 +0000 (09:59 +1200)] 
s4:kdc:sdb Support Windows flexible cert mappings

Extract certificate mappings from the altSecurityIdentities attribute and
populate the new sdb_certificate_mappings element of sdb

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2 months agotests:s4:kdc Add tests for pkinit certificate mapping
Gary Lockyer [Mon, 22 Sep 2025 03:40:58 +0000 (15:40 +1200)] 
tests:s4:kdc Add tests for pkinit certificate mapping

Tests for pkinit with "strong certificate binding enforcement"
See: https://support.microsoft.com/en-us/topic/
     kb5014754-certificate-based-authentication-changes-on-windows-domain
     -controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16

     KB5014754: Certificate-based authentication changes on Windows
     domain controllers

Test environment configuration:
   ad_dc       none
   ad_dc_ntcfs compatibility
   ad_dc_smb1  full

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2 months agopython:domain:user Add altSecurityIdentities
Gary Lockyer [Mon, 22 Sep 2025 03:42:31 +0000 (15:42 +1200)] 
python:domain:user Add altSecurityIdentities

Add altSecurityIdentities to the User domain model so that it can be used by
the key certificate binding enforcement tests.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2 months agoselftest: Add certificate binding configuration
Gary Lockyer [Mon, 22 Sep 2025 03:45:27 +0000 (15:45 +1200)] 
selftest: Add certificate binding configuration

Configure the ad_dc and ad_dc_ntvfs test environments for pkinit certificate
binding tests:

ad_dc_ntvfs:
strong certificate binding enforcement = compatibility
certificate backdating compensation = 1500

To allow testing of compatibility mode

ad_dc:
strong certificate binding enforcement = none

To test no enforcement, and to avoid breaking existing kerberos tests

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2 months agoconfig: add certificate backdating compensation
Gary Lockyer [Thu, 28 Aug 2025 23:05:10 +0000 (11:05 +1200)] 
config: add certificate backdating compensation

When preforming certificate based kerberos authentication (PKINIT) with
"strong certificate binding enforcement = compatibility"", for WEAK mappings
the certificate issue date must be after the date the user record was created.

This parameter relaxes that constraint by allowing the certificate to have been
issued up to the specified number of minutes before the user record was created.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2 months agoconfig: add strong certificate binding enforcement
Gary Lockyer [Thu, 28 Aug 2025 01:07:01 +0000 (13:07 +1200)] 
config: add strong certificate binding enforcement

This parameter controls the enforcement of Windows Certificate bindings as
outlined in "KB5014754: Certificate-based authentication changes on Windows
domain controllers",
when preforming certificate based kerberos authentication (PKINIT)

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2 months agodocs: smb.conf: add auth info audit logging
Douglas Bagnall [Wed, 8 Oct 2025 01:29:13 +0000 (14:29 +1300)] 
docs: smb.conf: add auth info audit logging

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agoWHATSNEW: auth info audit logging
Douglas Bagnall [Wed, 8 Oct 2025 01:28:29 +0000 (14:28 +1300)] 
WHATSNEW: auth info audit logging

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 months agos4:dsdb:audit_log clean up doc comments
Gary Lockyer [Mon, 6 Oct 2025 03:04:41 +0000 (16:04 +1300)] 
s4:dsdb:audit_log clean up doc comments

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb:audit_log change action for auth info
Gary Lockyer [Mon, 6 Oct 2025 01:28:19 +0000 (14:28 +1300)] 
s4:dsdb:audit_log change action for auth info

Change the action logged for authentication information changes from
"Public key change" to "Auth info change". To reflect that it's not just
changes to public keys that get logged.

This doesn't require a JSON log format version change, because the
version was recently bumped in c9e752ab18f43758d704951f7f31e39dafa6fdb4
and there hasn't been a Samba release in the meantime.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agos4:dsdb:audit_log log auth info changes
Gary Lockyer [Mon, 6 Oct 2025 00:06:12 +0000 (13:06 +1300)] 
s4:dsdb:audit_log log auth info changes

Log changes to altSecurityIdentities, dNSHostName, msDS-additionalDnsHostNames
and servicePrincipal name in the same way that changes to mdDS-keyCredentialLink
changes are logged.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agotests:audit_log_pass_change add tests for auth info logging
Gary Lockyer [Sun, 5 Oct 2025 23:46:44 +0000 (12:46 +1300)] 
tests:audit_log_pass_change add tests for auth info logging

Add tests for the logging of changes to altSecurityIdentities, dnsHostName,
servicePrincipalName and msDS-AdditionalDnsHostNames

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agotests:audit_log_pass_change refactor the tests
Gary Lockyer [Sun, 5 Oct 2025 21:29:28 +0000 (10:29 +1300)] 
tests:audit_log_pass_change refactor the tests

Refactor python/samba/tests/audit_log_pass_change.py to make it easier add tests
for the logging of changes to alternateSecurityIdentities, dNSHostName,
servicePrincipleName

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agothird_party:heimdal: import lorikeet-heimdal-202509242121
Gary Lockyer [Mon, 29 Sep 2025 23:25:51 +0000 (12:25 +1300)] 
third_party:heimdal: import lorikeet-heimdal-202509242121

(commit beffefde5c6767589603cca98065378250eaae2c)

Changes to heimdal to implement Windows strong and flexible certificate mapping
as outlined in

KB5014754: Certificate-based authentication changes
           on Windows domain controllers
https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-
                                          authentication-changes-on-windows-
                                          domain-controllers-
                                          ad2c23b0-15d8-4340-a468-4d4f3b188f16

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Wed Oct  8 21:12:44 UTC 2025 on atb-devel-224

2 months agovfs_fruit: Call fruit_fstatat() from fruit_[l]stat()
Volker Lendecke [Thu, 2 Oct 2025 19:56:59 +0000 (21:56 +0200)] 
vfs_fruit: Call fruit_fstatat() from fruit_[l]stat()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Oct  8 09:02:25 UTC 2025 on atb-devel-224

2 months agovfs_fruit: Implement fstatat
Volker Lendecke [Thu, 2 Oct 2025 10:45:18 +0000 (12:45 +0200)] 
vfs_fruit: Implement fstatat

This violates the abstraction in adouble.[ch], but passing "dirfsp"
and "relname" through ad_get() & friends would have been a more churn,
and with this violation of abstraction we only do fgetxattr once where
with a separate update_btime we do it twice. So in theory it should be
more efficient.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agolib: Add adouble_buf_parse()
Volker Lendecke [Thu, 2 Oct 2025 08:38:24 +0000 (10:38 +0200)] 
lib: Add adouble_buf_parse()

Simplified version of ad_get that takes a buffer and does basic parsing of an
AppleDouble file format. The entries are represented as DATA_BLOBs directly
pointing at "buf" to avoid offset calculations in users of this.

Yes, this is a duplication of logic, but it makes the next patch
possible. Future patches could use this in ad_unpack()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agovfs_fruit: Use all_zero() to check for an all-0 buffer
Volker Lendecke [Wed, 1 Oct 2025 15:23:16 +0000 (17:23 +0200)] 
vfs_fruit: Use all_zero() to check for an all-0 buffer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agovfs_fruit: Fix signed/unsigned comparison warnings
Volker Lendecke [Tue, 30 Sep 2025 10:24:51 +0000 (12:24 +0200)] 
vfs_fruit: Fix signed/unsigned comparison warnings

It also factors out the tevent_req_post() in pread/pwrite_send()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agovfs_fruit: Modernize a DEBUG
Volker Lendecke [Tue, 30 Sep 2025 09:35:56 +0000 (11:35 +0200)] 
vfs_fruit: Modernize a DEBUG

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agolib: Simplify data definitions
Volker Lendecke [Mon, 29 Sep 2025 19:40:58 +0000 (21:40 +0200)] 
lib: Simplify data definitions

C calculates the array size itself

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agolib: Avoid a talloc_zero in afpinfo_new()
Volker Lendecke [Mon, 29 Sep 2025 17:25:41 +0000 (19:25 +0200)] 
lib: Avoid a talloc_zero in afpinfo_new()

Use a struct assignment.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agovfs_fruit: Make struct allocation in fruit_freaddir_attr() more common
Volker Lendecke [Mon, 29 Sep 2025 12:33:18 +0000 (14:33 +0200)] 
vfs_fruit: Make struct allocation in fruit_freaddir_attr() more common

Just assign the output buffer on success

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agolib: Fix typos
Volker Lendecke [Sat, 27 Sep 2025 07:59:33 +0000 (09:59 +0200)] 
lib: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agolib: Slightly simplify ad_read_rsrc_adouble()
Volker Lendecke [Thu, 2 Oct 2025 09:46:40 +0000 (11:46 +0200)] 
lib: Slightly simplify ad_read_rsrc_adouble()

We have the MIN() macro for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agovfs_fruit: Slightly simplify readdir_attr_meta_finderi_stream()
Volker Lendecke [Mon, 29 Sep 2025 11:38:55 +0000 (13:38 +0200)] 
vfs_fruit: Slightly simplify readdir_attr_meta_finderi_stream()

"&buf[0]" is equivalent to just "buf" in this case

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agomdssvc: call mangle_reset_cache()
Ralph Boehme [Tue, 7 Oct 2025 14:13:43 +0000 (16:13 +0200)] 
mdssvc: call mangle_reset_cache()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15931
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Oct  8 07:54:48 UTC 2025 on atb-devel-224

2 months agoctdb-event: Replace "no data" event scripts with previous data
Martin Schwenke [Mon, 29 Sep 2025 07:24:53 +0000 (17:24 +1000)] 
ctdb-event: Replace "no data" event scripts with previous data

If an event script list contains results with "no data" (summary ==
-ENODATA), then overwrite these with results from the previous run,
where possible.

To maintain current behaviour in "ctdb event status ...", stop
processing scripts if the begin timestamp in the list goes backwards.
This maintains backward compatibility, where only status for scripts
from the most recent run are shown.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct  7 11:09:41 UTC 2025 on atb-devel-224

2 months agoctdb-event: Don't replace an existing result with NULL
Martin Schwenke [Fri, 26 Sep 2025 05:58:26 +0000 (15:58 +1000)] 
ctdb-event: Don't replace an existing result with NULL

If script_list is NULL then event->script_list is set to NULL by
TALLOC_FREE().  This seems like the wrong thing to do because NULL
indicates a problem running the current event.  We should keep the
previous result because it contains useful information.

In theory, this can't happen because the caller checks for NULL.
However, given that the check is here, it might as well do the right
thing... and this simplifies a subsequent change.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agoctdb-common: Make run_event return full script list
Martin Schwenke [Mon, 29 Sep 2025 05:24:10 +0000 (15:24 +1000)] 
ctdb-common: Make run_event return full script list

run_event currently truncates the resulting script list after the
first failure.

Instead, return the full script list, with scripts that weren't run
flagged with ENODATA in their summary.  This structure is zeroed on
allocation, so this is the only field that needs to be set.

For now, have the event tool skip such scripts.  Do this in
print_status() instead of print_status_one(), since there will soon be
additional checks in print_status() and it makes sense to put them
together.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agoctdb-common: Factor out new function run_event_fail()
Martin Schwenke [Mon, 29 Sep 2025 04:58:01 +0000 (14:58 +1000)] 
ctdb-common: Factor out new function run_event_fail()

Mostly due to future indentation requirements.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agogpfs: Fetch GPFS DOS attributes asynchronously
Pawan Sahu [Fri, 20 Jun 2025 03:42:01 +0000 (05:42 +0200)] 
gpfs: Fetch GPFS DOS attributes asynchronously

This change introduces asynchronous handling of GPFS DOS attributes
using the pthreadpool infrastructure. This is part of the overall
effort to improve SMB directory listing performance in environments
with GPFS as the backend filesystem.

Signed-off-by: Pawan Sahu <Pawan.Sahu1@ibm.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Sep 30 13:08:16 UTC 2025 on atb-devel-224

2 months agosmbd: Add vfswrap_check_async_with_thread_creds() helper
Pawan Sahu [Wed, 4 Jun 2025 06:13:08 +0000 (08:13 +0200)] 
smbd: Add vfswrap_check_async_with_thread_creds() helper

Move the logic that checks for sufficient threads and per-thread credential
support into a dedicated helper function: vfswrap_check_async_with_thread_creds().

Signed-off-by: Pawan Sahu <Pawan.Sahu1@ibm.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 months agosmbd: Introduce struct vfs_pthread_pool_job_state
Pawan Sahu [Fri, 9 May 2025 06:19:03 +0000 (23:19 -0700)] 
smbd: Introduce struct vfs_pthread_pool_job_state

Refactor the vfswrap_getattrat_state structure by extracting the members
specific to pthreadpool job handling into a new struct vfs_pthread_pool_job_state.
This improves code clarity and allows reuse of the job-related
state in other contexts.

Signed-off-by: Pawan Sahu <Pawan.Sahu1@ibm.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 months agolib: Add a safeguard for misconfigured directory permissions
Volker Lendecke [Fri, 26 Sep 2025 11:56:37 +0000 (13:56 +0200)] 
lib: Add a safeguard for misconfigured directory permissions

An installation I've seen had the path to the msg.lock directory set
up such that only root could access it. We're calling
serverid_exists() as non-root, so this is a pretty bad error. Log this
as an error in syslog by default and assume this PID still exists.

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): Mon Sep 29 08:14:22 UTC 2025 on atb-devel-224

2 months agolib: Remove an #include "includes.h"
Volker Lendecke [Fri, 26 Sep 2025 11:52:14 +0000 (13:52 +0200)] 
lib: Remove an #include "includes.h"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 months agolib/util: Fix CID 1414760 - Resource leak
Shweta Sodani [Mon, 22 Sep 2025 09:06:58 +0000 (14:36 +0530)] 
lib/util: Fix CID 1414760 - Resource leak

If read is failed torture_assert could return without freeing the t.
Fixing the leak.

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sun Sep 28 09:30:56 UTC 2025 on atb-devel-224

2 months agolib:crypto: Use gnutls_cipher_decrypt3() if possible
Andreas Schneider [Wed, 10 Sep 2025 08:12:02 +0000 (10:12 +0200)] 
lib:crypto: Use gnutls_cipher_decrypt3() if possible

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Sep 26 18:38:57 UTC 2025 on atb-devel-224

2 months agolib:crypto: Use gnutls_cipher_encrypt3() if possible
Andreas Schneider [Wed, 10 Sep 2025 08:07:40 +0000 (10:07 +0200)] 
lib:crypto: Use gnutls_cipher_encrypt3() if possible

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agos3/rpc_server/samr: fix CID 1509008 - time_t truncation
Xavi Hernandez [Thu, 25 Sep 2025 08:42:30 +0000 (10:42 +0200)] 
s3/rpc_server/samr: fix CID 1509008 - time_t truncation

The call to get_time_t_max() doesn't work as expected when time_t is a
64-bits type and the returned value is stored into a 32-bits unsigned
integer. Truncating a 64-bits constant to a 32-bits number won't return,
in general, the same value we would get if time_t were a 32-bits type.
It's unsafe and could even return small numbers very far from the
intended maximum.

This patch completely avoids the need to use get_time_t_max() by
assuming that when pwd_max_age is 0 or -1, it means no maximum age is
defined, so the password never expires and we don't need to do any
comparison.

A small adjustment has also been made to avoid calling
pdb_get_account_policy() if it's not necessary.

Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Sep 26 05:23:30 UTC 2025 on atb-devel-224

2 months agoctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE
Martin Schwenke [Fri, 15 Aug 2025 05:01:58 +0000 (15:01 +1000)] 
ctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE

At the moment CTDB_SOCKET can be used outside of test mode even though
nobody should do this.  So, no longer allow this.

This means ensuring CTDB_TEST_MODE is set in the in the
"clusteredmember" selftest environment, so that CTDB_SOCKET is
respected there..

Details...

The associated use of chown(2) and chmod(2), used to secure the socket
in ctdb_daemon.c:ux_socket_bind(), potentially enables a symlink race
attack.  However, the chown(2) is currently not done in test mode, so
restricting the use of CTDB_SOCKET to test mode solves the potential
security issue.

Also, sprinkle warnings about use of CTDB_TEST_MODE in appropriate
places, just to attempt to limit unwanted behaviour.

An alternative could be to use the socket file descriptor with
fchown(2) and fchmod(2).  However, these system calls are not well
defined on sockets.  Still, this was previously done in CTDB's early
days (using the poorly documented method where they are allowed in
Linux (only?) before calling bind(2)).  It was removed (due to
portability issues, via commits
cf1056df94943ddcc3d547d4533b4bc04f57f265 and
2da3fe1b175a468fdff4aa4f65627facd2c28394) and replaced with the
current post-bind chown(2) and chmod(2).

I would like to remove the CTDB_SOCKET environment variable entirely,
since setting CTDB_TEST_MODE and CTDB_BASE covers all reasonable test
environments.  However, I have a feeling that people use it for
interactive testing, and that can still be done in CTDB_TEST_MODE.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reported-by: *GUIAR OQBA * <techokba@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 25 09:02:06 UTC 2025 on atb-devel-224

2 months agoctdb-common: Factor out checking of CTDB_TEST_MODE
Martin Schwenke [Fri, 15 Aug 2025 04:59:49 +0000 (14:59 +1000)] 
ctdb-common: Factor out checking of CTDB_TEST_MODE

For use elsewhere.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
2 months agoctdb-pmda: Do not directly support CTDB_SOCKET environment variable
Martin Schwenke [Fri, 15 Aug 2025 02:08:47 +0000 (12:08 +1000)] 
ctdb-pmda: Do not directly support CTDB_SOCKET environment variable

Always use whatever CTDB uses in the current environment.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 months agoctdb-ib: Replace uses of sprintf()
Martin Schwenke [Thu, 18 Sep 2025 05:24:32 +0000 (15:24 +1000)] 
ctdb-ib: Replace uses of sprintf()

An unbounded sprintf() into ibw_lasterr (a 512-byte static data
buffer) can potentially cause overflow into other BSS data.

However, the risk is effectively minimised to zero due to:

* This code not being executed at all in ctdbd.  It is only executed
  in the accompanying test code:

  - The function ibw_process_init_attrs() can cause a buffer overflow
    if its 2nd argument, nattr, is non-zero and one of the structs in
    the array pointed to by its 1st argument, attr, contains a name
    member that is too long.

  - ibw_process_init_attrs() is only called by ibw_init(), which also
    has attr and nattr as its 1st and 2nd args, and it just passes them
    straight through.

  - ibw_init() is called in 2 places:

    1. In ibwrapper_test.c, which is targeted test code.

    2. In ibw_ctdb_init.c:ctdb_ibw_init(), which is the initialisation
       function use to initialise the IB transport in ctdbd.  Here, NULL
       and 0 are passed as the relevant arguments to ibw_init().  Both
       arguments are flagged with TODO comments.  :-)

* This code is not built by default (--enable-infiniband is
  required).

  It appears that Debian and Red Hat family Linux distributions have
  never distributed binaries with this enabled.

* Documentation (ctdb(7) and the wiki) recommends that private
  addresses are configured on a private network that is separate from
  client networks.  So, even if the TODOs were done and the relevant
  arguments could come off the wire, the attack surface should be very
  small.

Only the instance with %s in the format is potentially problematic.
The others can not overflow the current 512 byte buffer.  However, it
makes sense to change them all in case someone foolishly reduces the
size of the buffer and makes other changes so that the buffer can be
overflowed in ctdbd.

Now, will static analysers complain that the result of snprintf() is
not checked even though snprintf() always NUL-terminates?

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reported-by: Marcos “Tr0p” Tolosa <marcos.tolosa@owasp.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 months agos4:kdc:sdb_to_hdb: Fix CID 1665466
Gary Lockyer [Sun, 21 Sep 2025 21:04:02 +0000 (09:04 +1200)] 
s4:kdc:sdb_to_hdb: Fix CID 1665466

Fix:
*** CID 1665466:         Resource leaks  (RESOURCE_LEAK)
/source4/kdc/sdb_to_hdb.c: 482             in sdb_entry_to_hdb_entry()
476      }
477
478      h->context = ske;
479      if (ske != NULL) {
480      ske->kdc_entry = h;
481      }
>>>     CID 1665466:         Resource leaks  (RESOURCE_LEAK)
>>>     Variable "kt" going out of scope leaks the storage "kt.val" points to.
482      return 0;
483     error:
484      free_hdb_entry(h);
485      return rc;

This is almost certainly a false positive as when kt.len == 0, kt.val will be
NULL. But changing the condition to kt.val != NULL, will not do any harm.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Sep 25 07:13:28 UTC 2025 on atb-devel-224

2 months agopassdb: Fixing CID 1509029 for time_t in DEBUG statement
Rabinarayan Panigrahi [Wed, 17 Sep 2025 11:32:26 +0000 (17:02 +0530)] 
passdb: Fixing CID 1509029 for time_t in DEBUG statement

In the most likely scenario of time_t being 64 bit signed, we do the
typecast to intmax_t to also log negative values correctly.

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Sep 24 06:44:50 UTC 2025 on atb-devel-224

2 months agonsswitch/libwbclient: Fix CID #1034858, #1034859, #1034860 Resource leak
Shweta Sodani [Tue, 23 Sep 2025 05:43:26 +0000 (11:13 +0530)] 
nsswitch/libwbclient: Fix CID #1034858, #1034859, #1034860 Resource leak

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-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): Tue Sep 23 12:53:10 UTC 2025 on atb-devel-224

2 months agonsswitch/libwbclient: Fix CID #1034861 Resource leak
Shweta Sodani [Fri, 19 Sep 2025 13:11:49 +0000 (18:41 +0530)] 
nsswitch/libwbclient: Fix CID #1034861 Resource leak

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-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 Sep 22 14:46:13 UTC 2025 on atb-devel-224

2 months agovfs_ceph_new: Use integer value instead of boolean
Anoop C S [Mon, 22 Sep 2025 05:41:46 +0000 (11:11 +0530)] 
vfs_ceph_new: Use integer value instead of boolean

ceph_ll_fsync() API[1] accepts the third and final argument as integer
and not a boolean value.

[1] https://github.com/ceph/ceph/blob/main/src/include/cephfs/libcephfs.h#L2041

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Sep 22 12:24:35 UTC 2025 on atb-devel-224

2 months agovfs_ceph_new: dont use ceph_ll_nonblocking_readv_writev for fsync_send
Shachar Sharon [Wed, 17 Sep 2025 11:25:27 +0000 (14:25 +0300)] 
vfs_ceph_new: dont use ceph_ll_nonblocking_readv_writev for fsync_send

Commit 4ae922413844 ("vfs_ceph_new: use libcephfs nonblocking API for
async-io ops") uses ceph_ll_nonblocking_readv_writev for fsync_send.
However, the actual behaviour of libcephfs when using this API with
'fsync=true' is not async-fsync, as one may assume. Instead,
vfs_ceph_new should use a nonblocking fsync API[1], once it is ready.

Removed the usage of ceph_ll_nonblocking_readv_writev for fsync.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15919

[1] https://github.com/ceph/ceph/commit/c88a21c30d8b265adb152f631d2629d29539f7b7

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agoFix crash in DLZ plugin for incorrect setup
Alexander Bokovoy [Fri, 19 Sep 2025 13:23:41 +0000 (16:23 +0300)] 
Fix crash in DLZ plugin for incorrect setup

When bind is not yet setup properly, logging errors should be done
through the temporary handle.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Sep 20 06:49:37 UTC 2025 on atb-devel-224

3 months agos4:kdc/db-glue: Use realloc_p macro
Mike L [Tue, 16 Sep 2025 09:17:25 +0000 (11:17 +0200)] 
s4:kdc/db-glue: Use realloc_p macro

Signed-off-by: Mike L. <cl.jeremy@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 17 13:19:25 UTC 2025 on atb-devel-224

3 months agos4:kdc:sdb_to_hdb key trust support
Gary Lockyer [Mon, 11 Aug 2025 00:00:03 +0000 (12:00 +1200)] 
s4:kdc:sdb_to_hdb key trust support

Convert key trust public keys contained in the clients sdb records, and add
to the HDB_Ext_KeyTrust extension on the clients HDB record

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Sep 16 23:23:42 UTC 2025 on atb-devel-224

3 months agotests:krb5 Add key trust tests
Gary Lockyer [Sun, 10 Aug 2025 23:44:14 +0000 (11:44 +1200)] 
tests:krb5 Add key trust tests

Add tests to verify Key Trust authentication

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 months agos4:kdc:db-glue binary dn changes
Gary Lockyer [Mon, 11 Aug 2025 04:09:46 +0000 (16:09 +1200)] 
s4:kdc:db-glue binary dn changes

msDS-KeyCredentialLink will be stored as a BinaryDN and not a binary blob.
This commit updates db-glue and it's tests accordingly.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 months agos4:auth:sam Fix key trust attribute name
Gary Lockyer [Sun, 10 Aug 2025 22:28:35 +0000 (10:28 +1200)] 
s4:auth:sam Fix key trust attribute name

Use the correct attribute name for the key trust credentials,
msDS-KeyCredentialLink.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 months agosmbd: Fixing CID 1509052 for time_t in DEBUG statement
Rabinarayan Panigrahi [Mon, 1 Sep 2025 06:21:09 +0000 (11:51 +0530)] 
smbd: Fixing CID 1509052 for time_t in DEBUG statement

Fix: typecast changing from (unsigned)convert_timespec_to_time_t  to
(intmax_t)convert_timespec_to_time_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Sep 16 17:45:30 UTC 2025 on atb-devel-224

3 months agolibsmb: Fixing CID 1509051 for time_t in DEBUG statement
Rabinarayan Panigrahi [Mon, 1 Sep 2025 07:09:07 +0000 (12:39 +0530)] 
libsmb: Fixing CID 1509051 for time_t in DEBUG statement

Fix: typecast changing from (unsigned int)expire  to
(intmax_t)expire as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agonmbd: Fixing CID 1509046 for time_t in DEBUG statement
Rabinarayan Panigrahi [Mon, 1 Sep 2025 08:39:33 +0000 (14:09 +0530)] 
nmbd: Fixing CID 1509046 for time_t in DEBUG statement

Fix: typecast changing from (int)browc->death_time  to
(intmax_t)browc->death_time as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agobuildtools: fixed broken build with FIPS-enabled host
Shachar Sharon [Thu, 7 Aug 2025 13:42:07 +0000 (16:42 +0300)] 
buildtools: fixed broken build with FIPS-enabled host

MD5 is not supported on FIPS-enabled machines, but the current
work-around is broken. One the other hand, latest Waf has proper
fixup (use sha1 as a replacement to md5) so there is no need for Samba
specific code.

Tested on CentOS-stream-9 with FIPS (Python-3.9.23).

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 months agosmbd: Fix CID 1665417, UNUSED_VALUE in openat_pathref_fsp_dot()
Anoop C S [Thu, 11 Sep 2025 06:11:25 +0000 (11:41 +0530)] 
smbd: Fix CID 1665417, UNUSED_VALUE in openat_pathref_fsp_dot()

Rearrange how the open flags are defined so as to make Coverity happy
about it.

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Sep 15 15:44:38 UTC 2025 on atb-devel-224

3 months agoctdb: Fix redefinitoin of pmdaResult
Andreas Schneider [Fri, 12 Sep 2025 13:37:38 +0000 (15:37 +0200)] 
ctdb: Fix redefinitoin of pmdaResult

../../ctdb/utils/pmda/pmda_ctdb.c:52:9: warning: 'pmdaResult' redefined
   52 | #define pmdaResult pmResult
      |         ^~~~~~~~~~
In file included from ../../ctdb/utils/pmda/pmda_ctdb.c:35:
/usr/include/pcp/pmda.h:30:9: note: this is the location of the previous definition
   30 | #define pmdaResult pmResult_v2
      |         ^~~~~~~~~~

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Sep 13 08:12:42 UTC 2025 on atb-devel-224

3 months agowinbind: Initialize idmap in winbindd_getgroups
Volker Lendecke [Fri, 12 Sep 2025 16:19:29 +0000 (18:19 +0200)] 
winbind: Initialize idmap in winbindd_getgroups

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15914
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Sep 13 05:44:20 UTC 2025 on atb-devel-224

3 months agotdbtorture: Fix CID 1034815,1034816: protect from out-of-bounds access
Shachar Sharon [Mon, 8 Sep 2025 05:19:23 +0000 (08:19 +0300)] 
tdbtorture: Fix CID 1034815,1034816: protect from out-of-bounds access

A user may provide a non-valid input value for 'num_procs' (negative).
Avoid potential out-of-bound access by forcing 'unsigned int' value
(Coverity: OVERRUN).

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-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): Thu Sep 11 19:06:16 UTC 2025 on atb-devel-224

3 months agothird_party: Bump version for socket_wrapper
Andreas Schneider [Thu, 11 Sep 2025 10:39:49 +0000 (12:39 +0200)] 
third_party: Bump version for socket_wrapper

Commit be007c2cf41085a8648965fc904f37d25d35a453 forgot to do that.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep 11 17:05:00 UTC 2025 on atb-devel-224

3 months agos4:auth: Fix 'no delegation' logic in gensec_gssapi_start()
Andreas Schneider [Wed, 10 Sep 2025 13:13:37 +0000 (15:13 +0200)] 
s4:auth: Fix 'no delegation' logic in gensec_gssapi_start()

This fixes samba4.ntvfs.cifs.krb5.base.lock test with MIT Kerberos.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 months agos4:auth: Fix trailing white spaces in gensec_gssapi.c
Andreas Schneider [Wed, 10 Sep 2025 13:13:13 +0000 (15:13 +0200)] 
s4:auth: Fix trailing white spaces in gensec_gssapi.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 months agos4:tests: Use the command line option '--use-kerberos'
Andreas Schneider [Tue, 9 Sep 2025 08:12:42 +0000 (10:12 +0200)] 
s4:tests: Use the command line option '--use-kerberos'

'--kerberos' is deprecated

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 months agorpc_server: Remove the source4 implementation of wkssvc
Stefan Metzmacher [Thu, 3 Jul 2025 08:35:32 +0000 (10:35 +0200)] 
rpc_server: Remove the source4 implementation of wkssvc

This was pretty much a stub anyway

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Sep 11 15:16:17 UTC 2025 on atb-devel-224

3 months agowkssvc3: Return RNG_ERROR where source4 does it
Volker Lendecke [Thu, 3 Jul 2025 08:32:43 +0000 (10:32 +0200)] 
wkssvc3: Return RNG_ERROR where source4 does it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agowkssvc3: Return ACCESS_DENIED where source4 does it
Volker Lendecke [Thu, 3 Jul 2025 08:27:27 +0000 (10:27 +0200)] 
wkssvc3: Return ACCESS_DENIED where source4 does it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agosamr: Fix CID 1035506: close slave fd (REASOURCE_LEAK)
Shachar Sharon [Tue, 19 Aug 2025 08:34:13 +0000 (11:34 +0300)] 
samr: Fix CID 1035506: close slave fd (REASOURCE_LEAK)

In the case of (unlikely) failure of dup2 on one of the standard file
descriptors, close 'slave' fd upon return.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Sep 11 13:29:37 UTC 2025 on atb-devel-224

3 months agoselftest: Do not use wrappers for samba.tests.docs
Andreas Schneider [Wed, 10 Sep 2025 11:31:11 +0000 (13:31 +0200)] 
selftest: Do not use wrappers for samba.tests.docs

We will run into issues with Python 3.14 passing sockets for
concurrently running tasks.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Sep 10 19:21:55 UTC 2025 on atb-devel-224

3 months agosource3/passdb: Follow up to the fix for CID 1508970
Anoop C S [Wed, 10 Sep 2025 11:45:59 +0000 (17:15 +0530)] 
source3/passdb: Follow up to the fix for CID 1508970

Fixing another occurrence for the same CID in the same DEBUG statement.
See the previous commit c25a5a26a1cba698420fb64e23bee3b52540b21b.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Sep 10 15:23:08 UTC 2025 on atb-devel-224

3 months agosource3/utils: Follow up to the fix for CID 1508980
Anoop C S [Wed, 10 Sep 2025 11:41:49 +0000 (17:11 +0530)] 
source3/utils: Follow up to the fix for CID 1508980

Fixing two other occurrences for the same CID in the same file.
See previous commit ba0a748654b11bff5caaf3e8aca0ab7a5bd7022c.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agoutils: Fixing CID 1509038 for time_t in DEBUG statement
Rabinarayan Panigrahi [Fri, 5 Sep 2025 04:32:55 +0000 (10:02 +0530)] 
utils: Fixing CID 1509038 for time_t in DEBUG statement

Fix: typecast changing from (int)nt_time_to_unix_abs to
(intmax_t)nt_time_to_unix_abs) as intmax_t can hold
epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Sep 10 10:38:24 UTC 2025 on atb-devel-224

3 months agoutils: Fixing CID 1509034 for time_t in DEBUG statement
Rabinarayan Panigrahi [Fri, 5 Sep 2025 04:15:20 +0000 (09:45 +0530)] 
utils: Fixing CID 1509034 for time_t in DEBUG statement

Fix: typecast changing from (int)nt_time_to_unix_abs(&i12->lockout_window)
to (intmax_t)nt_time_to_unix_abs(&i12->lockout_window)
as intmax_t can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoutils: Fixing CID 1508980 for time_t in DEBUG statement
Rabinarayan Panigrahi [Fri, 5 Sep 2025 03:53:39 +0000 (09:23 +0530)] 
utils: Fixing CID 1508980 for time_t in DEBUG statement

Fix: typecast changing from (int)t  to (intmax_t)t
as intmax_t can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agopassdb: Fixing CID 1508971 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 14:22:05 +0000 (19:52 +0530)] 
passdb: Fixing CID 1508971 for time_t in DEBUG statement

Fix: typecast changing from (unsigned int)badtime  to (intmax_t)badtime
as intmax_t can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agopassdb: Fixing CID 1508970 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 12:57:00 +0000 (18:27 +0530)] 
passdb: Fixing CID 1508970 for time_t in DEBUG statement

Fix: typecast changing from (unsigned int)entry->bad_password_time  to
(intmax_t)entry->bad_password_time as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agowinbindd: Fixing CID 1508950 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 12:43:31 +0000 (18:13 +0530)] 
winbindd: Fixing CID 1508950 for time_t in DEBUG statement

Fix: typecast changing from (uint32_t)domain->last_seq_check  to
(intmax_t)domain->last_seq_check as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agonmbd: Fixing CID 1508948 for time_t in DEBUG statement
Rabinarayan Panigrahi [Thu, 4 Sep 2025 10:21:18 +0000 (15:51 +0530)] 
nmbd: Fixing CID 1508948 for time_t in DEBUG statement

Fix: typecast changing from (int)namerec->data.death_time  to
(intmax_t)namerec->data.death_time as intmax_t can hold epoch seconds
after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agonmbd: Fixing CID 1509039 for time_t in DEBUG statement
Rabinarayan Panigrahi [Fri, 5 Sep 2025 05:01:16 +0000 (10:31 +0530)] 
nmbd: Fixing CID 1509039 for time_t in DEBUG statement

Fix: typecast changing from (int)t to (intmax_t)t as intmax_t
can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agosmbd: Fix Bug 15897
Volker Lendecke [Sun, 7 Sep 2025 19:57:27 +0000 (21:57 +0200)] 
smbd: Fix Bug 15897

Don't leak smb_dirname->fsp->fh->fd == -1 coming from
openat_pathref_fsp_lcomp().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15897
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): Wed Sep 10 09:37:33 UTC 2025 on atb-devel-224

3 months agosmbd: Add openat_pathref_fsp_dot()
Volker Lendecke [Sun, 7 Sep 2025 19:56:30 +0000 (21:56 +0200)] 
smbd: Add openat_pathref_fsp_dot()

Very simple reopen of a directory as pathref. Too much magic in
openat_pathref_fsp_lcomp() leads to Bug 15897:
openat_pathref_fsp_lcomp() can return NT_STATUS_OK but still leave the
file descriptor at -1 for msdfs and smb1 posix reasons. When using it
in filename_convert_dirfsp_nosymlink() this bites us, the -1 can leak
into vfswrap_openat(). Avoid any magic by directly calling
SMB_VFS_OPENAT() with maximum NOFOLLOW/etc safety for this use case
and fail when this does not work.

This adds another flavor of openat_pathref_fsp, and at some point we
need to consolidate them again.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15897
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agolib: Fix the build on FreeBSD
Volker Lendecke [Sun, 7 Sep 2025 19:23:07 +0000 (21:23 +0200)] 
lib: Fix the build on FreeBSD

FreeBSD does not need crypt.h for crypt_r(). Patch from
Peter Eriksson <pen@lysator.liu.se> via
https://bugzilla.samba.org/show_bug.cgi?id=15897#c8

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agobootstrap: Use slim images for Debian
Andreas Schneider [Fri, 8 Aug 2025 07:57:59 +0000 (09:57 +0200)] 
bootstrap: Use slim images for Debian

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 10 03:13:07 UTC 2025 on atb-devel-224

3 months agobootstrap: Use minimal image for Fedora
Andreas Schneider [Fri, 8 Aug 2025 07:50:05 +0000 (09:50 +0200)] 
bootstrap: Use minimal image for Fedora

This will reduce the container image size.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agobootstrap: Remove unused ubuntu1804 images
Andreas Schneider [Fri, 8 Aug 2025 08:05:10 +0000 (10:05 +0200)] 
bootstrap: Remove unused ubuntu1804 images

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agos3:script: Avoid UnicodeDecodeError for samba-log-parser processing whole directory
Pavel Filipenský [Wed, 9 Jul 2025 20:38:02 +0000 (22:38 +0200)] 
s3:script: Avoid UnicodeDecodeError for samba-log-parser processing whole directory

When log directory contains zipped files like
old/log.rpcd_spoolss-20250831.gz we get error.
We want to ignore such files.

$ samba-log-parser --traceid 6 --merge-by-timestamp
Traceback (most recent call last):
  File "/usr/bin/samba-log-parser", line 382, in <module>
    main()
    ~~~~^^
  File "/usr/bin/samba-log-parser", line 311, in main
    process_file(
    ~~~~~~~~~~~~^
        record_list,
        ^^^^^^^^^^^^
    ...<3 lines>...
        options.traceid,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/bin/samba-log-parser", line 92, in process_file
    data = infile.readlines()
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Tue Sep  9 13:50:00 UTC 2025 on atb-devel-224

3 months agoprinting: Fix an uninitialized read
Volker Lendecke [Mon, 8 Sep 2025 16:19:01 +0000 (18:19 +0200)] 
printing: Fix an uninitialized read

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Tue Sep  9 11:06:34 UTC 2025 on atb-devel-224

3 months agos4:torture: Fix stack buffer overflow in test_dirlease_oplocks()
Andreas Schneider [Tue, 9 Sep 2025 07:24:47 +0000 (09:24 +0200)] 
s4:torture: Fix stack buffer overflow in test_dirlease_oplocks()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep  9 09:27:33 UTC 2025 on atb-devel-224

3 months agoctdb: fix build against PCP 7.0.0
Alexander Bokovoy [Wed, 3 Sep 2025 12:42:46 +0000 (15:42 +0300)] 
ctdb: fix build against PCP 7.0.0

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Sep  8 04:47:37 UTC 2025 on atb-devel-224

3 months agothird_party:heimdal: import lorikeet-heimdal-202508180154
Gary Lockyer [Mon, 18 Aug 2025 01:59:17 +0000 (13:59 +1200)] 
third_party:heimdal: import lorikeet-heimdal-202508180154

Import lorikeet-heimdal-202508180154 commits:
    beffefde5c6767589603cca98065378250eaae2c
    2073647157adb2791aa8b524e88e1a2d47268e5a
    dedeffb96b24288f6c3387cf48d82c7b9c3bbbf7

Add support for MS Key Trust Authentication

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Mon Sep  8 02:27:53 UTC 2025 on atb-devel-224

3 months agos3:shadow_copy: CID 1449539 talloc_realloc and error handling
Shwetha K Acharya [Mon, 1 Sep 2025 08:50:39 +0000 (14:20 +0530)] 
s3:shadow_copy: CID 1449539 talloc_realloc and error handling

- Replace TALLOC_REALLOC with talloc_realloc inorder to handle
  the integer overflow better.
- Rename tlabels as tmp_labels for clarity.
- Use shadow_copy_data->labels directly after successful
  reallocation instead of relying on a temporary variable.
- Ensure that  shadow_copy_data->num_volumes is set to 0 and
  shadow_copy_data->labels is freed on error paths inorder to
  address the potential resource leaks.

Fixes: CID_1449539
Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-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): Sat Sep  6 10:34:27 UTC 2025 on atb-devel-224

3 months agos3:net: Pass down the server from cmdline to sync_pw2keytabs()
Andreas Schneider [Mon, 28 Jul 2025 08:43:36 +0000 (10:43 +0200)] 
s3:net: Pass down the server from cmdline to sync_pw2keytabs()

This makes sure that during 'net ads join' the keytab create code
- sync_pw2keytabs() talks to the same DC at what the machine account
was created.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Pair-Programmed-With: Pavel Filipenský <pfilipensky@samba.org>

Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Fri Sep  5 13:38:33 UTC 2025 on atb-devel-224

3 months agotests: Add test for 'net ads join' to a preferred DC
Pavel Filipenský [Mon, 4 Aug 2025 09:20:54 +0000 (11:20 +0200)] 
tests: Add test for 'net ads join' to a preferred DC

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 months agoselftest: Add the short name for localvampiredc to hosts file
Pavel Filipenský [Tue, 29 Jul 2025 09:19:07 +0000 (11:19 +0200)] 
selftest: Add the short name for localvampiredc to hosts file

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 months agos3:net: fix "net ads group"
MikeLiu [Fri, 29 Aug 2025 09:31:36 +0000 (17:31 +0800)] 
s3:net: fix "net ads group"

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

Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep  4 09:33:27 UTC 2025 on atb-devel-224