]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
12 months agonmbd: Remove the "nmbd proxy logon" feature
Volker Lendecke [Thu, 24 Oct 2024 11:43:09 +0000 (13:43 +0200)] 
nmbd: Remove the "nmbd proxy logon" feature

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
12 months agos3:libsmb: Make parse_node_status() more robust
Andreas Schneider [Fri, 18 Oct 2024 06:07:47 +0000 (08:07 +0200)] 
s3:libsmb: Make parse_node_status() more robust

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Oct 24 12:05:10 UTC 2024 on atb-devel-224

12 months agos3:winbind: Fix heap buffer overflow in winbind
Andreas Schneider [Thu, 17 Oct 2024 17:33:47 +0000 (19:33 +0200)] 
s3:winbind: Fix heap buffer overflow in winbind

==36258==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x51300000b096 at pc 0x7fb6b4880b46 bp 0x7ffc67d44b40 sp 0x7ffc67d44300
READ of size 1 at 0x51300000b096 thread T0
    #0 0x7fb6b4880b45 in strlen ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:391
    #1 0x560fe898cde3 in winbindd_wins_byip_done ../../source3/winbindd/winbindd_wins_byip.c:111
    #2 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #3 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #4 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #5 0x7fb6b1e24c80 in node_status_query_done ../../source3/libsmb/namequery.c:904
    #6 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #7 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #8 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #9 0x7fb6b1e250bc in nb_trans_done ../../source3/libsmb/namequery.c:756
    #10 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #11 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #12 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #13 0x7fb6b1e270af in sock_packet_read_got_socket ../../source3/libsmb/namequery.c:537
    #14 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #15 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #16 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #17 0x7fb6b33db183 in tdgram_recvfrom_done ../../lib/tsocket/tsocket.c:240
    #18 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #19 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #20 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #21 0x7fb6b33e0d99 in tdgram_bsd_recvfrom_handler ../../lib/tsocket/tsocket_bsd.c:1087
    #22 0x7fb6b33e0263 in tdgram_bsd_fde_handler ../../lib/tsocket/tsocket_bsd.c:811
    #23 0x7fb6b4ef5ac1 in tevent_common_invoke_fd_handler ../../lib/tevent/tevent_fd.c:174
    #24 0x7fb6b4f0b185 in epoll_event_loop ../../lib/tevent/tevent_epoll.c:696
    #25 0x7fb6b4f0b185 in epoll_event_loop_once ../../lib/tevent/tevent_epoll.c:926
    #26 0x7fb6b4f037b8 in std_event_loop_once ../../lib/tevent/tevent_standard.c:110
    #27 0x7fb6b4ef3549 in _tevent_loop_once ../../lib/tevent/tevent.c:820
    #28 0x560fe8a15198 in main ../../source3/winbindd/winbindd.c:1729
    #29 0x7fb6afe2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #30 0x7fb6afe2a378 in __libc_start_main_impl ../csu/libc-start.c:360
    #31 0x560fe89454e4 in _start ../sysdeps/x86_64/start.S:115

0x51300000b096 is located 12 bytes after 330-byte region [0x51300000af40,0x51300000b08a)
allocated by thread T0 here:
    #0 0x7fb6b48fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7fb6b3a64c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7fb6b3a66acf in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7fb6b3a66acf in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7fb6b3a66acf in _talloc_array ../../lib/talloc/talloc.c:2784
    #5 0x7fb6b1e2b43e in parse_node_status ../../source3/libsmb/namequery.c:337
    #6 0x7fb6b1e2b43e in node_status_query_recv ../../source3/libsmb/namequery.c:921
    #7 0x560fe898cc4f in winbindd_wins_byip_done ../../source3/winbindd/winbindd_wins_byip.c:87
    #8 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #9 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #10 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #11 0x7fb6b1e24c80 in node_status_query_done ../../source3/libsmb/namequery.c:904
    #12 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #13 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #14 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #15 0x7fb6b1e250bc in nb_trans_done ../../source3/libsmb/namequery.c:756
    #16 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #17 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #18 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #19 0x7fb6b1e270af in sock_packet_read_got_socket ../../source3/libsmb/namequery.c:537
    #20 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #21 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #22 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #23 0x7fb6b33db183 in tdgram_recvfrom_done ../../lib/tsocket/tsocket.c:240
    #24 0x7fb6b4ef8ae5 in _tevent_req_notify_callback ../../lib/tevent/tevent_req.c:177
    #25 0x7fb6b4ef8d1c in tevent_req_finish ../../lib/tevent/tevent_req.c:234
    #26 0x7fb6b4ef8d84 in _tevent_req_done ../../lib/tevent/tevent_req.c:240
    #27 0x7fb6b33e0d99 in tdgram_bsd_recvfrom_handler ../../lib/tsocket/tsocket_bsd.c:1087
    #28 0x7fb6b33e0263 in tdgram_bsd_fde_handler ../../lib/tsocket/tsocket_bsd.c:811
    #29 0x7fb6b4ef5ac1 in tevent_common_invoke_fd_handler ../../lib/tevent/tevent_fd.c:174
    #30 0x7fb6b4f0b185 in epoll_event_loop ../../lib/tevent/tevent_epoll.c:696
    #31 0x7fb6b4f0b185 in epoll_event_loop_once ../../lib/tevent/tevent_epoll.c:926
    #32 0x7fb6b4f037b8 in std_event_loop_once ../../lib/tevent/tevent_standard.c:110
    #33 0x7fb6b4ef3549 in _tevent_loop_once ../../lib/tevent/tevent.c:820

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos3:utils: Fix memory leak in test_lmv2_ntlmv2_broken()
Andreas Schneider [Fri, 18 Oct 2024 13:32:58 +0000 (15:32 +0200)] 
s3:utils: Fix memory leak in test_lmv2_ntlmv2_broken()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos3:utils: Fix memory leak in ntlm_auth_diagnostics
Andreas Schneider [Thu, 17 Oct 2024 13:10:22 +0000 (15:10 +0200)] 
s3:utils: Fix memory leak in ntlm_auth_diagnostics

Direct leak of 120 byte(s) in 1 object(s) allocated from:
    #0 0x7f2f7f0fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7f2f7ee24c57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7f2f7ee26acf in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7f2f7ee26acf in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7f2f7ee26acf in _talloc_array ../../lib/talloc/talloc.c:2784
    #5 0x7f2f7e3f6a99 in data_blob_talloc_named ../../lib/util/data_blob.c:58
    #6 0x7f2f7e3f6b1b in data_blob_named ../../lib/util/data_blob.c:40
    #7 0x5570b9e36100 in test_lm_ntlm_broken ../../source3/utils/ntlm_auth_diagnostics.c:56
    #8 0x5570b9e36b5d in test_ntlm ../../source3/utils/ntlm_auth_diagnostics.c:180
    #9 0x5570b9e387f3 in diagnose_ntlm_auth ../../source3/utils/ntlm_auth_diagnostics.c:707
    #10 0x5570b9e34efd in main ../../source3/utils/ntlm_auth.c:2855
    #11 0x7f2f7ba2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos3:utils: Remove trailing spaces in ntlm_auth_diagnostics.c
Andreas Schneider [Thu, 17 Oct 2024 13:12:02 +0000 (15:12 +0200)] 
s3:utils: Remove trailing spaces in ntlm_auth_diagnostics.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos3:utils: Fix memory leak in ntlm_auth
Andreas Schneider [Tue, 15 Oct 2024 15:49:38 +0000 (17:49 +0200)] 
s3:utils: Fix memory leak in ntlm_auth

Direct leak of 192 byte(s) in 1 object(s) allocated from:
    #0 0x7fc5afefc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7fc5afaefc57 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7fc5afaf18cf in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7fc5afaf18cf in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7fc5afaf18cf in _talloc_zero ../../lib/talloc/talloc.c:2421
    #5 0x7fc5aeac4809 in loadparm_init_s3 ../../lib/param/loadparm.c:3223
    #6 0x560ee34b3949 in main ../../source3/utils/ntlm_auth.c:2806
    #7 0x7fc5ac62a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos4:client: Fix memory leaks in smblcient4
Andreas Schneider [Tue, 15 Oct 2024 15:41:57 +0000 (17:41 +0200)] 
s4:client: Fix memory leaks in smblcient4

==375711==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 20 byte(s) in 1 object(s) allocated from:
    #0 0x7f83838f6880 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x55a06cc7c244 in main ../../source4/client/client.c:3470
    #2 0x7f837fe2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos4:client: Remove trailing spaces in client.c
Andreas Schneider [Wed, 16 Oct 2024 06:46:43 +0000 (08:46 +0200)] 
s4:client: Remove trailing spaces in client.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos4:torture: Fix memory leak in torture_decode_compare_pac()
Andreas Schneider [Thu, 17 Oct 2024 13:04:34 +0000 (15:04 +0200)] 
s4:torture: Fix memory leak in torture_decode_compare_pac()

Direct leak of 200 byte(s) in 1 object(s) allocated from:
    #0 0x7f42972fc130 in calloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7f4296cf3054 in wbcAllocateMemory ../../nsswitch/libwbclient/wbclient.c:216
    #2 0x7f4296cf386c in wbc_create_auth_info ../../nsswitch/libwbclient/wbc_pam.c:96
    #3 0x7f4296cf59a1 in wbcCtxAuthenticateUserEx ../../nsswitch/libwbclient/wbc_pam.c:561
    #4 0x7f4296cf5d98 in wbcAuthenticateUserEx ../../nsswitch/libwbclient/wbc_pam.c:578
    #5 0x55f8ff6023f1 in torture_decode_compare_pac ../../source4/torture/winbind/winbind.c:120
    #6 0x55f8ff6023f1 in torture_winbind_pac ../../source4/torture/winbind/winbind.c:291
    #7 0x55f8ff603c98 in torture_winbind_pac_gss_spnego ../../source4/torture/winbind/winbind.c:303
    #8 0x7f4295ff560c in wrap_simple_test ../../lib/torture/torture.c:712
    #9 0x7f4295ff748d in internal_torture_run_test ../../lib/torture/torture.c:520
    #10 0x7f4295ff7904 in torture_run_tcase_restricted ../../lib/torture/torture.c:585
    #11 0x7f4295ff7e69 in torture_run_suite_restricted ../../lib/torture/torture.c:439
    #12 0x55f8ff7980ba in run_matching ../../source4/torture/smbtorture.c:96
    #13 0x55f8ff798141 in run_matching ../../source4/torture/smbtorture.c:106
    #14 0x55f8ff798e41 in torture_run_named_tests ../../source4/torture/smbtorture.c:173
    #15 0x55f8ff79cf03 in main ../../source4/torture/smbtorture.c:754
    #16 0x7f4291a2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agos4:torture: Remove trailing spaces in winbind.c
Andreas Schneider [Thu, 17 Oct 2024 13:11:26 +0000 (15:11 +0200)] 
s4:torture: Remove trailing spaces in winbind.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agonsswitch: Fix memory leak in wbcDomainInfoList
Andreas Schneider [Tue, 15 Oct 2024 15:46:24 +0000 (17:46 +0200)] 
nsswitch: Fix memory leak in wbcDomainInfoList

==379167==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 44 byte(s) in 2 object(s) allocated from:
    #0 0x7f54522f6880 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x7f54520d5a95 in process_domain_info_string ../../nsswitch/libwbclient/wbc_util.c:471
    #2 0x7f54520d5a95 in wbcCtxListTrusts ../../nsswitch/libwbclient/wbc_util.c:612
    #3 0x7f54520d6426 in wbcListTrusts ../../nsswitch/libwbclient/wbc_util.c:632
    #4 0x558c48799cf7 in wbinfo_list_domains ../../nsswitch/wbinfo.c:515
    #5 0x558c487a72db in main ../../nsswitch/wbinfo.c:3300
    #6 0x7f544f42a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agonsswitch: Fix memory leak in nsstest
Andreas Schneider [Tue, 15 Oct 2024 15:12:07 +0000 (17:12 +0200)] 
nsswitch: Fix memory leak in nsstest

Direct leak of 832 byte(s) in 13 object(s) allocated from:
    #0 0x7efc8e0fc777 in malloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x562cb6e96d44 in nss_test_initgroups ../../nsswitch/nsstest.c:381
    #2 0x562cb6e96d44 in nss_test_users ../../nsswitch/nsstest.c:424
    #3 0x562cb6e96d44 in main ../../nsswitch/nsstest.c:493
    #4 0x7efc8dc2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agonsswitch: Fix memory leak in wbinfo_auth_krb5()
Andreas Schneider [Tue, 15 Oct 2024 06:51:43 +0000 (08:51 +0200)] 
nsswitch: Fix memory leak in wbinfo_auth_krb5()

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ff206afc130 in calloc ../../../../libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7ff206837054 in wbcAllocateMemory ../../nsswitch/libwbclient/wbclient.c:216
    #2 0x7ff20683c76a in wbc_create_password_policy_info ../../nsswitch/libwbclient/wbc_pam.c:295
    #3 0x7ff20683c76a in wbcCtxLogonUser ../../nsswitch/libwbclient/wbc_pam.c:1290
    #4 0x7ff20683caec in wbcLogonUser ../../nsswitch/libwbclient/wbc_pam.c:1307
    #5 0x556ea348db12 in wbinfo_auth_krb5 ../../nsswitch/wbinfo.c:1723
    #6 0x556ea348db12 in main ../../nsswitch/wbinfo.c:3238
    #7 0x7ff203c2a2ad in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 months agoFix pam failure to register Pin following mfa poll
David Mulder [Mon, 9 Sep 2024 19:30:55 +0000 (13:30 -0600)] 
Fix pam failure to register Pin following mfa poll

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Wed Oct 23 15:39:09 UTC 2024 on atb-devel-224

12 months agoautobuild: Configure samba-o3 for himmelblau testing
David Mulder [Fri, 30 Aug 2024 14:58:43 +0000 (08:58 -0600)] 
autobuild: Configure samba-o3 for himmelblau testing

The 'samba' build excludes the 'none' tests,
which is where the Rust tests are located.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoFix usage test broken by rust vendor sources
David Mulder [Thu, 29 Aug 2024 20:09:56 +0000 (14:09 -0600)] 
Fix usage test broken by rust vendor sources

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoautobuild: Only enable rust build if cargo exists
David Mulder [Thu, 29 Aug 2024 17:22:59 +0000 (11:22 -0600)] 
autobuild: Only enable rust build if cargo exists

We need to do this to prevent CI systems which
are missing cargo (Debian) from attempting to
configure with Rust.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd configure checks for glibc and openssl versions
David Mulder [Wed, 28 Aug 2024 20:32:30 +0000 (14:32 -0600)] 
Add configure checks for glibc and openssl versions

Add configure checks to determine if rust or
specifically himmelblau sources can be compiled.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoglibc needs to be at least vers 2.32 for rust
David Mulder [Wed, 28 Aug 2024 19:34:09 +0000 (13:34 -0600)] 
glibc needs to be at least vers 2.32 for rust

The libc crate won't build on versions older than
2.32.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoautobuild: Only configure himmelblau if openssl >= 3
David Mulder [Tue, 27 Aug 2024 21:39:36 +0000 (15:39 -0600)] 
autobuild: Only configure himmelblau if openssl >= 3

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd pyglue for Rust for disabling tests
David Mulder [Tue, 27 Aug 2024 21:06:02 +0000 (15:06 -0600)] 
Add pyglue for Rust for disabling tests

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoDisable the rust build by default
David Mulder [Tue, 27 Aug 2024 20:47:29 +0000 (14:47 -0600)] 
Disable the rust build by default

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoFix Rocky8 build for utf8proc-devel
David Mulder [Tue, 27 Aug 2024 20:26:45 +0000 (14:26 -0600)] 
Fix Rocky8 build for utf8proc-devel

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoFix pam echo not displayed via ssh
David Mulder [Mon, 26 Aug 2024 17:06:31 +0000 (11:06 -0600)] 
Fix pam echo not displayed via ssh

Necessary because of OpenSSH bug
https://bugzilla.mindrot.org/show_bug.cgi?id=2876 -
PAM_TEXT_INFO and PAM_ERROR_MSG conversation not
honoured during PAM authentication

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd the user's primary group to the cache
David Mulder [Mon, 26 Aug 2024 13:33:25 +0000 (07:33 -0600)] 
Add the user's primary group to the cache

We create a fake primary group which simply
matches the user's upn. This is because Entra ID
does not have primary groups, but we can fake it
with a primary group which is a member of all the
users groups.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoFetch the target join os via std::env::consts
David Mulder [Fri, 23 Aug 2024 21:27:51 +0000 (15:27 -0600)] 
Fetch the target join os via std::env::consts

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoProperly handle read/write from the client socket
David Mulder [Fri, 23 Aug 2024 20:51:24 +0000 (14:51 -0600)] 
Properly handle read/write from the client socket

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoEnsure clients can write to the himmelblau pipe
David Mulder [Fri, 23 Aug 2024 20:29:49 +0000 (14:29 -0600)] 
Ensure clients can write to the himmelblau pipe

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoRemove the existing socket if present
David Mulder [Fri, 23 Aug 2024 20:07:08 +0000 (14:07 -0600)] 
Remove the existing socket if present

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoUse the s4 param functions to access idmap values
David Mulder [Fri, 23 Aug 2024 18:45:44 +0000 (12:45 -0600)] 
Use the s4 param functions to access idmap values

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAlways print a newline at the end of debug msgs
David Mulder [Fri, 23 Aug 2024 15:02:51 +0000 (09:02 -0600)] 
Always print a newline at the end of debug msgs

Otherwise the message doesn't flush to the log
and could be lost when the program terminates.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd talloc stackframe handling
David Mulder [Fri, 23 Aug 2024 14:02:01 +0000 (08:02 -0600)] 
Add talloc stackframe handling

This appeases errors from libsmbconf that no
talloc stackframe was created.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoFix display of function names in debug
David Mulder [Thu, 22 Aug 2024 21:23:15 +0000 (15:23 -0600)] 
Fix display of function names in debug

Rust adds some odd `{{closure}}` bits to the
function name that need to be removed, otherwise
the debug is unreadable.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd warnings for missing directories at runtime
David Mulder [Thu, 22 Aug 2024 20:46:17 +0000 (14:46 -0600)] 
Add warnings for missing directories at runtime

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoOnly set the debug logfile if not stdout
David Mulder [Thu, 22 Aug 2024 20:24:31 +0000 (14:24 -0600)] 
Only set the debug logfile if not stdout

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd tests for rust himmelblaud build
David Mulder [Thu, 22 Aug 2024 14:16:44 +0000 (08:16 -0600)] 
Add tests for rust himmelblaud build

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAlways normalize cache inputs to lowercase
David Mulder [Thu, 22 Aug 2024 18:54:32 +0000 (12:54 -0600)] 
Always normalize cache inputs to lowercase

This prevents mixed case issues when storing/
retrieving data from the cache.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd tests for rust dbg crate
David Mulder [Tue, 13 Aug 2024 21:18:09 +0000 (15:18 -0600)] 
Add tests for rust dbg crate

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoImprove cargo test output
David Mulder [Tue, 13 Aug 2024 21:06:42 +0000 (15:06 -0600)] 
Improve cargo test output

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd USING_SYSTEM_TDB test for rust config
David Mulder [Tue, 13 Aug 2024 20:06:00 +0000 (14:06 -0600)] 
Add USING_SYSTEM_TDB test for rust config

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd tests for rust chelps crate
David Mulder [Tue, 13 Aug 2024 19:57:37 +0000 (13:57 -0600)] 
Add tests for rust chelps crate

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoDebian cargo is far to old for building
David Mulder [Tue, 13 Aug 2024 19:26:37 +0000 (13:26 -0600)] 
Debian cargo is far to old for building

Debian ships a very old version of cargo, and
none of our rust code can build with it.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoVendor the rust sources for CI tests
David Mulder [Tue, 13 Aug 2024 14:53:33 +0000 (08:53 -0600)] 
Vendor the rust sources for CI tests

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoRust WAF detect dependant files from crates
David Mulder [Mon, 12 Aug 2024 21:04:47 +0000 (15:04 -0600)] 
Rust WAF detect dependant files from crates

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoModify rust build to share target dir w/ cargo test
David Mulder [Mon, 12 Aug 2024 20:25:12 +0000 (14:25 -0600)] 
Modify rust build to share target dir w/ cargo test

The build needs to share the target directory
with the cargo test command to prevent duplicate
dependency downloads.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoEnable rust cargo test in Samba make test
David Mulder [Mon, 12 Aug 2024 15:39:06 +0000 (09:39 -0600)] 
Enable rust cargo test in Samba make test

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdding Cargo.lock file for Rust build
David Mulder [Fri, 9 Aug 2024 20:08:11 +0000 (14:08 -0600)] 
Adding Cargo.lock file for Rust build

This ensures that all builds of this particular
version of Samba will use the same Rust
dependency versions.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoA Rust 'crate' is not a misspelling of 'create'
David Mulder [Fri, 9 Aug 2024 16:43:05 +0000 (10:43 -0600)] 
A Rust 'crate' is not a misspelling of 'create'

Also fix a misspelling in himmelblaud main.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoutf8proc-devel is missing from CentOS 8 Stream
David Mulder [Thu, 8 Aug 2024 20:48:59 +0000 (14:48 -0600)] 
utf8proc-devel is missing from CentOS 8 Stream

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoIntroduce build option to enable Himmelblau
David Mulder [Thu, 8 Aug 2024 20:06:22 +0000 (14:06 -0600)] 
Introduce build option to enable Himmelblau

The build for Himmelblau will be disabled by
default.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd clang and openssl deps
David Mulder [Thu, 8 Aug 2024 16:54:23 +0000 (10:54 -0600)] 
Add clang and openssl deps

Ensure CI images are generated with the necessary
clang and openssl packages for building.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd build config for proper TDB build linkage
David Mulder [Thu, 8 Aug 2024 16:51:02 +0000 (10:51 -0600)] 
Add build config for proper TDB build linkage

The tdb build needs to know whether Samba is
building with TDB bundled or not, otherwise
linking will fail.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoUpdate libhimmelblau
David Mulder [Mon, 5 Aug 2024 19:34:06 +0000 (13:34 -0600)] 
Update libhimmelblau

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoPam prompt for Pin if hello enrolled and enabled
David Mulder [Mon, 5 Aug 2024 19:05:52 +0000 (13:05 -0600)] 
Pam prompt for Pin if hello enrolled and enabled

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoIsolate hsm auth value from the cache
David Mulder [Mon, 5 Aug 2024 18:57:12 +0000 (12:57 -0600)] 
Isolate hsm auth value from the cache

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoReorganize rust file tree
David Mulder [Thu, 1 Aug 2024 21:12:33 +0000 (15:12 -0600)] 
Reorganize rust file tree

Place all rust code under samba/rust, similar to
how we organize python code in the samba tree.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd pam_open_session stub to the himmelblau daemon
David Mulder [Thu, 1 Aug 2024 16:08:41 +0000 (10:08 -0600)] 
Add pam_open_session stub to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd pam_acct_mgmt to the himmelblau daemon
David Mulder [Thu, 1 Aug 2024 15:52:45 +0000 (09:52 -0600)] 
Add pam_acct_mgmt to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd nss getgrgid to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 20:27:05 +0000 (14:27 -0600)] 
Add nss getgrgid to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd nss getgrnam to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 20:14:32 +0000 (14:14 -0600)] 
Add nss getgrnam to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd nss getgrent to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 17:39:38 +0000 (11:39 -0600)] 
Add nss getgrent to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd nss getpwuid to the himmelblau daemon
David Mulder [Wed, 31 Jul 2024 16:36:56 +0000 (10:36 -0600)] 
Add nss getpwuid to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd nss getpwnam to the himmelblau daemon
David Mulder [Tue, 30 Jul 2024 20:40:09 +0000 (14:40 -0600)] 
Add nss getpwnam to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd nss getpwent to the himmelblau daemon
David Mulder [Tue, 30 Jul 2024 17:18:59 +0000 (11:18 -0600)] 
Add nss getpwent to the himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd pam_auth to himmelblau daemon
David Mulder [Tue, 30 Jul 2024 17:27:35 +0000 (11:27 -0600)] 
Add pam_auth to himmelblau daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd PAM module for himmelblaud
David Mulder [Thu, 1 Aug 2024 19:36:58 +0000 (13:36 -0600)] 
Add PAM module for himmelblaud

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd Samba versioning
David Mulder [Tue, 30 Jul 2024 15:09:43 +0000 (09:09 -0600)] 
Add Samba versioning

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd NSS module for himmelblaud
David Mulder [Thu, 18 Jul 2024 16:27:14 +0000 (10:27 -0600)] 
Add NSS module for himmelblaud

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd the Azure Entra Id Daemon
David Mulder [Wed, 10 Jul 2024 20:04:28 +0000 (14:04 -0600)] 
Add the Azure Entra Id Daemon

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd a daemon caching layer that wraps tdb
David Mulder [Tue, 30 Jul 2024 18:56:41 +0000 (12:56 -0600)] 
Add a daemon caching layer that wraps tdb

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd by-upn idmapping for Himmelblaud
David Mulder [Tue, 30 Jul 2024 15:53:56 +0000 (09:53 -0600)] 
Add by-upn idmapping for Himmelblaud

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd rust tdb bindings
David Mulder [Tue, 30 Jul 2024 15:49:22 +0000 (09:49 -0600)] 
Add rust tdb bindings

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd lp Rust bindings
David Mulder [Tue, 30 Jul 2024 15:43:46 +0000 (09:43 -0600)] 
Add lp Rust bindings

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoBuild the Rust ntstatus generated code
David Mulder [Tue, 30 Jul 2024 15:38:48 +0000 (09:38 -0600)] 
Build the Rust ntstatus generated code

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd rust bindings to Samba utils debug
David Mulder [Tue, 30 Jul 2024 15:17:34 +0000 (09:17 -0600)] 
Add rust bindings to Samba utils debug

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd Rust formatting for 80 char lines
David Mulder [Tue, 30 Jul 2024 19:28:31 +0000 (13:28 -0600)] 
Add Rust formatting for 80 char lines

This option helps force `cargo fmt` to follow
Samba's coding conventions. The 80 char max
is only lightly enforced here.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd ntstatus_gen for Rust
David Mulder [Fri, 5 Jul 2024 21:00:31 +0000 (15:00 -0600)] 
Add ntstatus_gen for Rust

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoAdd simple WAF commands for building Rust bininaries
David Mulder [Fri, 5 Jul 2024 20:23:09 +0000 (14:23 -0600)] 
Add simple WAF commands for building Rust bininaries

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 months agoctdb-scripts: Don't set arp_filter=1 by default in 10.interface
Martin Schwenke [Tue, 15 Oct 2024 03:11:15 +0000 (14:11 +1100)] 
ctdb-scripts: Don't set arp_filter=1 by default in 10.interface

That is, no longer set sysctl net.ipv4.conf.all.arp_filter=1 in
10.interface.  Only do this in 13.per_ip_routing.

This effectively reverts commit
0ebd7beb4bcae324acf8e733500a983d22b47e9b by Ronnie Sahlberg from 2007.
I have discussed this with Ronnie.  This setting was originally added
to force incoming traffic to the interface hosting each IP.  This
would spread the load across multiple interfaces hosting the same
subnet.  Without the setting, incoming traffic would go to the first
interface to answer an ARP request, so could be unbalanced if one
interface tended to answer more quickly.

However, networks are now faster and interface bonding/teaming works
well in Linux, so it is less likely that multiple interfaces will be
used in this way.

Also, problems are occurring in exactly the case this is meant to
help: when multiple interfaces host the same subnet.

The Linux kernel documentation for this option says:

  arp_filter - BOOLEAN
        - 1 - Allows you to have multiple network interfaces on the same
          subnet, and have the ARPs for each interface be answered
          based on whether or not the kernel would route a packet from
          the ARP'd IP out that interface (therefore you must use source
          based routing for this to work). In other words it allows control
          of which cards (usually 1) will respond to an arp request.

        - 0 - (default) The kernel can respond to arp requests with addresses
          from other interfaces. This may seem wrong but it usually makes
          sense, because it increases the chance of successful communication.
          IP addresses are owned by the complete host on Linux, not by
          particular interfaces. Only for more complex setups like load-
          balancing, does this behaviour cause problems.

        arp_filter for the interface will be enabled if at least one of
        conf/{all,interface}/arp_filter is set to TRUE,
        it will be disabled otherwise

Note the part for arp_filter=1 that says "you must use source based
routing for this to work".  The problems are probably due to a lack of
source-based routing when this is only used with 10.interface.  In
this case, outbound packets can come from a different
interface (corresponding to the first matching route), with a
different MAC address.  There is clearly some infrastructure or packet
filtering out there that objects to such asymmetric packet flows.

So, drop this setting from 10.interface because it isn't working as
intended.  Continue to enable it in 13.per_ip_routing, which exists to
set up the required source-based routing.

This change may affect balancing of packet flows when public IP
addresses can be hosted by multiple interfaces, but does not stop that
feature from working.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Oct 17 18:53:32 UTC 2024 on atb-devel-224

12 months agothird_party/heimdal: Import lorikeet-heimdal-202410161454 (commit 0d61538a16b5051c820...
Stefan Metzmacher [Tue, 30 Apr 2024 16:24:33 +0000 (18:24 +0200)] 
third_party/heimdal: Import lorikeet-heimdal-202410161454 (commit 0d61538a16b5051c820702f0711102112cd01a83)

gsskrb5: let GSS_C_DCE_STYLE imply GSS_C_MUTUAL_FLAG as acceptor

Windows clients forget GSS_C_MUTUAL_FLAG in some situations where they
use GSS_C_DCE_STYLE, in the assumption that GSS_C_MUTUAL_FLAG is
implied.

Both Windows and MIT as server already imply GSS_C_MUTUAL_FLAG
when GSS_C_DCE_STYLE is used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15740
PR: https://github.com/heimdal/heimdal/pull/1266

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 16 19:05:15 UTC 2024 on atb-devel-224

12 months agosmbd: fix share access check for overwrite dispostions
Ralph Boehme [Wed, 2 Oct 2024 12:09:33 +0000 (14:09 +0200)] 
smbd: fix share access check for overwrite dispostions

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Oct 14 12:23:04 UTC 2024 on atb-devel-224

12 months agosmbtorture: add subtests for overwrite dispositions vs sharemodes
Ralph Boehme [Wed, 2 Oct 2024 12:08:36 +0000 (14:08 +0200)] 
smbtorture: add subtests for overwrite dispositions vs sharemodes

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: fix smb2.notify.mask test
Ralph Boehme [Wed, 2 Oct 2024 16:17:17 +0000 (18:17 +0200)] 
smbtorture: fix smb2.notify.mask test

The strange function custom_smb2_create() was somehow causing
NT_STATUS_DELETE_PENDING failures:

  failure: mask [
  (../../source4/torture/smb2/notify.c:490) Incorrect status NT_STATUS_DELETE_PENDING - should be NT_STATUS_OK
  ]

I couldn't figure out what was causing this exactly, but after doing these
cleanups the error went away.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agosmbtorture: prepare test_overwrite_read_only_file() for more subtests
Ralph Boehme [Wed, 2 Oct 2024 12:07:49 +0000 (14:07 +0200)] 
smbtorture: prepare test_overwrite_read_only_file() for more subtests

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
12 months agotests: add test for cli_get_posix_fs_info
Jule Anger [Mon, 19 Aug 2024 09:09:53 +0000 (11:09 +0200)] 
tests: add test for cli_get_posix_fs_info

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 14 08:48:07 UTC 2024 on atb-devel-224

12 months agopylibsmb: add python binding for cli_get_posix_fs_info
Jule Anger [Mon, 19 Aug 2024 09:03:47 +0000 (11:03 +0200)] 
pylibsmb: add python binding for cli_get_posix_fs_info

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agosmbd: check negotiate before the create context is handled
Jule Anger [Tue, 3 Sep 2024 12:42:03 +0000 (14:42 +0200)] 
smbd: check negotiate before the create context is handled

So far, the create context is used as it is sent by the client.
Now we first check whether posix extensions are negotiated.

Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agolibsmb: add cli_get_posix_fs_info() for smb2
Jule Anger [Tue, 3 Sep 2024 12:41:40 +0000 (14:41 +0200)] 
libsmb: add cli_get_posix_fs_info() for smb2

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agosmbd: add SMB2_FS_POSIX_INFORMATION
Ralph Boehme [Wed, 26 Jun 2024 11:11:18 +0000 (13:11 +0200)] 
smbd: add SMB2_FS_POSIX_INFORMATION

Needed as in_file_info_class type to query posix filesystem information.
Used in the subsequent commit.

Pair-Programmed-With: Jule Anger <janger@samba.org>
Signed-off-by: Jule Anger <janger@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agolibsmb: make cli_get_posix_fs_info() asynchronous
Jule Anger [Mon, 30 Sep 2024 13:48:16 +0000 (15:48 +0200)] 
libsmb: make cli_get_posix_fs_info() asynchronous

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agosmbtorture: Allow debugging output to be configured using smb.conf parameters
Pavel Filipenský [Sun, 13 Oct 2024 19:57:27 +0000 (21:57 +0200)] 
smbtorture: Allow debugging output to be configured using smb.conf parameters

It might be useful to see timestamps for some smbtorture tests.

Timestamps can be printed via 'debug syslog format=always'.
It can be specified either in smb.conf or directly via smbtorture option
-T 'OPTION=VALUE'     smb.conf option line

However, smbtorture is not evaluating the option. It needs to call
reopen_logs()->debug_set_settings() to copy
'Globals.debug_syslog_format' to 'state->settings.debug_syslog_format'

$ bin/smbtorture3 //foo/bar -U% LOCAL-G-LOCK4 -d10 -T 'debug syslog format=always'

Before:

dbwrap_lock_order_unlock: release lock order 3 for /home/pfilipen/ws/projects/samba/smbtorture/st/client/lockdir/g_lock.tdb
waited
child 2473726 exited with 0
g_lock_lock_retry: watch_recv returned NT_STATUS_OK

After (see 1 sec delay):

2024-10-13T21:26:56.476859+00:00 addc.addom.samba.example.com smbtorture[2473806]: dbwrap_lock_order_unlock: release lock order 3 for /home/pfilipen/ws/projects/samba/smbtorture/st/client/lockdir/g_lock.tdb
waited
child 2473807 exited with 0
2024-10-13T21:26:57.487363+00:00 addc.addom.samba.example.com smbtorture[2473806]: g_lock_lock_retry: watch_recv returned NT_STATUS_OK

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
12 months agodcesrv_core: better fault codes dcesrv_auth_prepare_auth3()
Stefan Metzmacher [Fri, 13 Nov 2020 01:47:51 +0000 (02:47 +0100)] 
dcesrv_core: better fault codes dcesrv_auth_prepare_auth3()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 10 15:17:46 UTC 2024 on atb-devel-224

12 months agodcesrv_core: fix the auth3 for large ntlmssp messages
Stefan Metzmacher [Fri, 13 Nov 2020 09:55:43 +0000 (10:55 +0100)] 
dcesrv_core: fix the auth3 for large ntlmssp messages

I know finding any real logic in reading the patch,
doesn't really show what's going on. I tried hard
to simplify it, but this is the only way I found
that fixed the test_auth_pad_ntlm_2889_auth3 test
without breaking other tests...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agogensec:spnego: ignore trailing bytes in SPNEGO_SERVER_START state
Stefan Metzmacher [Wed, 11 Nov 2020 16:03:29 +0000 (17:03 +0100)] 
gensec:spnego: ignore trailing bytes in SPNEGO_SERVER_START state

This matches Windows (at least Server 2012_R2).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agogensec:ntlmssp: only allow messages up to 2888 bytes
Stefan Metzmacher [Thu, 12 Nov 2020 09:00:07 +0000 (10:00 +0100)] 
gensec:ntlmssp: only allow messages up to 2888 bytes

This matches Windows (at least Server 2012_R2).

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agodcesrv_core: alter_context logon failures should result in DCERPC_FAULT_ACCESS_DENIED
Stefan Metzmacher [Thu, 12 Nov 2020 15:41:21 +0000 (16:41 +0100)] 
dcesrv_core: alter_context logon failures should result in DCERPC_FAULT_ACCESS_DENIED

We should use DCERPC_FAULT_ACCESS_DENIED as default for
gensec status results of e.g. NT_STATUS_LOGON_FAILURE or
NT_STATUS_INVALID_PARAMTER.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agodcesrv_core: a failure from gensec_update results in NAK_REASON_INVALID_CHECKSUM
Stefan Metzmacher [Thu, 12 Nov 2020 15:41:05 +0000 (16:41 +0100)] 
dcesrv_core: a failure from gensec_update results in NAK_REASON_INVALID_CHECKSUM

We already report that for gensec_start_mech_by_authtype() failures,
but we also need to do that for any invalid authentication.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agodcerpc_util: let dcerpc_pull_auth_trailer() ignore data_and_pad for bind, alter,...
Stefan Metzmacher [Wed, 11 Nov 2020 16:07:54 +0000 (17:07 +0100)] 
dcerpc_util: let dcerpc_pull_auth_trailer() ignore data_and_pad for bind, alter, auth3

Sometimes Windows sends 3 presentation contexts (NDR32, NDR64,
BindTimeFeatureNegotiation) in the first BIND of an association.

Binding an additional connection to the association seems to
reuse the BIND buffer and just changes the num_contexts field from
3 to 2 and leaves the BindTimeFeatureNegotiation context as padding
in places.

Note, the auth_pad_length field is send as 0 in that case,
which means we need to ignore it completely, as well as any
padding before the auth header.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agodcerpc_util: let dcerpc_pull_auth_trailer() expose the reject reason
Stefan Metzmacher [Wed, 11 Nov 2020 16:59:45 +0000 (17:59 +0100)] 
dcerpc_util: let dcerpc_pull_auth_trailer() expose the reject reason

If dcerpc_pull_auth_trailer() returns NT_STATUS_RPC_PROTOCOL_ERROR
it will return the BIND reject code in auth->auth_context_id.

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

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