summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2026-03-26lib:krb5_wrap: Add function to read the default_ccache_name config valueAndreas Schneider2-0/+93
krb5_cc_default_name() expands the config value %{uid} is expanded to the current id. However when we call this as winbind, it is expanded to root and not the user we are authenticating. This functions reads directly from the config. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2026-03-25auth: Remove talloc_set_name_const() if talloc_keep_secret() changes the ↵Pavel Filipenský1-1/+0
talloc name Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Autobuild-User(timing): Pavel Filipensky <pfilipensky@samba.org> Autobuild-Date(timing): Wed Mar 25 21:16:35 UTC 2026 on atb-devel-224
2026-03-25util/tests: Test that talloc_keep_secret() does not overwrite the namePavel Filipenský1-0/+20
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
2026-03-25lib/util: Overwrite talloc name in talloc_keep_secret() only if it would ↵Pavel Filipenský1-1/+7
reveal memory content Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
2026-03-25util/tests: Extend the 'test_talloc_keep_secret' testPavel Filipenský1-0/+7
Test that talloc_strdup() puts the secret as talloc name. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
2026-03-25Revert "lib/util: Avoid overwriting talloc chunk name in talloc_keep_secret()"Pavel Filipenský2-0/+5
This reverts commit 7e693b55730ceba2ef326286a0c68d5d91324a22. Without this commit, for memory allocated via e.g. talloc_strdup(), talloc name would reveal memory content. Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
2026-03-23lib:util: Remove is_aligned prototype from alignment.hGary Lockyer1-10/+0
is_aligned is now defined as static inline, so there's no need for the prototype Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Mon Mar 23 08:23:50 UTC 2026 on atb-devel-224
2026-03-20lib:replace add discard_align_pGary Lockyer1-0/+20
Add discard_align_p macro to allow the suppression of cast-align warnings Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2026-03-20lib:util add alignment utilitiesGary Lockyer1-0/+62
Add utilities to allow checking of pointer alignment. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2026-03-10s3: Warn if no mutexes available at runtimeVolker Lendecke1-0/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Shweta Sodani <ssodani@redhat.com> Reviewed-by: Xavi Hernandez <xhernandez@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org>
2026-03-01lib: Remove the "getwd cache"Volker Lendecke3-4/+0
No longer needed Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-03-01torture: Use SINGLETON_CACHE_TALLOC in testsVolker Lendecke1-12/+12
GETWD_CACHE is on its way out. Despite not having _TALLOC in its name nor it being marked as talloc in memcache.h, memcache_is_talloc() shows it as being talloc'ed. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-27vfs_aio_ratelimit: Add per-share TDB persistence for local rate limiter stateAvan Thakkar1-0/+8
Introduce local TDB storage for saving and restoring ratelimiter state (iops_tokens, bytes_tokens, last timestamp). Each share now persists its read/write limiter state under aio_ratelimit.tdb. Added VERSION pseudo-key for schema versioning On disconnect, save the latest state and close TDB. BUG: https://bugzilla.samba.org/show_bug.cgi?id=16000 Signed-off-by: Avan Thakkar <athakkar@redhat.com> Reviewed-by: Shweta Sodani <ssodani@redhat.com> Reviewed-by: Shachar Sharon <ssharon@redhat.com> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-20pthreadpool: Fix CID 1681387, Error handling issues (CHECKED_RETURN)Anoop C S1-2/+10
Signed-off-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Fri Feb 20 08:37:17 UTC 2026 on atb-devel-224
2026-02-20build: Move jansson detection and related options to lib/utilMartin Schwenke2-0/+33
This means that standalone builds (e.g. CTDB) can use it. The check for without JSON but with AD DC stays in the top-level wscript. Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-18lib:audit_logging: Fix code spellingJennifer Sutton1-4/+4
Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2026-02-15lib: Avoid DEBUGADDs in debug_lock_order()Volker Lendecke1-12/+19
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Remove unused str_list_showVolker Lendecke2-21/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Remove sys_fsusage()Volker Lendecke3-179/+0
"man statfs" on Linux says "Unless you need the f_type field, you should use the standard statvfs(3) interface instead.". We don't need f_type to get disk usage :-) We lose some of the older compatibility layers. Should these ever be needed again, we should add them to lib/util/statvfs.c an the single interface to retrieve file system usage info. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Add statvfs2fsusageVolker Lendecke2-0/+32
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Move statvfs.[ch] to lib/utilVolker Lendecke3-0/+316
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Move conv_str_bool() to its only userVolker Lendecke2-34/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Avoid an "else", we return in the if-branchVolker Lendecke1-4/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Remove very little used wrapper conv_str_u64()Volker Lendecke3-39/+8
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15lib: Clean up includes in util_strlist_v3.cVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-13lib/pthreadpool: Add some pthreadpool_pipe unit testsNoel Power2-0/+331
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Feb 13 11:22:34 UTC 2026 on atb-devel-224
2026-02-13lib/pthreadpool: Incorrect error state detected for dup2 callNoel Power1-1/+1
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Noel Power <noel.power@suse.com>
2026-02-09util: Avoid signed/unsigned integer comparisonsMartin Schwenke1-3/+3
../../../lib/util/sys_rw.c: In function ‘sys_pread_full’: ../../../lib/util/sys_rw.c:219:25: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 219 | if (ret > curr_count) { | ^ ../../../lib/util/sys_rw.c: In function ‘sys_pwrite_full’: ../../../lib/util/sys_rw.c:282:25: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 282 | if (ret > curr_count) { | ^ ../../../lib/util/sys_rw.c: In function ‘sys_write_full’: ../../../lib/util/sys_rw.c:321:25: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 321 | if (ret > curr_count) { | ^ Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2026-01-28lib:audit_logging JSON remove leading spacesGary Lockyer1-7/+3
Remove the leading spaces in JSON audit lines. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15898 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2026-01-28lib:util:debug tests for JSON logging macrosGary Lockyer2-0/+291
Add unit tests for the new JSON debugging macros DBGJSON and DBGJSONC BUG: https://bugzilla.samba.org/show_bug.cgi?id=15898 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2026-01-28lib:util:debug Logging macros for JSON outputGary Lockyer2-0/+59
Add new debug macros for outputting JSON log lines BUG: https://bugzilla.samba.org/show_bug.cgi?id=15898 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org>
2026-01-21lib:ldb-samba:ildap: fix empty attribute list handlingGary Lockyer1-1/+14
An LDB request interprets an empty attribute list as a request for no attributes, but LDAP interprets an empty list as a request for all attributes, and ["1.1"] as a request for no attributes, as per RFC4511:4.5.1.8(SearchRequest.attributes). We need to convert [] to ["1.1"] in the ildap module before the request goes out. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13852 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Jan 21 03:29:23 UTC 2026 on atb-devel-224
2026-01-20tdb: version 1.4.15tdb-1.4.15Björn Jacke2-1/+74
tdb: Fix parse_hex during `tdbtool storehex` Signed-off-by: Bjoern Jacke <bjacke@samba.org> Signed-off-by: Jule Anger <janger@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2026-01-20lib: Delay get_iconv_handle() in strchr_m()Volker Lendecke1-1/+3
Do it the same way as in strrchr_m() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 20 12:56:27 UTC 2026 on atb-devel-224
2026-01-20lib: Remove extern const data_blob_nullVolker Lendecke2-3/+1
This actually saves some .text bytes in the code referencing this constant. The compiler should be smarter to do the right thing than to copy from a shared location. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-20ldb: Avoid a few memset()s with direct structsVolker Lendecke3-12/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-18lib/pthreadpool: protect jobs list from concurrent thread accessNoel Power1-0/+40
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
2026-01-18lib/pthreadpool: Fix possible concurrent access to pool->glue_listNoel Power1-1/+79
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>
2026-01-18lib/pthreadpool: fix free of already freed glue objectNoel Power1-1/+0
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>
2026-01-18Add unit cmocka tests for pthreadpool_teventNoel Power2-0/+783
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>
2026-01-18Add basic cmocka unit tests for pthreadpoolNoel Power2-0/+642
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>
2026-01-15loadparm: add "kdc require canonicalization"Douglas Bagnall1-0/+1
Has no effect yet. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2026-01-15torture: do not zero members more than onceDouglas Bagnall1-2/+0
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>
2026-01-15loadparm: Add ‘krb5 acceptor report canonical client name’ optionJennifer Sutton1-0/+1
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>
2026-01-15ldb: add "policy hints" controls to be used by password_hash moduleDouglas Bagnall2-0/+76
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>
2026-01-13lib/krb5_wrap: Check memory allocation in smb_krb5_get_smb_session_key()Pavel Filipenský1-0/+4
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2026-01-13lib/krb5_wrap: Zero sensitive memory in krb5_samba.cPavel Filipenský1-3/+6
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2026-01-13lib/async_req: let async_connect_send() pass the fd to ↵Stefan Metzmacher2-8/+8
{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>
2026-01-07lib: Remove unnecessary assignmentsVolker Lendecke1-2/+0
data_blob_free() already NULLs out its argument Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-07smbd: Simplify callers of messaging_send()Volker Lendecke1-5/+1
It deals fine with a NULL argument Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>