]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

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

3 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

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

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

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

3 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

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

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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 months agoloadparm: Add ‘krb5 acceptor report canonical client name’ option
Jennifer Sutton [Tue, 6 Jan 2026 21:21:17 +0000 (10:21 +1300)] 
loadparm: Add ‘krb5 acceptor report canonical client name’ option

It is enabled by default, and does nothing as of yet.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 months agos4:selftest: Remove ‘extra_options’
Jennifer Sutton [Mon, 5 Jan 2026 20:47:36 +0000 (09:47 +1300)] 
s4:selftest: Remove ‘extra_options’

These should always be an empty list.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 months agos4:torture: Fix code spelling
Jennifer Sutton [Tue, 9 Dec 2025 21:27:15 +0000 (10:27 +1300)] 
s4:torture: Fix code spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 months agos4:torture: Simplify booleans
Jennifer Sutton [Wed, 3 Dec 2025 02:36:52 +0000 (15:36 +1300)] 
s4:torture: Simplify booleans

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 months agos4:torture:auth: Fix PAC checksum test
Jennifer Sutton [Mon, 5 Jan 2026 22:44:13 +0000 (11:44 +1300)] 
s4:torture:auth: Fix PAC checksum test

This test was supposed to corrupt the KDC signature and ensure that PAC
verification failed, but it corrupted a harmless padding byte instead. However,
PAC verification still failed as expected because the principal remained
corrupted from the previous test.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
3 months agoWHATSNEW: update for policy hints
Douglas Bagnall [Thu, 11 Dec 2025 01:47:26 +0000 (14:47 +1300)] 
WHATSNEW: update for policy hints

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agodsdb:password_hash: fix policy_hint controlled reset return codes
Douglas Bagnall [Sun, 11 Jan 2026 10:19:35 +0000 (23:19 +1300)] 
dsdb:password_hash: fix policy_hint controlled reset return codes

Resets are unwilling, not constrained.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agodsdb:password_hash: policy_hints control makes resets check history
Douglas Bagnall [Sun, 11 Jan 2026 10:17:50 +0000 (23:17 +1300)] 
dsdb:password_hash: policy_hints control makes resets check history

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agodsdb:password_hash: "policy hints" resets honour minPwdAge
Douglas Bagnall [Sun, 11 Jan 2026 10:15:53 +0000 (23:15 +1300)] 
dsdb:password_hash: "policy hints" resets honour minPwdAge

As always, a reset returns UNWILLING_TO_PERFORM even though it is
pretending to be a change due to the control.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agopytest:dsdb:password: test policy_hints oid
Douglas Bagnall [Thu, 9 Oct 2025 03:46:09 +0000 (16:46 +1300)] 
pytest:dsdb:password: test policy_hints oid

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agopytest:dsdb:passwords: guess ldaps and ldap hosts from each other
Douglas Bagnall [Wed, 10 Dec 2025 22:07:33 +0000 (11:07 +1300)] 
pytest:dsdb:passwords: guess ldaps and ldap hosts from each other

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agodsdb:password_hash: notice "policy hints" control
Douglas Bagnall [Sun, 11 Jan 2026 10:12:11 +0000 (23:12 +1300)] 
dsdb:password_hash: notice "policy hints" control

This still doesn't do anything, but it does mean we can set the control
in tests without hitting unhandled critical control errors.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agoldb: add "policy hints" controls to be used by password_hash module
Douglas Bagnall [Wed, 24 Sep 2025 23:45:30 +0000 (11:45 +1200)] 
ldb: add "policy hints" controls to be used by password_hash module

These won't have any effect yet, but soon they will allow a privileged
account to perform a password reset that respects constraints on
password history, age, and length, as if the reset was an ordinary
password change (that is, where the user provides the old password).

A normal user can't reset their own password using this, if the
organisation is using a remote service (e.g. Entra ID or Keycloak) to
manage passwords, that service can use a policy hints control to
ensure it follows AD password policy.

Entra ID Self Service Password Reset (SSPR) uses the deprecated OID.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agodsdb:password_hash: reject password reset with UNWILLING_TO_PERFORM
Douglas Bagnall [Sun, 11 Jan 2026 09:31:04 +0000 (22:31 +1300)] 
dsdb:password_hash: reject password reset with UNWILLING_TO_PERFORM

This is what Windows does: where a password change would cause
CONSTRAINT_VIOLATION, a reset causes UNWILLING_TO_PERFORM.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agodsdb:password_hash: fix a typo
Douglas Bagnall [Sun, 11 Jan 2026 09:27:58 +0000 (22:27 +1300)] 
dsdb:password_hash: fix a typo

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agopython subunit: add dummy addDuration methods
Douglas Bagnall [Thu, 8 Jan 2026 02:52:22 +0000 (15:52 +1300)] 
python subunit: add dummy addDuration methods

preventing this message:

/usr/lib/python3.12/unittest/case.py:580: RuntimeWarning: TestResult has no addDuration method
  warnings.warn("TestResult has no addDuration method",

as far as I can tell we have no real use for addDuration, since we
already measure time in other ways.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agos3:vfs_ceph_new: use #ifdef, not #if HAVE_CEPH_ASYNCIO
Douglas Bagnall [Wed, 8 Oct 2025 20:44:48 +0000 (09:44 +1300)] 
s3:vfs_ceph_new: use #ifdef, not #if HAVE_CEPH_ASYNCIO

This is one of our half-bit flags; there is no way it can be defined
to zero. '#if' works because unknown identifiers are considered to be
zero, but it isn't how we do things.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agomanpages:smb.conf:nt hash store: remove a stray word
Douglas Bagnall [Fri, 9 Jan 2026 02:53:16 +0000 (15:53 +1300)] 
manpages:smb.conf:nt hash store: remove a stray word

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 months agolib: Fix the build on solaris
Volker Lendecke [Mon, 12 Jan 2026 17:21:33 +0000 (18:21 +0100)] 
lib: Fix the build on solaris

Solaris does not define HAVE_POSIX_CAPABILITIES and does not have
cap_value_t. Confirmed by the reporter.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 14 15:25:00 UTC 2026 on atb-devel-224

3 months agovfs_btrfs: Log the correct fd value
SATOH Fumiyasu [Wed, 14 Jan 2026 06:39:29 +0000 (15:39 +0900)] 
vfs_btrfs: Log the correct fd value

Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 14 14:07:38 UTC 2026 on atb-devel-224

3 months agos3:libsmb: Rework check_negative_conn_cache()
Andreas Schneider [Mon, 12 Jan 2026 16:03:35 +0000 (17:03 +0100)] 
s3:libsmb: Rework check_negative_conn_cache()

The name and results are confusing. Rename the function and use a bool that it
is easier to understand.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jan 13 17:00:06 UTC 2026 on atb-devel-224

3 months agos3:winbindd fix race condition in terminate_child
Gary Lockyer [Tue, 6 Jan 2026 21:23:33 +0000 (10:23 +1300)] 
s3:winbindd fix race condition in terminate_child

Fixes:

winbindd[306061]:   Bad talloc magic value - unknown value
winbindd[306061]:   =========================================================
winbindd[306061]:   INTERNAL ERROR: Bad talloc magic value - unknown value in
                    winbindd () () pid

A race condition in source3/windbindd/winbindd_util.c::terminate_child
between the child socket closing, and the destructor de-registering the
child socket from epoll.

If the socket closes before it is de-registered from epoll, the event
is added to the epoll rdllink and will be retrieved when epoll_wait
is next called.  However monitor_fde has been deallocated and we get the
observed failure.

Moving the TALLOC_FREE before the kill ensures that the child socket has been
de-registered from epoll before it closes.

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 13 14:50:20 UTC 2026 on atb-devel-224

3 months agoauth/ntlmssp: Zero memory in ntlmssp_client.c
Pavel Filipenský [Tue, 9 Dec 2025 10:25:05 +0000 (11:25 +0100)] 
auth/ntlmssp: Zero memory in ntlmssp_client.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Tue Jan 13 12:34:02 UTC 2026 on atb-devel-224

3 months agoauth/ntlmssp: Add missing memory allocation checks is ntlmssp_client.c
Pavel Filipenský [Tue, 9 Dec 2025 10:27:07 +0000 (11:27 +0100)] 
auth/ntlmssp: Add missing memory allocation checks is ntlmssp_client.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoauth/ntlmssp: Zero sensitive memory in gensec_ntlmssp.c
Pavel Filipenský [Thu, 6 Nov 2025 11:38:39 +0000 (12:38 +0100)] 
auth/ntlmssp: Zero sensitive memory in gensec_ntlmssp.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agosource3/auth: Zero memory in auth_util.c
Pavel Filipenský [Sun, 23 Nov 2025 09:52:57 +0000 (10:52 +0100)] 
source3/auth: Zero memory in auth_util.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoauth/credentials: Zero memory in credentials_ntlm.c
Pavel Filipenský [Thu, 6 Nov 2025 16:09:42 +0000 (17:09 +0100)] 
auth/credentials: Zero memory in credentials_ntlm.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoauth/kerberos: Zero sensitive memory in gssapi_pac.c
Pavel Filipenský [Thu, 4 Dec 2025 12:03:58 +0000 (13:03 +0100)] 
auth/kerberos: Zero sensitive memory in gssapi_pac.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoauth/kerberos: Check memory allocation in gssapi_get_session_key()
Pavel Filipenský [Thu, 4 Dec 2025 12:02:19 +0000 (13:02 +0100)] 
auth/kerberos: Check memory allocation in gssapi_get_session_key()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoauth: Fix trailing whitespaces in gssapi_pac.c
Pavel Filipenský [Thu, 6 Nov 2025 14:05:04 +0000 (15:05 +0100)] 
auth: Fix trailing whitespaces in gssapi_pac.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agolib/krb5_wrap: Check memory allocation in smb_krb5_get_smb_session_key()
Pavel Filipenský [Thu, 4 Dec 2025 11:50:29 +0000 (12:50 +0100)] 
lib/krb5_wrap: Check memory allocation in smb_krb5_get_smb_session_key()

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agolib/krb5_wrap: Zero sensitive memory in krb5_samba.c
Pavel Filipenský [Thu, 4 Dec 2025 11:49:32 +0000 (12:49 +0100)] 
lib/krb5_wrap: Zero sensitive memory in krb5_samba.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agos4: Fix trailing whitespaces in sesssetup.c
Pavel Filipenský [Thu, 6 Nov 2025 10:59:59 +0000 (11:59 +0100)] 
s4: Fix trailing whitespaces in sesssetup.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agoauth: Fix typo "pass-though" -> "pass-through"
Pavel Filipenský [Thu, 6 Nov 2025 20:44:56 +0000 (21:44 +0100)] 
auth: Fix typo "pass-though" ->  "pass-through"

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agolibcli:auth: Fix trailing whitespaces in ntlm_check.c
Pavel Filipenský [Thu, 6 Nov 2025 20:44:56 +0000 (21:44 +0100)] 
libcli:auth: Fix trailing whitespaces in ntlm_check.c

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 months agos3:lib/util_sock: allow {before,after}_connect hooks to be passed to open_socket_out_...
Stefan Metzmacher [Thu, 18 Dec 2025 11:47:15 +0000 (12:47 +0100)] 
s3:lib/util_sock: allow {before,after}_connect hooks to be passed to open_socket_out_send()

async_connect_send() already has these hooks now open_socket_out_send()
callers can pass them through.

This will be useful for IPPROTO_SMBDIRECT sockets to setup things
between the socket() and connect() syscalls.

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): Tue Jan 13 08:13:04 UTC 2026 on atb-devel-224

3 months agolib/async_req: let async_connect_send() pass the fd to {before,after}_connect hooks
Stefan Metzmacher [Thu, 18 Dec 2025 11:47:15 +0000 (12:47 +0100)] 
lib/async_req: let async_connect_send() pass the fd to {before,after}_connect hooks

This will be useful for IPPROTO_SMBDIRECT sockets to setup things
between the socket() and connect() syscalls.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 months agolib: Remove [set|drop]_effective_capability and enum smbd_capability
Volker Lendecke [Fri, 9 Jan 2026 09:26:29 +0000 (10:26 +0100)] 
lib: Remove [set|drop]_effective_capability and enum smbd_capability

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

3 months agolib: Replace calls to [set|drop]_effective_capability
Volker Lendecke [Fri, 9 Jan 2026 09:24:32 +0000 (10:24 +0100)] 
lib: Replace calls to [set|drop]_effective_capability

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 months agolib: Add capability-specific functions
Volker Lendecke [Fri, 9 Jan 2026 09:15:25 +0000 (10:15 +0100)] 
lib: Add capability-specific functions

This makes the one-attempt logic for dac_override simpler to
understand.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 months agolib: Remove LEASE_CAPABILITY
Volker Lendecke [Thu, 8 Jan 2026 13:53:39 +0000 (14:53 +0100)] 
lib: Remove LEASE_CAPABILITY

This was only used via vfs_gpfs, and that removed its use in 2020.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>