]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
13 days agos3:client: Use talloc to avoid memory leaks in smbspool
Andreas Schneider [Wed, 22 Oct 2025 09:24:24 +0000 (11:24 +0200)] 
s3:client: Use talloc to avoid memory leaks in smbspool

The function uri_unescape_alloc() is called by main() which has a talloc
stackframe.

Direct leak of 13 byte(s) in 1 object(s) allocated from:
    #0 0x7fc31351b9a0 in strdup (/lib64/libasan.so.8+0x11b9a0) (BuildId: 388ee9ac193f74c177c6f52988d2d0dab110de41)
    #1 0x7fc3129cfb50 in smb_xstrdup ../../lib/util/util.c:760
    #2 0x0000002059f8 in uri_unescape_alloc ../../source3/client/smbspool.c:888
    #3 0x00000020752a in main ../../source3/client/smbspool.c:347
    #4 0x7fc30f62b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #5 0x7ffd8bb806be  ([stack]+0x3b6be)

Signed-off-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): Fri Oct 24 07:42:37 UTC 2025 on atb-devel-224

2 weeks agodocs-xml: Document SID extension certificate mappings
Jennifer Sutton [Tue, 14 Oct 2025 04:05:20 +0000 (17:05 +1300)] 
docs-xml: Document SID extension certificate mappings

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Thu Oct 23 01:03:36 UTC 2025 on atb-devel-224

2 weeks agos4:kdc: Implement Object SID certificate security extension
Jennifer Sutton [Mon, 25 Aug 2025 00:40:09 +0000 (12:40 +1200)] 
s4:kdc: Implement Object SID certificate security extension

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agothird_party/heimdal: Import lorikeet-heimdal-202510122217 (commit c2d91bdde528ba018da...
Jennifer Sutton [Sun, 12 Oct 2025 22:25:48 +0000 (11:25 +1300)] 
third_party/heimdal: Import lorikeet-heimdal-202510122217 (commit c2d91bdde528ba018da27b88baa22b46f323f659)

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agos4:kdc: Don’t leak pub_keys.keys
Jennifer Sutton [Thu, 9 Oct 2025 04:09:40 +0000 (17:09 +1300)] 
s4:kdc: Don’t leak pub_keys.keys

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agos4:kdc: Move talloc_steal() back to function end
Jennifer Sutton [Fri, 3 Oct 2025 02:14:00 +0000 (15:14 +1300)] 
s4:kdc: Move talloc_steal() back to function end

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agos4:kdc: Correct debug messages
Jennifer Sutton [Fri, 3 Oct 2025 02:12:19 +0000 (15:12 +1300)] 
s4:kdc: Correct debug messages

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agos4:kdc: Correct comments
Jennifer Sutton [Fri, 3 Oct 2025 02:11:36 +0000 (15:11 +1300)] 
s4:kdc: Correct comments

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agotests/krb5: Add tests for the Object SID certificate security extension
Jennifer Sutton [Fri, 3 Oct 2025 01:31:30 +0000 (14:31 +1300)] 
tests/krb5: Add tests for the Object SID certificate security extension

View with ‘git show -b’.

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agotests/krb5: Remove unused imports
Jennifer Sutton [Fri, 3 Oct 2025 01:29:51 +0000 (14:29 +1300)] 
tests/krb5: Remove unused imports

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agotests/krb5: Remove unused method
Jennifer Sutton [Fri, 3 Oct 2025 01:30:24 +0000 (14:30 +1300)] 
tests/krb5: Remove unused method

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agodocs-xml: Correct documentation
Jennifer Sutton [Fri, 3 Oct 2025 01:24:59 +0000 (14:24 +1300)] 
docs-xml: Correct documentation

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agos4:kdc: Correct spelling
Jennifer Sutton [Fri, 3 Oct 2025 01:17:42 +0000 (14:17 +1300)] 
s4:kdc: Correct spelling

Signed-off-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agos3:passdb: Fix memory leak in pdb_default_del_groupmem()
Andreas Schneider [Tue, 21 Oct 2025 09:08:30 +0000 (11:08 +0200)] 
s3:passdb: Fix memory leak in pdb_default_del_groupmem()

Indirect leak of 496 byte(s) in 1 object(s) allocated from:
    #0 0x7f1e45121c2b in malloc (/lib64/libasan.so.8+0x121c2b) (BuildId: 388ee9ac193f74c177c6f52988d2d0dab110de41)
    #1 0x7f1e44b586a0 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7f1e44b59f75 in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7f1e44b59f75 in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7f1e44b59f75 in _talloc_zero ../../lib/talloc/talloc.c:2421
    #5 0x7f1e42a18460 in samu_new ../../source3/passdb/passdb.c:63
    #6 0x7f1e42a381ef in pdb_default_del_groupmem ../../source3/passdb/pdb_interface.c:1098
    #7 0x7f1e42a364b1 in pdb_del_groupmem ../../source3/passdb/pdb_interface.c:1130
    #8 0x000000388a57 in net_sam_delmem ../../source3/utils/net_sam.c:1324
    #9 0x00000038ff79 in net_run_function ../../source3/utils/net_util.c:451
    #10 0x00000038bfb6 in net_sam ../../source3/utils/net_sam.c:2306
    #11 0x00000038ff79 in net_run_function ../../source3/utils/net_util.c:451
    #12 0x0000002ea182 in main ../../source3/utils/net.c:1474
    #13 0x7f1e3fc2b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #14 0x7ffe6b22b79f  ([stack]+0x2079f)

Signed-off-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): Wed Oct 22 15:21:22 UTC 2025 on atb-devel-224

2 weeks agos3:passdb: Fix memory leak in pdb_default_add_groupmem()
Andreas Schneider [Tue, 21 Oct 2025 08:30:29 +0000 (10:30 +0200)] 
s3:passdb: Fix memory leak in pdb_default_add_groupmem()

Indirect leak of 496 byte(s) in 1 object(s) allocated from:
    #0 0x7f068f921c2b in malloc (/lib64/libasan.so.8+0x121c2b) (BuildId: 388ee9ac193f74c177c6f52988d2d0dab110de41)
    #1 0x7f068f4266a0 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7f068f427f75 in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7f068f427f75 in _talloc_named_const ../../lib/talloc/talloc.c:982
    #4 0x7f068f427f75 in _talloc_zero ../../lib/talloc/talloc.c:2421
    #5 0x7f068cbba260 in samu_new ../../source3/passdb/passdb.c:63
    #6 0x7f068cbda444 in pdb_default_add_groupmem ../../source3/passdb/pdb_interface.c:1022
    #7 0x7f068cbd825d in pdb_add_groupmem ../../source3/passdb/pdb_interface.c:1054
    #8 0x000000389322 in net_sam_addmem ../../source3/utils/net_sam.c:1255
    #9 0x00000038ff79 in net_run_function ../../source3/utils/net_util.c:451
    #10 0x00000038bfb6 in net_sam ../../source3/utils/net_sam.c:2306
    #11 0x00000038ff79 in net_run_function ../../source3/utils/net_util.c:451
    #12 0x0000002ea182 in main ../../source3/utils/net.c:1474
    #13 0x7f068a42b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #14 0x7ffe0a90b7a1  ([stack]+0x207a1)

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agolib:ldb:tools: Do not leak memory in ldb_cmdline_process_internal()
Andreas Schneider [Wed, 22 Oct 2025 07:33:56 +0000 (09:33 +0200)] 
lib:ldb:tools: Do not leak memory in ldb_cmdline_process_internal()

If add_control() hasn't been called before, it will be NULL. Use ret as
the context to allocate memory on.

Direct leak of 110 byte(s) in 1 object(s) allocated from:
    #0 0x7fc1b5921c2b in malloc (/lib64/libasan.so.8+0x121c2b) (BuildId: 388ee9ac193f74c177c6f52988d2d0dab110de41)
    #1 0x7fc1b56ed6a0 in __talloc_with_prefix ../../lib/talloc/talloc.c:783
    #2 0x7fc1b56ee9e8 in __talloc ../../lib/talloc/talloc.c:825
    #3 0x7fc1b56ee9e8 in __talloc_strlendup ../../lib/talloc/talloc.c:2454
    #4 0x7fc1b56ee9e8 in talloc_strdup ../../lib/talloc/talloc.c:2470
    #5 0x7fc1b5f1ad18 in ldb_cmdline_process_internal ../../lib/ldb/tools/cmdline.c:389
    #6 0x7fc1b5f1b53c in ldb_cmdline_process ../../lib/ldb/tools/cmdline.c:544
    #7 0x000000202a19 in main ../../lib/ldb/tools/ldbdel.c:97
    #8 0x7fc1b542b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #9 0x7ffdced96847  ([stack]+0x38847)

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 22 09:25:35 UTC 2025 on atb-devel-224

2 weeks agolib:ldb:tools: Remove trailing spaces in cmdline.c
Andreas Schneider [Wed, 22 Oct 2025 07:38:20 +0000 (09:38 +0200)] 
lib:ldb:tools: Remove trailing spaces in cmdline.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 weeks agonsswitch: Fix memory leak in wbinfo_xids_to_sids()
Andreas Schneider [Wed, 22 Oct 2025 07:36:50 +0000 (09:36 +0200)] 
nsswitch: Fix memory leak in wbinfo_xids_to_sids()

We should not allocate on the NULL context.

=================================================================
==313033==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 376 byte(s) in 1 object(s) allocated from:
    #0 0x7ff48b520b4b  (/lib64/libasan.so.8+0x120b4b) (BuildId: 388ee9ac193f74c177c6f52988d2d0dab110de41)
    #1 0x7ff48bb079d3 in _talloc_realloc ../../lib/talloc/talloc.c:2035
    #2 0x7ff48bb0824c in _talloc_realloc_array ../../lib/talloc/talloc.c:2810
    #3 0x00000021ab91 in wbinfo_xids_to_sids ../../nsswitch/wbinfo.c:1122
    #4 0x00000021ab91 in main ../../nsswitch/wbinfo.c:3065
    #5 0x7ff48842b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa) (BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #6 0x7ffd3dc6866e  ([stack]+0x2066e)

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 weeks agolib:replace: Implement setproctitle() based on PRCTL_MM_MAP
Andreas Schneider [Fri, 17 Oct 2025 08:16:30 +0000 (10:16 +0200)] 
lib:replace: Implement setproctitle() based on PRCTL_MM_MAP

This should work on Linux. It requires CAP_SYS_RESOURCE, but our daemons
run as root anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 22 08:03:35 UTC 2025 on atb-devel-224

2 weeks agolib:replace: Remove trailing spaces
Andreas Schneider [Fri, 17 Oct 2025 08:18:02 +0000 (10:18 +0200)] 
lib:replace: Remove trailing spaces

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 weeks agolib:replace: There is special code already to check for HAVE_PRCTL
Andreas Schneider [Fri, 17 Oct 2025 08:15:12 +0000 (10:15 +0200)] 
lib:replace: There is special code already to check for HAVE_PRCTL

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 weeks agoCVE-2025-10230: s4:wins: restrict names fed to shell
Douglas Bagnall [Wed, 3 Sep 2025 02:20:24 +0000 (14:20 +1200)] 
CVE-2025-10230: s4:wins: restrict names fed to shell

If the "wins hook" smb.conf parameter is set, the WINS server will
attempt to execute that value in a shell command line when a client
asks to modify a name. The WINS system is a trusting one, and clients
can claim any NETBIOS name they wish.

With the source3 nmbd WINS server (since the 1999 commit now called
3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7) the wins hook will not be
run for names that contain shell metacharacters. This restriction has
not been present on the source4 nbt WINS server, which is the WINS
server that will be used in the event that an Active Directory Domain
Controller is also running WINS.

This allowed an unauthenticated client to execute arbitrary commands
on the server.

This commit brings the nmbd check into the nbt WINS server, so that
the wins hook will only be run for names that contain only letters,
digits, hyphens, underscores and periods. This matches the behaviour
described in the smb.conf man page.

The source3 nmbd WINS server has another layer of protection, in that
it uses the smb_run() exec wrapper that tries to escape arguments. We
don't do that here.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Oct 21 19:43:25 UTC 2025 on atb-devel-224

2 weeks agoCVE-2025-10230: s4/tests: check that wins hook sanitizes names
Douglas Bagnall [Tue, 9 Sep 2025 01:36:16 +0000 (13:36 +1200)] 
CVE-2025-10230: s4/tests: check that wins hook sanitizes names

An smb.conf can contain a 'wins hook' parameter, which names a script
to run when a WINS name is changed. The man page says

    The second argument is the NetBIOS name. If the name is not a
    legal name then the wins hook is not called. Legal names contain
    only letters, digits, hyphens, underscores and periods.

but it turns out the legality check is not performed if the WINS
server in question is the source4 nbt one. It is not expected that
people will run this server, but they can. This is bad because the
name is passed unescaped into a shell command line, allowing command
injection.

For this test we don't care whether the WINS server is returning an
error code, just whether it is running the wins hook. The tests show
it often runs the hook it shouldn't, though some characters are
incidentally blocked because the name has to fit in a DN before it
gets to the hook, and DNs have a few syntactic restrictions (e.g.,
blocking '<', '>', and ';').

The source3 WINS server that is used by Samba when not run as a DC is
not affected and not here tested.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agosmbd: Simplify smb2_parse_file_rename_information()
Volker Lendecke [Fri, 26 Sep 2025 08:40:45 +0000 (10:40 +0200)] 
smbd: Simplify smb2_parse_file_rename_information()

We don't really need "fsp" and "smb_fname_src" arguments anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 21 18:35:59 UTC 2025 on atb-devel-224

2 weeks agosmbd: Simplify smb2_parse_file_rename_information()
Volker Lendecke [Fri, 26 Sep 2025 08:25:42 +0000 (10:25 +0200)] 
smbd: Simplify smb2_parse_file_rename_information()

The caller in smb2_file_rename_information() does not need the
dst_dirfsp, factor out the filename_convert_dirfsp() code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove "dst_original_lcomp" from smb2_parse_file_rename_information()
Volker Lendecke [Thu, 25 Sep 2025 06:55:34 +0000 (08:55 +0200)] 
smbd: Remove "dst_original_lcomp" from smb2_parse_file_rename_information()

Nobody uses it anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Remove streams_depot_renameat()
Volker Lendecke [Wed, 24 Sep 2025 13:48:58 +0000 (15:48 +0200)] 
vfs: Remove streams_depot_renameat()

Not used anymore except for passing on to _NEXT_

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Remove streams_xattr_renameat()
Volker Lendecke [Wed, 24 Sep 2025 13:47:32 +0000 (15:47 +0200)] 
vfs: Remove streams_xattr_renameat()

Not used anymore except for passing on to _NEXT_

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove "dst_original_lcomp" from smb2_parse_file_rename_information()
Volker Lendecke [Thu, 25 Sep 2025 06:55:34 +0000 (08:55 +0200)] 
smbd: Remove "dst_original_lcomp" from smb2_parse_file_rename_information()

Nobody uses it anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove unused parameters from rename_internals()
Volker Lendecke [Wed, 24 Sep 2025 13:12:17 +0000 (15:12 +0200)] 
smbd: Remove unused parameters from rename_internals()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove an unnecessary return;
Volker Lendecke [Sat, 20 Sep 2025 00:17:06 +0000 (17:17 -0700)] 
smbd: Remove an unnecessary return;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove unused parameters from rename_internals_fsp()
Volker Lendecke [Wed, 24 Sep 2025 12:58:49 +0000 (14:58 +0200)] 
smbd: Remove unused parameters from rename_internals_fsp()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Rewrite rename_internals_fsp()
Volker Lendecke [Wed, 24 Sep 2025 12:49:21 +0000 (14:49 +0200)] 
smbd: Rewrite rename_internals_fsp()

With SMB_VFS_RENAME_STREAM and the src parent fsp and src relname
available, we can save a lot of string handling in
rename_internals_fsp(). Subsequent patches will remove a lot of code
that's no longer used after this patch.

Better look at the result than the patch for review.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Add streams_depot implementation of rename_stream()
Volker Lendecke [Mon, 22 Sep 2025 15:05:08 +0000 (17:05 +0200)] 
vfs: Add streams_depot implementation of rename_stream()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Add streams_xattr implementation of rename_stream()
Volker Lendecke [Fri, 19 Sep 2025 18:02:25 +0000 (11:02 -0700)] 
vfs: Add streams_xattr implementation of rename_stream()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Add SMB_VFS_RENAME_STREAM
Volker Lendecke [Mon, 22 Sep 2025 13:55:57 +0000 (15:55 +0200)] 
vfs: Add SMB_VFS_RENAME_STREAM

[MS-FSA] 2.1.5.15.12.1 Algorithm for Performing Stream Rename

is simpler and diffent enough from renaming a file or directory that I
believe a separate VFS operation is justified instead of tunneling it
through the renameat call. For example it's only possible to rename
streams within a file, so only one stream open fsp and a newname which
is guaranteed to be a stream name is necessary.

Add stub implementations to our streams modules, to be filled later.

Signed-off-by: Volker Lendecke <vl@samba.org>
vfs_streams_xattr: rename_streams
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs_streams_xattr: Return whether a stream name is ::$DATA
Volker Lendecke [Wed, 24 Sep 2025 12:04:49 +0000 (14:04 +0200)] 
vfs_streams_xattr: Return whether a stream name is ::$DATA

Not trivial to find from the converted name due to the
streams_xattr:store_stream_type config option. To be used in the
stream_rename operation.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Slightly simplify rename_internals
Volker Lendecke [Sun, 21 Sep 2025 12:18:47 +0000 (14:18 +0200)] 
smbd: Slightly simplify rename_internals

This is what "||" is for...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass fsp instead of filename for parent to open_directory()
Volker Lendecke [Wed, 17 Sep 2025 14:03:20 +0000 (07:03 -0700)] 
smbd: Pass fsp instead of filename for parent to open_directory()

Everybody referenced parent_dir_fname->fsp

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass fsp instead of filename for parent to open_file_ntcreate()
Volker Lendecke [Wed, 17 Sep 2025 14:00:36 +0000 (07:00 -0700)] 
smbd: Pass fsp instead of filename for parent to open_file_ntcreate()

Everybody referenced parent_dir_fname->fsp

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass fsp instead of filename for parent to possibly_set_archive()
Volker Lendecke [Wed, 17 Sep 2025 13:57:42 +0000 (06:57 -0700)] 
smbd: Pass fsp instead of filename for parent to possibly_set_archive()

Lift the ->fsp dereference up one level

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass fsp instead of filename for parent to mkdir_internals()
Volker Lendecke [Wed, 17 Sep 2025 13:55:57 +0000 (06:55 -0700)] 
smbd: Pass fsp instead of filename for parent to mkdir_internals()

parent_dir_fname->fsp was referenced almost everywhere

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Slightly simplify mkdir_internal()
Volker Lendecke [Wed, 17 Sep 2025 13:49:49 +0000 (06:49 -0700)] 
smbd: Slightly simplify mkdir_internal()

Save a few lines by moving the NULL check out of the if-branches. Swap
branches to avoid a ! in the condition, makes it easier to read for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass fsp instead of filename for parent to file_set_dosmode
Volker Lendecke [Wed, 17 Sep 2025 13:46:51 +0000 (06:46 -0700)] 
smbd: Pass fsp instead of filename for parent to file_set_dosmode

Avoids a call to PARENT_PATHNAME in copy_internals()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Move a variable declaration closer to its use
Volker Lendecke [Wed, 17 Sep 2025 13:05:52 +0000 (06:05 -0700)] 
smbd: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Simplify rename_internals_fsp()
Volker Lendecke [Thu, 18 Sep 2025 19:50:57 +0000 (12:50 -0700)] 
smbd: Simplify rename_internals_fsp()

Use a new talloc_stackframe to simplify cleanup. I hope Coverity gets
this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass src_dirfsp, src_relname and raw newname to rename_internals_fsp()
Volker Lendecke [Wed, 17 Sep 2025 22:51:05 +0000 (15:51 -0700)] 
smbd: Pass src_dirfsp, src_relname and raw newname to rename_internals_fsp()

Will make way for some simplification soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Fix indentation of rename_internals[_fsp] params
Volker Lendecke [Sat, 13 Sep 2025 11:46:52 +0000 (13:46 +0200)] 
smbd: Fix indentation of rename_internals[_fsp] params

Next patches add params

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Return newname from smb2_parse_file_rename_information()
Volker Lendecke [Wed, 17 Sep 2025 22:46:37 +0000 (15:46 -0700)] 
smbd: Return newname from smb2_parse_file_rename_information()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Simplify hardlink_internals()
Volker Lendecke [Tue, 16 Sep 2025 20:15:39 +0000 (13:15 -0700)] 
smbd: Simplify hardlink_internals()

Avoid calling parent_pathref() in hardlink_internals. All but one
callers have the required information anyway. Unfortunately the one
that does not have it is the SMB2 one. So for SMB2+ this is not a real
optimization, but in some distant future we might have a dirfsp
attached to every fsp, so this might at some point also solve itself.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Consolidate [smb|smb2]_file_link_information code
Volker Lendecke [Mon, 15 Sep 2025 18:50:00 +0000 (11:50 -0700)] 
smbd: Consolidate [smb|smb2]_file_link_information code

Those two functions were the same except for pulling the dst name.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Use fsp_is_alternate_stream()
Volker Lendecke [Sat, 13 Sep 2025 09:54:35 +0000 (11:54 +0200)] 
smbd: Use fsp_is_alternate_stream()

This is more descriptive than just checking fsp->base_fsp

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove a temp variable used only once
Volker Lendecke [Sat, 13 Sep 2025 09:50:24 +0000 (11:50 +0200)] 
smbd: Remove a temp variable used only once

We use talloc_tos() as function argument in a lot of places already.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Remove a few unnecessary NULL checks
Volker Lendecke [Sat, 13 Sep 2025 09:47:42 +0000 (11:47 +0200)] 
smbd: Remove a few unnecessary NULL checks

These functions are only called from smbd_do_setfilepathinfo() which
has checked with SMB_ASSERT(fsp != NULL).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Align [smb|smb2]_file_link_information code
Volker Lendecke [Mon, 15 Sep 2025 18:35:46 +0000 (11:35 -0700)] 
smbd: Align [smb|smb2]_file_link_information code

The next patch will merge them into one function. Make it obvious in a separate
patch that they are the same except for parsing the input buffer.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Reduce indentation in smb2_parse_file_rename_information()
Volker Lendecke [Sat, 13 Sep 2025 20:34:00 +0000 (22:34 +0200)] 
smbd: Reduce indentation in smb2_parse_file_rename_information()

Avoid an "else"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Simplify hardlink_internals()
Volker Lendecke [Mon, 15 Sep 2025 13:04:06 +0000 (06:04 -0700)] 
smbd: Simplify hardlink_internals()

All callers have easy access to the "new" parent dirfsp and the new
lcomp. Use those to avoid a call to parent_pathref() in
hardlink_internals().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Pass "dirfsp" and the new relname to smb_set_file_unix_hlink()
Volker Lendecke [Mon, 15 Sep 2025 03:10:58 +0000 (20:10 -0700)] 
smbd: Pass "dirfsp" and the new relname to smb_set_file_unix_hlink()

Will be passed on next

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Modernize DEBUGs
Volker Lendecke [Mon, 15 Sep 2025 00:04:03 +0000 (17:04 -0700)] 
smbd: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Rename "srcfsp"->"src_dirfsp" and "dstfsp"->"dst_dirfsp"
Volker Lendecke [Sat, 13 Sep 2025 14:06:57 +0000 (16:06 +0200)] 
vfs: Rename "srcfsp"->"src_dirfsp" and "dstfsp"->"dst_dirfsp"

Do this in linkat() and renameat() routines. Some modules already had
this, unify on our current convention to name directory fsps.

Looks much larger than it is, most is coming from "git clang-format".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Slightly simplify smbd_do_qfilepathinfo()
Volker Lendecke [Sat, 13 Sep 2025 10:20:34 +0000 (12:20 +0200)] 
smbd: Slightly simplify smbd_do_qfilepathinfo()

Use metadata_fsp() instead of explicitly checking fsp->base_fsp

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Use fsp_str_dbg() in DEBUGs
Volker Lendecke [Fri, 12 Sep 2025 17:16:28 +0000 (19:16 +0200)] 
smbd: Use fsp_str_dbg() in DEBUGs

This removes "git grep fsp_name->base_name" references.

Referencing fsp_name->base_name is potentially racy and affected by

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

This removes some obvious git grep lines, still leaving far too many...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Move a variable declaration closer to its use
Volker Lendecke [Sun, 14 Sep 2025 17:48:08 +0000 (10:48 -0700)] 
smbd: Move a variable declaration closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Fix indentation in reply_ntrename()
Volker Lendecke [Sun, 14 Sep 2025 18:04:46 +0000 (11:04 -0700)] 
smbd: Fix indentation in reply_ntrename()

Next patch will modify this section, don't confuse
clang-format. Review with git show -w.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Fix a copy&paste error in a comment
Volker Lendecke [Sun, 14 Sep 2025 17:26:13 +0000 (10:26 -0700)] 
smbd: Fix a copy&paste error in a comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Slightly simplify reply_ntrename()
Volker Lendecke [Sun, 14 Sep 2025 17:23:38 +0000 (10:23 -0700)] 
smbd: Slightly simplify reply_ntrename()

We call filename_convert_dirfsp() on the old name. Use the parsing
done there, we don't need to scan for a ":" in reply_ntrename() where
filename_convert_dirfsp() already does it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Implement larger streams in multiple xattrs
Volker Lendecke [Thu, 4 Sep 2025 15:28:26 +0000 (17:28 +0200)] 
vfs: Implement larger streams in multiple xattrs

See the comment at the top of this patch for a description of the data
format.

The lowerlevel xattr_multi routines now take the raw stream name
instead of the xattr name because they have to build up the real xattr
name attached to the file themselves.

The patch is a bit larger than I would like it, but the mechanics in
the _multi() routines don't make sense in isolation, and the rest is
mostly handling the raw_stream_name instead of the xattr_name.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Fix a few signed/unsigned warnings
Volker Lendecke [Thu, 4 Sep 2025 15:07:35 +0000 (17:07 +0200)] 
vfs: Fix a few signed/unsigned warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Add the streams_xattr:ext_prefix parameter
Volker Lendecke [Thu, 4 Sep 2025 14:56:39 +0000 (16:56 +0200)] 
vfs: Add the streams_xattr:ext_prefix parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Protect against an empty stream prefix
Volker Lendecke [Thu, 4 Sep 2025 14:48:07 +0000 (16:48 +0200)] 
vfs: Protect against an empty stream prefix

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs_streams: Add "streams_xattr:max xattrs per stream" parameter
Volker Lendecke [Thu, 4 Sep 2025 11:48:40 +0000 (13:48 +0200)] 
vfs_streams: Add "streams_xattr:max xattrs per stream" parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Pass streams_xattr_config to fremovexattr_multi()
Volker Lendecke [Tue, 2 Sep 2025 14:27:41 +0000 (16:27 +0200)] 
vfs: Pass streams_xattr_config to fremovexattr_multi()

To be used in later patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Pass streams_xattr_config to fgetxattr_multi()
Volker Lendecke [Tue, 2 Sep 2025 10:40:46 +0000 (12:40 +0200)] 
vfs: Pass streams_xattr_config to fgetxattr_multi()

To be used in later patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Pass streams_xattr_config to streams_xattr_get_ea_value_fsp()
Volker Lendecke [Tue, 2 Sep 2025 10:39:54 +0000 (12:39 +0200)] 
vfs: Pass streams_xattr_config to streams_xattr_get_ea_value_fsp()

To be used in later patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Pass streams_xattr_config to get_xattr_size_fsp()
Volker Lendecke [Tue, 2 Sep 2025 10:35:04 +0000 (12:35 +0200)] 
vfs: Pass streams_xattr_config to get_xattr_size_fsp()

To be used in later patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Pass streams_xattr_config to fsetxattr_multi()
Volker Lendecke [Fri, 29 Aug 2025 15:01:57 +0000 (17:01 +0200)] 
vfs: Pass streams_xattr_config to fsetxattr_multi()

To be used in later patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Pass xattr functions through helpers in streams_xattr
Volker Lendecke [Thu, 28 Aug 2025 14:43:22 +0000 (16:43 +0200)] 
vfs: Pass xattr functions through helpers in streams_xattr

To be used in later patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Simplify streams_xattr_get_ea_value_fsp()
Volker Lendecke [Fri, 29 Aug 2025 14:14:51 +0000 (16:14 +0200)] 
vfs: Simplify streams_xattr_get_ea_value_fsp()

We only need the value, no need for struct streams_xattr_ea just
wrapping a blob.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Simplify streams_xattr_get_ea_value_fsp()
Volker Lendecke [Thu, 28 Aug 2025 12:51:22 +0000 (14:51 +0200)] 
vfs: Simplify streams_xattr_get_ea_value_fsp()

We don't care about flags and names in streams_xattr

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Make streams_xattr_get_ea_value_fsp fill a struct of its own
Volker Lendecke [Thu, 28 Aug 2025 12:50:23 +0000 (14:50 +0200)] 
vfs: Make streams_xattr_get_ea_value_fsp fill a struct of its own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Make a copy of get_ea_value_fsp() in streams_xattr
Volker Lendecke [Thu, 28 Aug 2025 12:33:06 +0000 (14:33 +0200)] 
vfs: Make a copy of get_ea_value_fsp() in streams_xattr

We'll have to modify it to pass the FGETXATTR call through a helper
function for the vfs_streams_xattr case next.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agovfs: Do an early TALLOC_FREE in streams_xattr_openat()
Volker Lendecke [Fri, 29 Aug 2025 13:57:39 +0000 (15:57 +0200)] 
vfs: Do an early TALLOC_FREE in streams_xattr_openat()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agosmbd: Simplify samba_private_attr_name()
Volker Lendecke [Wed, 27 Aug 2025 14:40:54 +0000 (16:40 +0200)] 
smbd: Simplify samba_private_attr_name()

We have strnequal for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agotest: Fix fruit test for local netatalk interop
Volker Lendecke [Thu, 4 Sep 2025 07:45:32 +0000 (09:45 +0200)] 
test: Fix fruit test for local netatalk interop

streams_xattr always appends a '\0'. We'll start to add meaning to
that byte and check it soon, so make the hand-crafted stream follow
that convention.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agotest: Fix shadow copy streams xattr test
Volker Lendecke [Wed, 3 Sep 2025 09:46:49 +0000 (11:46 +0200)] 
test: Fix shadow copy streams xattr test

streams_xattr always appends a '\0'. We'll start to add meaning to
that byte and check it soon, so make the hand-crafted stream follow
that convention

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 weeks agomdssvc: add support for parsing date ranges
Ralph Boehme [Wed, 15 Oct 2025 13:01:16 +0000 (15:01 +0200)] 
mdssvc: add support for parsing date ranges

Example:

  InRange(kMDItemContentCreationDate,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z))

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Oct 20 10:59:03 UTC 2025 on atb-devel-224

2 weeks agomdssvc: add a test for parsing Spotlight date ranges
Ralph Boehme [Fri, 17 Oct 2025 10:38:53 +0000 (12:38 +0200)] 
mdssvc: add a test for parsing Spotlight date ranges

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 weeks agomdssvc: reduce a log level to DEBUG
Ralph Boehme [Wed, 15 Oct 2025 12:56:51 +0000 (14:56 +0200)] 
mdssvc: reduce a log level to DEBUG

The expression

  InRange(*,$time.iso(2024-12-31T23:00:00Z),$time.iso(2025-12-31T23:00:00Z))

in a Spotlight query produces the following log message:

  map_fts: Mapping fts [757378800] unexpected op [~]

However, when

    elasticsearch:ignore unknown attribute = yes

is set, the parser will ignore the failed expression and continue
parsing given the expression is part of a larger expression like
"subexpression1 OR subexpression2". Avoid spamming the log and reduce
the loglevel when we hit this case.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 weeks agothird_party: Update cmocka to version 1.1.8
Andreas Schneider [Wed, 15 Oct 2025 09:39:42 +0000 (11:39 +0200)] 
third_party: Update cmocka to version 1.1.8

Signed-off-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): Fri Oct 17 12:16:23 UTC 2025 on atb-devel-224

2 weeks agos4:kdc: Fix cmocka.h include
Andreas Schneider [Fri, 17 Oct 2025 07:10:29 +0000 (09:10 +0200)] 
s4:kdc: Fix cmocka.h include

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agoAdd missing include needed for cmocka.h
Andreas Schneider [Thu, 7 Aug 2025 08:36:51 +0000 (10:36 +0200)] 
Add missing include needed for cmocka.h

This will be required in future.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agoctdb-scripts: Avoid failing updateip when IP is not assigned
Martin Schwenke [Thu, 16 Oct 2025 02:54:22 +0000 (13:54 +1100)] 
ctdb-scripts: Avoid failing updateip when IP is not assigned

There is no use failing this when it could behave more like takeip.

Use old interface of "__none__" as a hint that ctdbd doesn't think the
IP is assigned either.  In this case print a warning instead of an
error.  Take some care to avoid spurious errors in updateip.

After commit 0536d7a98b832fc00d26b09c26bf14fb63dbf5fb (which improves
IP address state checking), this will almost certainly not occur on
platforms with getifaddrs(3) (e.g. Linux).  This means it is only
likely to occur in 4.21 when net.ipv4.ip_nonlocal_bind=1.

Update test to match.

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

Reported-by: Bailey Allison <ballison@45drives.com>
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): Fri Oct 17 06:28:30 UTC 2025 on atb-devel-224

2 weeks agoctdb-scripts: Avoid printing a message if no connections
Martin Schwenke [Thu, 16 Oct 2025 02:51:27 +0000 (13:51 +1100)] 
ctdb-scripts: Avoid printing a message if no connections

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agoctdb-tests: Add an event script unit test for updateip
Martin Schwenke [Wed, 15 Oct 2025 23:42:22 +0000 (10:42 +1100)] 
ctdb-tests: Add an event script unit test for updateip

This illustrates the current failure where an unassigned public IP
address causes updateip to fail.

After commit 0536d7a98b832fc00d26b09c26bf14fb63dbf5fb (which improves
IP address state checking), this will almost certainly not occur on
platforms with getifaddrs(3) (e.g. Linux).  This means it is only
likely to occur in 4.21 when net.ipv4.ip_nonlocal_bind=1.

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

Reported-by: Bailey Allison <ballison@45drives.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agoctdb-daemon: Fix a crash due to a failed updateip
Martin Schwenke [Wed, 15 Oct 2025 21:17:44 +0000 (08:17 +1100)] 
ctdb-daemon: Fix a crash due to a failed updateip

This should really be a takeip.  However, CTDB's weak check of the IP
address state (using bind(2)) incorrectly indicates that the IP
address is assigned to an interface so it is converted to an updateip.

After commit 0536d7a98b832fc00d26b09c26bf14fb63dbf5fb (which improves
IP address state checking), this will almost certainly not occur on
platforms with getifaddrs(3) (e.g. Linux).  This means it is only
likely to occur in 4.21 when net.ipv4.ip_nonlocal_bind=1.

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

Reported-by: Bailey Allison <ballison@45drives.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agoCVE-2025-9640: s3/modules/vfs_streams_xattr fix unitialized write
Andrew Walker [Thu, 28 Aug 2025 19:36:19 +0000 (19:36 +0000)] 
CVE-2025-9640: s3/modules/vfs_streams_xattr fix unitialized write

This commit fixes a situation in which vfs_streams_xattr could
write unitialized memory into alternate data streams if the
user writes to an offset that is beyond the current end of file
to insert a hole in it.

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

Signed-off-by: Andrew Walker <andrew.walker@truenas.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Oct 16 19:47:19 UTC 2025 on atb-devel-224

3 weeks agoCVE-2025-9640: Add torture test for inserting hole in stream
Andrew Walker [Thu, 28 Aug 2025 19:39:34 +0000 (19:39 +0000)] 
CVE-2025-9640: Add torture test for inserting hole in stream

This commit adds an smb torture test for inserting a hole into
an alternate data stream and then verifying that hole contains
null bytes.

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

Signed-off-by: Andrew Walker <andrew.walker@truenas.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agosmbtorture: fix regression in smb2.bench
Ralph Boehme [Wed, 15 Oct 2025 14:30:20 +0000 (16:30 +0200)] 
smbtorture: fix regression in smb2.bench

The changes in b6757378be23 caused a regression where only the first
connection was used.

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

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): Thu Oct 16 18:42:05 UTC 2025 on atb-devel-224

3 weeks agotests: Run `dd` without any preloaded libraries
Andreas Schneider [Tue, 14 Oct 2025 09:57:04 +0000 (11:57 +0200)] 
tests: Run `dd` without any preloaded libraries

If AddressSanitizer is loaded it will detect alignment issues. The tool
is not ours, so ignore it.

Signed-off-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): Thu Oct 16 09:34:58 UTC 2025 on atb-devel-224

3 weeks agos3:util: Pass a memory context to get_challenge for ntlm_auth tests
Andreas Schneider [Tue, 14 Oct 2025 09:21:42 +0000 (11:21 +0200)] 
s3:util: Pass a memory context to get_challenge for ntlm_auth tests

Fixes memory leaks detected by LeakSanitizer.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>