]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 weeks agos4:lib/tls: add tstream_tls_ngtcp2_connect_send/recv
Stefan Metzmacher [Sun, 4 May 2025 16:20:56 +0000 (18:20 +0200)] 
s4:lib/tls: add tstream_tls_ngtcp2_connect_send/recv

This implemented a tstream_context for a single QUIC
stream using libngtcp2 over an udp socket.

This will allow us to support the SMB over QUIC protocol
on the client side even without quic.ko kernel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agolib/tsocket: optimize tdgram_recvfrom_done() into tdgram_recvfrom_send()
Stefan Metzmacher [Fri, 16 May 2025 14:29:19 +0000 (16:29 +0200)] 
lib/tsocket: optimize tdgram_recvfrom_done() into tdgram_recvfrom_send()

For callers using tdgram_bsd_optimize_recvfrom() it is every useful
to know it data was already waiting in the socket.

In that case the result from tdgram_bsd_recvfrom_send() would
already report tevent_req_is_in_progress() as false.

But the result of tdgram_recvfrom_send() available to the
caller would see tevent_req_is_in_progress() reporting true.

With this change also the result of tdgram_recvfrom_send()
would report tevent_req_is_in_progress() as false,
which will be useful for callers, which would otherwise
set a timeout on the request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over quic_ko_wrapper
Stefan Metzmacher [Tue, 29 Apr 2025 14:20:35 +0000 (16:20 +0200)] 
s3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over quic_ko_wrapper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agoselftest: let 'fileserver' support quic
Stefan Metzmacher [Fri, 2 May 2025 10:48:21 +0000 (12:48 +0200)] 
selftest: let 'fileserver' support quic

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agoselftest: use quic_ko_wrapper if available
Stefan Metzmacher [Tue, 22 Apr 2025 10:26:19 +0000 (12:26 +0200)] 
selftest: use quic_ko_wrapper if available

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agothird_party: add quic_ko_wrapper to simulate IPPROTO_QUIC sockets
Stefan Metzmacher [Fri, 2 May 2025 12:44:42 +0000 (14:44 +0200)] 
third_party: add quic_ko_wrapper to simulate IPPROTO_QUIC sockets

For now this is only part of Samba, so no real third_party,
but in future we may decide have a standalone repository
or move it to https://github.com/lxin/quic.git

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agothird_party: import ngtcp2 v1.13.0 from https://github.com/ngtcp2/ngtcp2.git
Stefan Metzmacher [Fri, 2 May 2025 12:32:11 +0000 (14:32 +0200)] 
third_party: import ngtcp2 v1.13.0 from https://github.com/ngtcp2/ngtcp2.git

This imports commit 7dd482f949f145632c482d01af2184954b471795.

It will be used to implement a quic_ko_wrapper, but also
used as userspace client too.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3:libsmb: add support for SMB_TRANSPORT_TYPE_QUIC
Stefan Metzmacher [Thu, 3 Apr 2025 23:17:19 +0000 (01:17 +0200)] 
s3:libsmb: add support for SMB_TRANSPORT_TYPE_QUIC

This requires https://github.com/lxin/quic, which provides a kernel
module quic.ko for Linux (tested with Linux 6.8 and 6.14).

The userspace libquic is mirrored under third_party/quic for now.

This can be activated by adding 'quic' to 'client smb transports'.

The following smb.conf options are also relevant:
'tls enabled'
'tls ca directories'
'tls trust system cas'
'tls cafile'
'tls crlfile'
'tls verify peer'

Note that tools like smbclient are able to take
--option='client smb transports = quic" --option='tls verify peer=no_check'
in order to test it without changing smb.conf,
You may not want to use 'tls verify peer=no_check' for
production, it would make the transport as unprotected
as a tcp connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3:smbd: add support for SMB_TRANSPORT_TYPE_QUIC
Stefan Metzmacher [Thu, 3 Apr 2025 15:32:58 +0000 (17:32 +0200)] 
s3:smbd: add support for SMB_TRANSPORT_TYPE_QUIC

This requires https://github.com/lxin/quic, which provides a kernel
module quic.ko for Linux (tested with Linux 6.8 and 6.14).

The userspace libquic is mirrored under third_party/quic for now.

This can be activated by adding 'quic' to 'server smb transports'.

The following smb.conf options are also relevant:
'tls enabled'
'tls cafile'
'tls certfile'
'tls keyfile'

If the files pointed to by 'tls cafile', 'tls certfile' and
'tls keyfile' all don't exist, self-signed tls certificates are
generated automatically at startup.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos4:lib/tls: add tstream_tls_params_quic_{prepare,enabled() and tstream_tls_quic_hands...
Stefan Metzmacher [Mon, 7 Apr 2025 11:46:23 +0000 (13:46 +0200)] 
s4:lib/tls: add tstream_tls_params_quic_{prepare,enabled() and tstream_tls_quic_handshake[_{send,recv}]()

This requires https://github.com/lxin/quic, which provides a kernel
module quic.ko for Linux (tested with Linux 6.8 and 6.14).

The userspace libquic is mirrored under third_party/quic for now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agothird_party: import quic from https://github.com/lxin/quic.git
Stefan Metzmacher [Tue, 15 Apr 2025 09:00:17 +0000 (11:00 +0200)] 
third_party: import quic from https://github.com/lxin/quic.git

For now the VERSION argument to third_party/quic/update.sh
is ignored as there are no versions yet. For now we require
version 1.1 (not releases) for a system library, in order to make sure
it is recent enough.

This import is based on commit 846dddb24f007c8356ce3c19c74445160a8d94f7.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agosystem_gnutls: print the found gnutls version and detected features
Stefan Metzmacher [Wed, 16 Apr 2025 18:15:07 +0000 (20:15 +0200)] 
system_gnutls: print the found gnutls version and detected features

This makes it easier to analyze build failures.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agolib/param: allow smb_transport[s]_parse() to handle 'quic'
Stefan Metzmacher [Thu, 3 Apr 2025 15:04:13 +0000 (17:04 +0200)] 
lib/param: allow smb_transport[s]_parse() to handle 'quic'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agolibcli/smb: define SMB_TRANSPORT_TYPE_QUIC
Stefan Metzmacher [Thu, 3 Apr 2025 15:03:57 +0000 (17:03 +0200)] 
libcli/smb: define SMB_TRANSPORT_TYPE_QUIC

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoAdd check for the GPO link to have at least two attributes separated by semicolumn...
Aleksandr Sharov [Fri, 4 Jul 2025 13:32:28 +0000 (15:32 +0200)] 
Add check for the GPO link to have at least two attributes separated by semicolumn. Allows to handle empty links.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15877
RN: Fix handling of empty GPO link

Singed-off-by: Alex Sharov (kororland@gmail.com)
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 10 18:55:33 UTC 2025 on atb-devel-224

4 weeks agotests: Rename local variable: prefix_abs -> prefix
Pavel Filipenský [Fri, 4 Jul 2025 13:10:58 +0000 (15:10 +0200)] 
tests: Rename local variable: prefix_abs -> prefix

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 10 16:15:24 UTC 2025 on atb-devel-224

4 weeks agoselftest: Remove no longer used PREFIX_ABS from environment
Pavel Filipenský [Thu, 3 Jul 2025 21:18:59 +0000 (23:18 +0200)] 
selftest: Remove no longer used PREFIX_ABS from environment

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agotests: Replace PREFIX_ABS with PREFIX
Pavel Filipenský [Thu, 3 Jul 2025 21:07:37 +0000 (23:07 +0200)] 
tests: Replace PREFIX_ABS with PREFIX

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest:s4: Delete no longer used hash key 'prefix_abs' from ctx
Pavel Filipenský [Thu, 3 Jul 2025 20:49:10 +0000 (22:49 +0200)] 
selftest:s4: Delete no longer used hash key 'prefix_abs' from ctx

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest: Remove prefix_abs from ctx hash key
Pavel Filipenský [Thu, 3 Jul 2025 20:48:38 +0000 (22:48 +0200)] 
selftest: Remove prefix_abs from ctx hash key

prefix is an absolute path now.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest:s4: Fix prefix in setup functions
Pavel Filipenský [Thu, 3 Jul 2025 20:39:00 +0000 (22:39 +0200)] 
selftest:s4: Fix prefix in setup functions

The parameter '$prefix' passed to setup_...() is already an absolute
path, no need to maintain '$prefix_abs' in Samba4.pm.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest:s3: Fix prefix in setup functions
Pavel Filipenský [Thu, 3 Jul 2025 21:32:30 +0000 (23:32 +0200)] 
selftest:s3: Fix prefix in setup functions

The parameter '$prefix' passed to setup_...() is already an absolute
path, no need to maintain '$prefix_abs' in Samba3.pm.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest: Make '$prefix' absolute path and remove '$prefix_abs'
Pavel Filipenský [Thu, 3 Jul 2025 19:56:59 +0000 (21:56 +0200)] 
selftest: Make '$prefix' absolute path and remove '$prefix_abs'

This fixes the issue with failing test

make -j20 test TESTS="samba4.blackbox.samba-tool_ntacl.ad_member"

Due to ./st/ntacl_testdirtop/dir1/symlink: broken symbolic link
to ./st/ntacl_testdirtop/testfile

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agos3:winbind: Initialize and setup idmap child in winbindd_getgrnam()
Samuel Cabrero [Mon, 7 Jul 2025 11:15:43 +0000 (13:15 +0200)] 
s3:winbind: Initialize and setup idmap child in winbindd_getgrnam()

Make sure the idmap child is initialized before delegating the name unmapping.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Tue Jul  8 07:21:26 UTC 2025 on atb-devel-224

4 weeks agos3:winbind: Initialize and setup idmap child in winbindd_getpwnam()
Samuel Cabrero [Mon, 7 Jul 2025 11:04:15 +0000 (13:04 +0200)] 
s3:winbind: Initialize and setup idmap child in winbindd_getpwnam()

Make sure the idmap child is initialized before delegating the name unmapping.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 weeks agosmbd: avoid mangling names in smbd_dirptr_lanman2_match_fn() for POSIX
Ralph Boehme [Sun, 25 May 2025 18:05:59 +0000 (20:05 +0200)] 
smbd: avoid mangling names in smbd_dirptr_lanman2_match_fn() for POSIX

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul  7 17:45:13 UTC 2025 on atb-devel-224

5 weeks agosmbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lan...
Ralph Boehme [Sun, 25 May 2025 18:04:53 +0000 (20:04 +0200)] 
smbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lanman2_dir_entry()

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibsmb: use parse_finfo_posix_info in is_bad_finfo_name()
Ralph Boehme [Mon, 26 May 2025 08:37:42 +0000 (10:37 +0200)] 
libsmb: use parse_finfo_posix_info in is_bad_finfo_name()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibsmb: set finfo->flags.posix in parse_finfo_posix_info()
Ralph Boehme [Mon, 26 May 2025 08:37:18 +0000 (10:37 +0200)] 
libsmb: set finfo->flags.posix in parse_finfo_posix_info()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibsmb: add flags to struct file_info
Ralph Boehme [Mon, 26 May 2025 08:35:21 +0000 (10:35 +0200)] 
libsmb: add flags to struct file_info

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agotests: expand SMB3 POSIX test for Windows illegal characters behaviour
Ralph Boehme [Sun, 25 May 2025 13:15:27 +0000 (15:15 +0200)] 
tests: expand SMB3 POSIX test for Windows illegal characters behaviour

The test was testing file creation, but not FIND behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibads: fix get_kdc_ip_string() ...
Ralph Boehme [Fri, 4 Jul 2025 15:50:40 +0000 (17:50 +0200)] 
libads: fix get_kdc_ip_string() ...

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Jul  7 16:46:29 UTC 2025 on atb-devel-224

5 weeks agos3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name
Günther Deschner [Wed, 2 Jul 2025 19:59:48 +0000 (21:59 +0200)] 
s3-winbindd: Fix internal winbind dsgetdcname calls w.r.t. domain name

when winbind calls to dsgetdcname internally, make sure to
prefer the DNS domain name if we have it. Makes DNS lookups much more
likely to succeed.

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jul  7 10:44:37 UTC 2025 on atb-devel-224

5 weeks agos3:winbindd: avoid using any netlogon call to get a dc name
Stefan Metzmacher [Fri, 9 May 2025 07:38:41 +0000 (09:38 +0200)] 
s3:winbindd: avoid using any netlogon call to get a dc name

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 weeks agorpc registry: add ProductType for AD DC
Michael Saxl [Wed, 28 May 2025 14:49:13 +0000 (16:49 +0200)] 
rpc registry: add ProductType for AD DC

HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions contains a key
ProductType

The value of that key should be LanmanNT on a domain controller (of any
type).
The switch had no case for ROLE_ACTIVE_DIRECTORY_DC

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15863
Signed-off-by: Michael Saxl <mike@mwsys.mine.bz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jul  1 09:17:08 UTC 2025 on atb-devel-224

5 weeks agos3:utils: Allocate memory on the frame in ntlm_auth main function.
Andreas Schneider [Wed, 25 Jun 2025 13:49:46 +0000 (15:49 +0200)] 
s3:utils: Allocate memory on the frame in ntlm_auth main function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 weeks agos3:utils: Fix memory leaks in manage_ntlm_server_1_request()
Andreas Schneider [Mon, 28 Oct 2024 12:53:02 +0000 (13:53 +0100)] 
s3:utils: Fix memory leaks in manage_ntlm_server_1_request()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 weeks agos3:utils: Fix memory leaks in test_ntlm_in_lm()
Andreas Schneider [Mon, 28 Oct 2024 12:41:01 +0000 (13:41 +0100)] 
s3:utils: Fix memory leaks in test_ntlm_in_lm()

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>
5 weeks agos3:utils: Fix memory leaks in test_lmv2_ntlmv2_broken()
Andreas Schneider [Mon, 28 Oct 2024 12:37:17 +0000 (13:37 +0100)] 
s3:utils: Fix memory leaks in test_lmv2_ntlmv2_broken()

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>
5 weeks agos3:utils: Fix memory leaks in test_lm_ntlm_broken()
Andreas Schneider [Fri, 25 Oct 2024 13:12:26 +0000 (15:12 +0200)] 
s3:utils: Fix memory leaks in test_lm_ntlm_broken()

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>
5 weeks agos3:utils: Fix memory leaks in test_ntlm_in_both()
Andreas Schneider [Fri, 25 Oct 2024 05:56:46 +0000 (07:56 +0200)] 
s3:utils: Fix memory leaks in test_ntlm_in_both()

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>
6 weeks agovfs_ceph_new: Handle the special case of UTIME_NOW
Anoop C S [Sat, 14 Jun 2025 09:02:28 +0000 (14:32 +0530)] 
vfs_ceph_new: Handle the special case of UTIME_NOW

As per utimensat(2)[1]:
. . .
If the tv_nsec field of one of the timespec structures has the special
value UTIME_NOW, then the corresponding file timestamp is set to the
current time.
. . .

Instead of utimes() or futimes() we make use of ceph_ll_setattr() with
appropriate mask to update timsestamps. It is also important to note
that ceph_ll_setattr() does not handle timestamps in pairs of timespec
structs. This had a shortcoming that the special consideration for the
magic value UTIME_NOW was left unattended resulting in epoch timestamps.
Therefore we reset those timestamps where UTIME_NOW is set in tv_nsec
with the current time.

[1] https://www.man7.org/linux/man-pages/man2/utimensat.2.html

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jun 30 14:16:52 UTC 2025 on atb-devel-224

6 weeks agovfs_ceph: Handle the special case of UTIME_NOW
Anoop C S [Sat, 14 Jun 2025 09:24:52 +0000 (14:54 +0530)] 
vfs_ceph: Handle the special case of UTIME_NOW

As per utimensat(2)[1]:
. . .
If the tv_nsec field of one of the timespec structures has the special
value UTIME_NOW, then the corresponding file timestamp is set to the
current time.
. . .

Instead of utimes() or futimes() we make use of ceph_setattrx() with
appropriate mask to update timsestamps. It is also important to note
that ceph_setattrx() does not handle timestamps in pairs of timespec
structs. This had a shortcoming that the special consideration for the
magic value UTIME_NOW was left unattended resulting in epoch timestamps.
Therefore we reset those timestamps where UTIME_NOW is set in tv_nsec
with the current time.

[1] https://www.man7.org/linux/man-pages/man2/utimensat.2.html

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 weeks agovfs_ceph: Add ctime processing to SMB_VFS_FNTIMES
Anoop C S [Sat, 14 Jun 2025 08:59:00 +0000 (14:29 +0530)] 
vfs_ceph: Add ctime processing to SMB_VFS_FNTIMES

ctime was only missing from the list of timestamps processed for various
checks.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
6 weeks agos3:winbind: Correct spelling in debug messages related to ADS
Daniel Widrick [Tue, 24 Jun 2025 02:07:44 +0000 (22:07 -0400)] 
s3:winbind: Correct spelling in debug messages related to ADS

Corrected spelling of 'security' from 'secuirity' in debug messages related to ADS

Signed-off-by: Daniel Widrick <daniel@widrick.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sat Jun 28 09:04:56 UTC 2025 on atb-devel-224

6 weeks agos3/smbd: Conditionally define smb2_request_to_snum()
Anoop C S [Tue, 24 Jun 2025 09:48:34 +0000 (15:18 +0530)] 
s3/smbd: Conditionally define smb2_request_to_snum()

As of now smb2_request_to_snum() is only meaningful when profiling is
enabled.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Jun 24 14:24:57 UTC 2025 on atb-devel-224

6 weeks agos3:winbind: Delegate normalize_name_unmap to the idmap child in winbindd_getgroups
Samuel Cabrero [Tue, 27 May 2025 11:46:45 +0000 (13:46 +0200)] 
s3:winbind: Delegate normalize_name_unmap to the idmap child in winbindd_getgroups

Delegate name unmapping to the idmap child to avoid blocking the parent while
querying the LDAP server, depending on the idmap configuration.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 24 08:51:39 UTC 2025 on atb-devel-224

6 weeks agos3:winbind: Delegate normalize_name_unmap to the idmap child in winbindd_getpwnam
Samuel Cabrero [Tue, 27 May 2025 11:31:33 +0000 (13:31 +0200)] 
s3:winbind: Delegate normalize_name_unmap to the idmap child in winbindd_getpwnam

Delegate name unmapping to the idmap child to avoid blocking the parent while
querying the LDAP server, depending on the idmap configuration.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agos3:winbind: Delegate normalize_name_unmap to the idmap child in winbindd_getgrnam
Samuel Cabrero [Mon, 26 May 2025 13:23:19 +0000 (15:23 +0200)] 
s3:winbind: Delegate normalize_name_unmap to the idmap child in winbindd_getgrnam

Delegate name unmapping to the idmap child to avoid blocking the parent while
querying the LDAP server, depending on the idmap configuration.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agos3:winbind: Remove unused fill_grent()
Samuel Cabrero [Fri, 23 May 2025 12:26:08 +0000 (14:26 +0200)] 
s3:winbind: Remove unused fill_grent()

This function is no longer used.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agos3:winbind: Delegate normalize_name_map to the idmap child in winbindd_getgrgid
Samuel Cabrero [Fri, 23 May 2025 12:23:57 +0000 (14:23 +0200)] 
s3:winbind: Delegate normalize_name_map to the idmap child in winbindd_getgrgid

Delegate mapping to the idmap child to avoid blocking the parent while querying the
LDAP server, depending on the idmap configuration.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agos3:winbind: Delegate normalize_name_map to the idmap child in winbindd_getgrnam
Samuel Cabrero [Fri, 23 May 2025 11:40:32 +0000 (13:40 +0200)] 
s3:winbind: Delegate normalize_name_map to the idmap child in winbindd_getgrnam

Delegate mapping to the idmap child to avoid blocking the parent while querying the
LDAP server, depending on the idmap configuration.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agos3:winbind: Delegate normalize_name_map to the idmap child in wb_next_grent
Samuel Cabrero [Mon, 26 May 2025 05:54:38 +0000 (07:54 +0200)] 
s3:winbind: Delegate normalize_name_map to the idmap child in wb_next_grent

Delegate mapping to the idmap child to avoid blocking the parent while querying the
LDAP server, depending on the idmap configuration.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agopython:tests/nss: Add NSS group enumeration test
Samuel Cabrero [Mon, 26 May 2025 09:20:13 +0000 (11:20 +0200)] 
python:tests/nss: Add NSS group enumeration test

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 weeks agos3:winbind: Fix debug message
Samuel Cabrero [Fri, 23 May 2025 11:23:01 +0000 (13:23 +0200)] 
s3:winbind: Fix debug message

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 weeks agovfs_ceph_new: use per-share profile macros
Shachar Sharon [Mon, 12 May 2025 09:14:52 +0000 (12:14 +0300)] 
vfs_ceph_new: use per-share profile macros

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jun 23 14:01:51 UTC 2025 on atb-devel-224

7 weeks agovfs_default: use per-share profile macros
Shachar Sharon [Mon, 28 Apr 2025 18:36:39 +0000 (21:36 +0300)] 
vfs_default: use per-share profile macros

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agos3/smb_prometheus_endpoint: export per-share profile stats
Shachar Sharon [Mon, 26 May 2025 08:51:04 +0000 (11:51 +0300)] 
s3/smb_prometheus_endpoint: export per-share profile stats

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>
7 weeks agostatus: dump only relevant sections of per-share
Shachar Sharon [Tue, 20 May 2025 07:27:23 +0000 (10:27 +0300)] 
status: dump only relevant sections of per-share

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>
7 weeks agostatus: dump per-share profile counters
Shachar Sharon [Mon, 28 Apr 2025 18:30:22 +0000 (21:30 +0300)] 
status: dump per-share profile counters

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>
7 weeks agosmbd: smb2-operations per-share profile counters
Shachar Sharon [Tue, 13 May 2025 09:24:15 +0000 (12:24 +0300)] 
smbd: smb2-operations per-share profile counters

Allow per-share profile counters for SMB2 operations.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agosmbd: init per-share profile counters
Shachar Sharon [Mon, 28 Apr 2025 12:11:06 +0000 (15:11 +0300)] 
smbd: init per-share profile counters

When per-share profile counters are enabled, setup/teardown the
profiling entry for specific 'snum' before/after VFS connect/disconnect.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agoparam: allow per-share profiling mode
Shachar Sharon [Sun, 27 Apr 2025 09:18:09 +0000 (12:18 +0300)] 
param: allow per-share profiling mode

Allow per-share profile counters by setting a configure option
'smbd profiling share = yes' on each share which wants this option
enabled. Requires global profiling to be enabled.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agoprofile: reset per-share counters
Shachar Sharon [Thu, 29 May 2025 12:31:46 +0000 (15:31 +0300)] 
profile: reset per-share counters

Allow zero-reset dynamic per-share profile counters when sending
'smbcontrol smbd profile flush' to active smbd.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agoprofile: collect per-share counters from TDB
Shachar Sharon [Mon, 28 Apr 2025 12:06:59 +0000 (15:06 +0300)] 
profile: collect per-share counters from TDB

Helper functions to iterate over per-share profile counters from TDB
file using callback function.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agoprofile: defined helper macros for per-share counters
Shachar Sharon [Mon, 28 Apr 2025 12:00:43 +0000 (15:00 +0300)] 
profile: defined helper macros for per-share counters

Helper macros the use per-share profile counters, using 'snum' as
lookup key.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Co-Authored-By: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agoprofile: dynamic per-share in-memory counters
Shachar Sharon [Mon, 28 Apr 2025 09:05:25 +0000 (12:05 +0300)] 
profile: dynamic per-share in-memory counters

Mechanism to support per-share per-process run-time profiling counters.
Use in-memory cache for storing run-time entries, using 'snum' as key.
When storing in TDB file, uses unique key for each per-share profile
entry.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agoauth: Direct variable initialization
Volker Lendecke [Thu, 19 Jun 2025 15:44:31 +0000 (17:44 +0200)] 
auth: Direct variable initialization

talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 20 11:12:14 UTC 2025 on atb-devel-224

7 weeks agoauth: Remove unused session_info_set_session_key()
Volker Lendecke [Thu, 19 Jun 2025 15:04:35 +0000 (17:04 +0200)] 
auth: Remove unused session_info_set_session_key()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agolibsmb: Slightly simplify cli_tcon_andx_done()
Volker Lendecke [Thu, 19 Jun 2025 11:11:27 +0000 (13:11 +0200)] 
libsmb: Slightly simplify cli_tcon_andx_done()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agolibsmb: Move cli_smb() to source3/torture
Volker Lendecke [Thu, 19 Jun 2025 11:02:17 +0000 (13:02 +0200)] 
libsmb: Move cli_smb() to source3/torture

Only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agolibsmb: Move cli_smbwrite() to source3/torture
Volker Lendecke [Thu, 19 Jun 2025 11:00:18 +0000 (13:00 +0200)] 
libsmb: Move cli_smbwrite() to source3/torture

Only used there

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agotevent: Fix 1649525 Use of 32-bit time_t
Volker Lendecke [Fri, 20 Jun 2025 07:27:23 +0000 (09:27 +0200)] 
tevent: Fix 1649525 Use of 32-bit time_t

Coverity ID "1649525 Use of 32-bit time_t" is correct. What Coverity
does not see is that this routine is the only one assigning to
ev->wait_timeout. Make Coverity happy with the MIN().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agotevent: Fix Coverity ID 1649524 Dereference before null check
Volker Lendecke [Fri, 20 Jun 2025 07:15:56 +0000 (09:15 +0200)] 
tevent: Fix Coverity ID 1649524 Dereference before null check

The only caller of epoll_event_loop gives a non-NULL pointer.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agotevent: Fix Coverity ID 1649526 Dereference before null check
Volker Lendecke [Fri, 20 Jun 2025 07:12:47 +0000 (09:12 +0200)] 
tevent: Fix Coverity ID 1649526 Dereference before null check

The only caller of poll_event_loop_poll gives a non-NULL pointer.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 weeks agolibrpc/idl: Add idl for msDS-KeyCredentialLink
Gary Lockyer [Tue, 10 Jun 2025 21:04:01 +0000 (09:04 +1200)] 
librpc/idl: Add idl for msDS-KeyCredentialLink

Idl and supporting helpers for msDS-KeyCredentialLinks.
See [MS-ADTS] 2.2.20 Key Credential Link Structures

Currently the KeyMaterial is treated as a binary blob

The naming and casing of the variable names is close as is possible to
those in the specification.

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): Thu Jun 19 00:08:31 UTC 2025 on atb-devel-224

7 weeks agos3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over bsd-tstream
Stefan Metzmacher [Thu, 22 May 2025 08:59:46 +0000 (10:59 +0200)] 
s3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over bsd-tstream

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jun 18 19:02:29 UTC 2025 on atb-devel-224

7 weeks agoselftest: don't skip smb2.bench
Stefan Metzmacher [Wed, 30 Apr 2025 11:56:17 +0000 (13:56 +0200)] 
selftest: don't skip smb2.bench

This runs each test for 10 seconds and is a good
stress test for the transport layer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: add 'client smb transport:force_bsd_tstream = yes' option
Stefan Metzmacher [Fri, 16 May 2025 09:46:36 +0000 (11:46 +0200)] 
s3:libsmb: add 'client smb transport:force_bsd_tstream = yes' option

This can be used to force the tstream based code path in smbXcli_conn.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: add smbXcli_transport_bsd_tstream()
Stefan Metzmacher [Fri, 16 May 2025 09:34:37 +0000 (11:34 +0200)] 
libcli/smb: add smbXcli_transport_bsd_tstream()

This can be used to force the usage of the tstream code path even
for bsd sockets.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: add smbXcli_transport_tstream()
Stefan Metzmacher [Wed, 7 May 2025 18:29:55 +0000 (20:29 +0200)] 
libcli/smb: add smbXcli_transport_tstream()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: make read_smb_more non-static
Stefan Metzmacher [Wed, 7 May 2025 19:37:16 +0000 (21:37 +0200)] 
libcli/smb: make read_smb_more non-static

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: abstract transport function calls
Stefan Metzmacher [Wed, 7 May 2025 19:15:20 +0000 (21:15 +0200)] 
libcli/smb: abstract transport function calls

In future we'll have transports without a bsd
socket fd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:client: make use of smbXcli_conn_monitor_once()
Stefan Metzmacher [Thu, 15 May 2025 11:59:00 +0000 (13:59 +0200)] 
s3:client: make use of smbXcli_conn_monitor_once()

This makes it possible to run checks based on
a tevent_context in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: add smbXcli_conn_monitor_{send,recv,once}()
Stefan Metzmacher [Thu, 15 May 2025 11:48:20 +0000 (13:48 +0200)] 
libcli/smb: add smbXcli_conn_monitor_{send,recv,once}()

smbXcli_conn_monitor_{send,recv} can be used to monitor
a connection over a long time. It will only come back
if there's a connection error.

smbXcli_conn_monitor_once() will be used by sync callers
without a long term tevent context and needs to be called
multiple times per second in order to work correctly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: let smbXcli_transport_bsd() take an fd by reference
Stefan Metzmacher [Wed, 21 May 2025 13:25:26 +0000 (15:25 +0200)] 
libcli/smb: let smbXcli_transport_bsd() take an fd by reference

This allows it to set the callers value to -1 when it was moved.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: let smbsock_connect_recv() return smbXcli_transport
Stefan Metzmacher [Wed, 7 May 2025 15:41:14 +0000 (17:41 +0200)] 
s3:libsmb: let smbsock_connect_recv() return smbXcli_transport

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: let smbsock_connect() return smbXcli_transport
Stefan Metzmacher [Wed, 7 May 2025 15:11:49 +0000 (17:11 +0200)] 
s3:libsmb: let smbsock_connect() return smbXcli_transport

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: let smbsock_any_connect_recv return smbXcli_transport
Stefan Metzmacher [Wed, 7 May 2025 13:38:34 +0000 (15:38 +0200)] 
s3:libsmb: let smbsock_any_connect_recv return smbXcli_transport

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos4:libcli: let struct smbcli_socket hold struct smbXcli_transport instead of sockfd
Stefan Metzmacher [Wed, 7 May 2025 14:46:55 +0000 (16:46 +0200)] 
s4:libcli: let struct smbcli_socket hold struct smbXcli_transport instead of sockfd

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: let smbsock_any_connect() return smbXcli_transport
Stefan Metzmacher [Wed, 7 May 2025 13:44:28 +0000 (15:44 +0200)] 
s3:libsmb: let smbsock_any_connect() return smbXcli_transport

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:winbindd: let find_dc() call smbXcli_transport_bsd()
Stefan Metzmacher [Wed, 7 May 2025 14:11:15 +0000 (16:11 +0200)] 
s3:winbindd: let find_dc() call smbXcli_transport_bsd()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:winbindd: let cm_open_connection() call smbXcli_transport_bsd()
Stefan Metzmacher [Wed, 7 May 2025 13:57:05 +0000 (15:57 +0200)] 
s3:winbindd: let cm_open_connection() call smbXcli_transport_bsd()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: let cli_connect_sock_recv() return smbXcli_transport
Stefan Metzmacher [Wed, 7 May 2025 13:22:48 +0000 (15:22 +0200)] 
s3:libsmb: let cli_connect_sock_recv() return smbXcli_transport

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agos3:libsmb: pass smbXcli_transport to cli_state_create()
Stefan Metzmacher [Wed, 7 May 2025 13:01:20 +0000 (15:01 +0200)] 
s3:libsmb: pass smbXcli_transport to cli_state_create()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: pass smbXcli_transport to smbXcli_conn_create()
Stefan Metzmacher [Wed, 7 May 2025 12:30:08 +0000 (14:30 +0200)] 
libcli/smb: pass smbXcli_transport to smbXcli_conn_create()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: let smbXcli_conn_create() call smbXcli_transport_bsd()
Stefan Metzmacher [Wed, 7 May 2025 20:15:40 +0000 (22:15 +0200)] 
libcli/smb: let smbXcli_conn_create() call smbXcli_transport_bsd()

The next step will pass struct smbXcli_transport from the caller.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: introduce smbXcli_transport_bsd
Stefan Metzmacher [Wed, 7 May 2025 12:21:31 +0000 (14:21 +0200)] 
libcli/smb: introduce smbXcli_transport_bsd

The next commits will pass an smbXcli_transport to
smbXcli_conn_create() instead of a plain 'int fd'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agolibcli/smb: merge smb_transport library into cli_smb_common
Stefan Metzmacher [Wed, 7 May 2025 19:35:24 +0000 (21:35 +0200)] 
libcli/smb: merge smb_transport library into cli_smb_common

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 weeks agoasync_sock: add wait_for_error_send/recv
Stefan Metzmacher [Tue, 20 May 2025 18:20:30 +0000 (20:20 +0200)] 
async_sock: add wait_for_error_send/recv

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