summaryrefslogtreecommitdiff
path: root/source3/utils
AgeCommit message (Collapse)AuthorFilesLines
2026-04-14s3/rpc_server: Add worker status smbcontrol message supportNoel Power1-1/+34
Add information about the number of connections a rpc_worker process is handling and when each connection was initiated. command smbcontrol 55063 rpc-dump-worker-status will output data like below: rpcd_spoolss pid 55063: num connections = 2 num_association_groups = 2 last client connection 2026/03/18 06:51:04.482192 last client disconnection 2026/03/18 06:51:00.304951 active connections: [1] endpoint=ncacn_np:[\pipe\spoolss] client addr=192.168.32.175 server=priu0002 connected at 2026/03/18 06:51:04.482192 [2] endpoint=ncacn_np:[\pipe\spoolss] client addr=192.168.33.232 server=priu0002 connected at 2026/03/18 06:47:08.466157 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Tue Apr 14 12:12:07 UTC 2026 on atb-devel-224
2026-03-01net: Use create_conn_struct_chdir() in "net vfs"Volker Lendecke1-13/+16
We don't need to jump back to the previous cwd when exiting from the net vfs process. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-16s3:utils: Fix misleading recursive flag in smbget error messageDESKTOP-73571CJ\User1-1/+1
The error message in smbget incorrectly instructs users to use "-R" for recursive downloads. In recent Samba versions, the "-R" flag was repurposed for "--name-resolve" to align with other tools. The correct flag for recursion is now "--recursive". This mismatch causes confusion as using "-R" triggers a parameter parsing error rather than enabling recursion. This patch updates the error string to correctly suggest "--recursive" instead of "-R". RN: smbget: Fix error message suggesting wrong flag for recursion. Signed-off-by: Hugo Chia hugochiaxyz.nus@gmail.com Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: John Mulligan <jmulligan@redhat.com> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Mon Feb 16 15:37:04 UTC 2026 on atb-devel-224
2026-02-05s3:utils: 'net ads kerberos kinit' should use also default ccache name from ↵Pavel Filipenský1-10/+26
krb5.conf This is re-introducing the behavior from samba-4.20 where both these commands operated on the same ccache (default_ccache_name in [libdefaults] section of krb5.conf) 'net ads kerberos kinit -P' 'klist' With samba-4.21 it no longer works, 'net ads kerberos kinit -P' fallbacks to 'MEMORY:net' (which is of a very limited use, ticket cannot be used by other process) and klist finds no ticket. The order is changed from: --use-krb5-ccache env "KRB5CCNAME" "MEMORY:net" to ("MEMORY:net" is removed): --use-krb5-ccache env "KRB5CCNAME" default_ccache_name '--use-krb5-ccache=MEMORY:net' can be used to validate the credentials. Use smb_force_krb5_cc_default_name() instead of krb5_cc_default_name() because of commit: 1ca6fb5 make sure krb5_cc_default[_name]() is no longer used directly Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2026-01-15s3:utils:status_json fix Non-boolean returnedGary Lockyer1-1/+1
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
2026-01-07lib: Remove unnecessary assignmentsVolker Lendecke1-3/+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-07lib: Don't call a function to initialize an empty DATA_BLOBVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-05s3-net: properly setup krb5 ccache name via --use-krb5-ccacheGünther Deschner2-7/+16
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15840 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-12-23s3:testparm: Fix "sync machine password to keytab" validationSamuel Cabrero1-35/+60
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org> Autobuild-User(master): Samuel Cabrero <scabrero@samba.org> Autobuild-Date(master): Tue Dec 23 09:43:56 UTC 2025 on atb-devel-224
2025-11-27net/serverid: initialize state->open_dbRalph Boehme1-0/+2
Fixes a crash that happens when smbXsrv_open_global.tdb contains only replay records. #0 0x00007ffff70a718a in dbwrap_exists (db=0x0, key=...) at ../../lib/dbwrap/dbwrap.c:347 #1 0x00000000002dc7f2 in wipedbs_traverse_replay_records (rec=0x7fffffffd180, wipedbs_state=0x362d70) at ../../source3/utils/net_serverid.c:710 #2 0x00007ffff70aa932 in db_rbt_traverse_internal (db=0x37e940, f=0x2dc749 <wipedbs_traverse_replay_records>, private_data=0x362d70, count=0x7fffffffd220, rw=false) at ../../lib/dbwrap/dbwrap_rbt.c:472 #3 0x00007ffff70aaa0e in db_rbt_traverse_read (db=0x37e940, f=0x2dc749 <wipedbs_traverse_replay_records>, private_data=0x362d70) at ../../lib/dbwrap/dbwrap_rbt.c:499 #4 0x00007ffff70a7433 in dbwrap_traverse_read (db=0x37e940, f=0x2dc749 <wipedbs_traverse_replay_records>, private_data=0x362d70, count=0x0) at ../../lib/dbwrap/dbwrap.c:437 #5 0x00000000002dcedf in net_serverid_wipedbs (c=0x34c0d0, argc=0, argv=0x365380) at ../../source3/utils/net_serverid.c:840 #6 0x00000000002c9675 in net_run_function (c=0x34c0d0, argc=1, argv=0x365378, whoami=0x258c96 "net tdb smbXsrv", table=0x7fffffffd360) at ../../source3/utils/net_util.c:451 #7 0x00000000002e6e2c in net_tdb_smbXsrv (c=0x34c0d0, argc=1, argv=0x365378) at ../../source3/utils/net_tdb.c:105 #8 0x00000000002c9675 in net_run_function (c=0x34c0d0, argc=2, argv=0x365370, whoami=0x258d45 "net tdb", table=0x7fffffffd440) at ../../source3/utils/net_util.c:451 #9 0x00000000002e6f04 in net_tdb (c=0x34c0d0, argc=2, argv=0x365370) at ../../source3/utils/net_tdb.c:128 #10 0x00000000002c9675 in net_run_function (c=0x34c0d0, argc=3, argv=0x365368, whoami=0x22ca4b "net", table=0x323640 <net_func>) at ../../source3/utils/net_util.c:451 #11 0x0000000000277227 in main (argc=6, argv=0x7fffffffe2a8) at ../../source3/utils/net.c:1481 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-11-19s3:ntlm_auth: Fix typo in error message (protools -> protocols)Frediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Nov 19 19:38:52 UTC 2025 on atb-devel-224
2025-11-14s3:mdssvc: Remove support for tracker sparql supportAndreas Schneider1-315/+0
This only support v2 of tracker sparql which is only avilable on the Ubuntu 20.04 runner. All newer distributions provide only tracker sparql v3. Also the tevent glib stopped working on Fedora 43. Time to remove it. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-11-10lib: Introduce cp_smb_basename() helper functionVolker Lendecke1-12/+2
I always had to look up the sequence of NULLs and 0s. Save lines. 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 Nov 10 14:33:28 UTC 2025 on atb-devel-224
2025-11-10s3: talloc_destroy() -> TALLOC_FREE()Volker Lendecke8-42/+42
Sweeping change, I know. Should not change compiled code in most cases, the compiler should be smart enough to elide the assignment right before a return. In the cases where this is not right before the return, TALLOC_FREE() is safer as it makes use-after-free crash. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10s3: Replace a few calls to TALLOC() with talloc_array()Volker Lendecke1-2/+2
No explicit cast necessary Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-10-16s3:util: Pass a memory context to get_challenge for ntlm_auth testsAndreas Schneider3-7/+7
Fixes memory leaks detected by LeakSanitizer. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-10-16s3:utils: Use a talloc stackframe for diagnose_ntlm_auth()Andreas Schneider1-0/+3
This way we can use talloc_tos() and don't leak any memory. This will make LeakSanitizer happy. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-10-10smbstatus: avoid a crash with --json output if the access_mask has ↵Ralph Boehme1-0/+1
SEC_STD_WRITE_OWNER This was missing in access_mask[] triggering an assert when printing the access mask string: ... #4 0x00007ffff79553cc in smb_panic (why=0x207b5c "assert failed: tomap == 0") at ../../lib/util/fault.c:209 #5 0x000000000021ea2c in map_mask_to_json (root_json=0x7fffffffcd60, tomap=524288, table=0x223440 <access_mask>) at ../../source3/utils/status_json.c:142 ... Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-09-10source3/utils: Follow up to the fix for CID 1508980Anoop C S1-2/+2
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>
2025-09-10utils: Fixing CID 1509038 for time_t in DEBUG statementRabinarayan Panigrahi1-2/+2
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
2025-09-10utils: Fixing CID 1509034 for time_t in DEBUG statementRabinarayan Panigrahi1-2/+2
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>
2025-09-10utils: Fixing CID 1508980 for time_t in DEBUG statementRabinarayan Panigrahi1-2/+2
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>
2025-09-05s3:net: Pass down the server from cmdline to sync_pw2keytabs()Andreas Schneider2-5/+7
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
2025-09-04s3:net: fix "net ads group"MikeLiu1-1/+1
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
2025-08-26utils/smbtree: do not crash with no password (-N)Douglas Bagnall1-2/+7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15170 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-08-25s3:utils: Keep password secret in ntlm_auth get_password()Andreas Schneider1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15893 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2025-08-22smbd: Make a few encryption-related functions static to smbstatusVolker Lendecke1-0/+32
Only referenced there, I got confused by them being part of smbd Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-08-13s3-utils: Fix CID #1517309 Resource leak in net offlinejoin code.Günther Deschner1-0/+4
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Aug 13 01:51:11 UTC 2025 on atb-devel-224
2025-08-09utils: Fix memory leak CID:1499405Vinit Agnihotri1-0/+1
free memory allocated to status on error condition. Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Aug 9 07:37:05 UTC 2025 on atb-devel-224
2025-08-05net: add `net tdb smbXsrv wipedbs` alias for `net serverid wipedbs`Ralph Boehme3-2/+27
`net serverid` is imho not the right place for the wipedbs functionality. Add it as an alias to `net tdb`. It works pretty opaque and unless you run # net tdb smbXsrv wipedbs --help Usage: net serverid wipedbs [--test] [--verbose] Example: net serverid wipedbs -v the use won't notice it is an alias. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-08-05net: handle replay records in `net serverid wipedbs`Ralph Boehme1-23/+219
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-08-05smbd: return replay-cache records in smbXsrv_open_global_traverse()Ralph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2025-08-05s3:utils: Allow ROLE_IPA_DC to allow to use Kerberos in gensecPavel Filipenský1-1/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15891 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Aug 5 14:51:51 UTC 2025 on atb-devel-224
2025-07-24s3-net: fix "net ads kerberos" krb5ccname handlingGünther Deschner3-3/+19
We can only rely on KRB5CCNAME being set, --use-krb5-ccname content is not available. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15840 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Jul 24 17:31:14 UTC 2025 on atb-devel-224
2025-07-17libcli/smb: define SMB_TRANSPORT_TYPE_QUICStefan Metzmacher1-0/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-07-01s3:utils: Allocate memory on the frame in ntlm_auth main function.Andreas Schneider1-3/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2025-07-01s3:utils: Fix memory leaks in manage_ntlm_server_1_request()Andreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2025-07-01s3:utils: Fix memory leaks in test_ntlm_in_lm()Andreas Schneider1-5/+7
Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x7f597eefc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7f597eae3c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783 #2 0x7f597eae5acf in __talloc ../../lib/talloc/talloc.c:825 #3 0x7f597eae5acf in _talloc_named_const ../../lib/talloc/talloc.c:982 #4 0x7f597eae5acf in _talloc_array ../../lib/talloc/talloc.c:2784 #5 0x7f597e865a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58 #6 0x7f597e865b1b in data_blob_named ../../lib/util/data_blob.c:40 #7 0x55a95a1a389c in get_challenge ../../source3/utils/ntlm_auth.c:375 #8 0x55a95a1aa724 in test_ntlm_in_lm ../../source3/utils/ntlm_auth_diagnostics.c:203 #9 0x55a95a1ab947 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:721 #10 0x55a95a1a7efd in main ../../source3/utils/ntlm_auth.c:2855 #11 0x7f597b62a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2025-07-01s3:utils: Fix memory leaks in test_lmv2_ntlmv2_broken()Andreas Schneider1-8/+10
Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x7f48254fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7f48250d9c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783 #2 0x7f48250dbacf in __talloc ../../lib/talloc/talloc.c:825 #3 0x7f48250dbacf in _talloc_named_const ../../lib/talloc/talloc.c:982 #4 0x7f48250dbacf in _talloc_array ../../lib/talloc/talloc.c:2784 #5 0x7f4824e59a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58 #6 0x7f4824e59b1b in data_blob_named ../../lib/util/data_blob.c:40 #7 0x56084d20789c in get_challenge ../../source3/utils/ntlm_auth.c:375 #8 0x56084d20f0b9 in test_lmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:381 #9 0x56084d20f92e in test_ntlmv2 ../../source3/utils/ntlm_auth_diagnostics.c:474 #10 0x56084d20f9ae in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:718 #11 0x56084d20befd in main ../../source3/utils/ntlm_auth.c:2855 #12 0x7f4821c2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2025-07-01s3:utils: Fix memory leaks in test_lm_ntlm_broken()Andreas Schneider1-8/+8
Direct leak of 104 byte(s) in 1 object(s) allocated from: #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783 #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825 #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982 #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784 #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58 #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40 #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375 #8 0x55b8512fe1a1 in test_lm_ntlm_broken ../../source3/utils/ntlm_auth_diagnostics.c:63 #9 0x55b8512fec4e in test_lm_ntlm ../../source3/utils/ntlm_auth_diagnostics.c:477 #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8513000c1 in test_lmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:379\n #9 0x55b851300926 in test_lmv2_ntlmv2 ../../source3/utils/ntlm_auth_diagnostics.c:454\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8512ff72c in test_ntlm_in_lm ../../source3/utils/ntlm_auth_diagnostics.c:202\n #9 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #10 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #11 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8512fee10 in test_ntlm_in_both ../../source3/utils/ntlm_auth_diagnostics.c:291\n #9 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #10 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #11 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8513000c1 in test_lmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:379\n #9 0x55b851300936 in test_ntlmv2 ../../source3/utils/ntlm_auth_diagnostics.c:472\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8512fe1a1 in test_lm_ntlm_broken ../../source3/utils/ntlm_auth_diagnostics.c:63\n #9 0x55b8512fec3a in test_ntlm ../../source3/utils/ntlm_auth_diagnostics.c:185\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8513000c1 in test_lmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:379\n #9 0x55b851300916 in test_lmv2 ../../source3/utils/ntlm_auth_diagnostics.c:463\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8513000c1 in test_lmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:379\n #9 0x55b851300906 in test_ntlmv2_lmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:492\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8513000c1 in test_lmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:379\n #9 0x55b8513008f6 in test_ntlmv2_ntlmv2_broken ../../source3/utils/ntlm_auth_diagnostics.c:497\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8512fe1a1 in test_lm_ntlm_broken ../../source3/utils/ntlm_auth_diagnostics.c:63\n #9 0x55b8512fec26 in test_ntlm_lm_broken ../../source3/utils/ntlm_auth_diagnostics.c:482\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\nDirect leak of 104 byte(s) in 1 object(s) allocated from:\n #0 0x7f72126fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69\n #1 0x7f72122e8c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783\n #2 0x7f72122eaacf in __talloc ../../lib/talloc/talloc.c:825\n #3 0x7f72122eaacf in _talloc_named_const ../../lib/talloc/talloc.c:982\n #4 0x7f72122eaacf in _talloc_array ../../lib/talloc/talloc.c:2784\n #5 0x7f72118f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58\n #6 0x7f72118f6b1b in data_blob_named ../../lib/util/data_blob.c:40\n #7 0x55b8512f889c in get_challenge ../../source3/utils/ntlm_auth.c:375\n #8 0x55b8512fe1a1 in test_lm_ntlm_broken ../../source3/utils/ntlm_auth_diagnostics.c:63\n #9 0x55b8512fec62 in test_lm ../../source3/utils/ntlm_auth_diagnostics.c:176\n #10 0x55b8513009b6 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:716\n #11 0x55b8512fcefd in main ../../source3/utils/ntlm_auth.c:2855\n #12 0x7f720ee2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58\n\n-----------------------------------------------------\nSuppressions used:\n count bytes template\n 1 125 libpopt.so\n-----------------------------------------------------\n\nSUMMARY: AddressSanitizer: 1144 byte(s) leaked in 11 allocation(s).\n''; message: expected return code 0; got 1 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2025-07-01s3:utils: Fix memory leaks in test_ntlm_in_both()Andreas Schneider1-5/+7
Direct leak of 112 byte(s) in 1 object(s) allocated from: #0 0x7ff61d8fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7ff61d450c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783 #2 0x7ff61d452acf in __talloc ../../lib/talloc/talloc.c:825 #3 0x7ff61d452acf in _talloc_named_const ../../lib/talloc/talloc.c:982 #4 0x7ff61d452acf in _talloc_array ../../lib/talloc/talloc.c:2784 #5 0x7ff61c9f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58 #6 0x7ff61c9f6b1b in data_blob_named ../../lib/util/data_blob.c:40 #7 0x561cafffad96 in test_ntlm_in_both ../../source3/utils/ntlm_auth_diagnostics.c:285 #8 0x561cafffc8d4 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:714 #9 0x561cafff8efd in main ../../source3/utils/ntlm_auth.c:2855 #10 0x7ff61a02a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2025-06-23s3/smb_prometheus_endpoint: export per-share profile statsShachar Sharon1-145/+333
Iterate over per-share TDB entries (is exists) and export as Prometheus metrics via call-back function. Allow passing share-name as additional label to Prometheus metrics. By default, use empty label to follow OpenMetrics[1] conventions ("Empty label values SHOULD be treated as if the label was not present"). [1] https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md Signed-off-by: Shachar Sharon <ssharon@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-23status: dump only relevant sections of per-shareShachar Sharon1-1/+1
Some profile sections are not relevant for per-share profile counters. Ignore non-implemented section with all-zeros (avoid confusion). Signed-off-by: Shachar Sharon <ssharon@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-23status: dump per-share profile countersShachar Sharon4-27/+167
When dumping profile information, try to iterate also on per-share profile entries and emit (json format). Signed-off-by: Shachar Sharon <ssharon@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-06-16libsmb: Remove "source3/libsmb/libsmb.h"Volker Lendecke14-14/+26
libsmb.h added ads_status.h and cli_smb2_fnum.h. Only few users need either. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-06-14net: Fix a panic in "net vfs getntacl"Volker Lendecke1-0/+1
We have to explicitly free smb_fname, because after openat_pathref_fsp we have a file descriptor around. If we then later talloc_free() the connection_struct, fd_handle_destructor() panics because talloc_free() does not free smb_fname before the connection_struct. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2025-05-28Fix clang 20 format-nonliteral warningsGary Lockyer1-2/+1
Fix: /source3/utils/smbcacls.c:1619:35 error: format string is not a string literal [-Werror -Wformat-non-literal] 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>
2025-05-16utils: Fix CID 1638831 Division or modulo by zeroShwetha K Acharya1-2/+5
The conditions now == start or pos == start_pos are checked at the beginning of the function definition to ensure that avg is non zero. Also an appropriate print statement is added to indicate the print status. Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri May 16 07:10:57 UTC 2025 on atb-devel-224
2025-05-16utils: Fix CID 242227 resource leakShwetha K Acharya1-0/+1
Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-05-15utils: Fix a commentVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>