]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 months agosmbd: Log client ip when rejecting nonencrypted sesssetups
Volker Lendecke [Mon, 10 Aug 2015 14:55:22 +0000 (16:55 +0200)] 
smbd: Log client ip when rejecting nonencrypted sesssetups

Used for better diagnosis

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agorpcclient: Print current_users for share info level 2
Volker Lendecke [Mon, 28 Oct 2013 16:03:06 +0000 (16:03 +0000)] 
rpcclient: Print current_users for share info level 2

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 months agosmbd: Fix getting fs capabilities
Volker Lendecke [Tue, 3 Mar 2026 15:41:03 +0000 (16:41 +0100)] 
smbd: Fix getting fs capabilities

The change from statvfs to fstatvfs has a bug: When this is called in
make_connection_snum, conn->cwd_fsp is not fully set up yet. So the
"This happens in create_conn_struct_as_root()" comment applies
everywhere. We need to look at the share rootdir, so open a pathref
fsp on it. This is called only once per tcon, so it's not in our hot
code path.

Found by a user who has "/" mounted readonly, and MacOS denied
writing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Mar  4 10:01:41 UTC 2026 on atb-devel-224

3 months agobuild: clang 21 re-enable -Wunititialized-const-pointer
Gary Lockyer [Mon, 2 Mar 2026 00:32:23 +0000 (13:32 +1300)] 
build: clang 21 re-enable -Wunititialized-const-pointer

[4102/5009] Compiling source4/torture/rpc/spoolss_notify.c
  ../../source4/torture/rpc/spoolss.c:3984:48: error: variable 'data' is
       uninitialized when passed as a const pointer argument here
       [-Werror,-Wuninitialized-const-pointer]
    3984CHECK_NEEDED_SIZE_LEVEL(spoolss_PrinterData, &data, type, needed, 1);

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Mar  3 05:55:25 UTC 2026 on atb-devel-224

3 months agobuild: Allow developer builds with clang 21
Gary Lockyer [Sun, 1 Mar 2026 23:53:19 +0000 (12:53 +1300)] 
build: Allow developer builds with clang 21

Disable clang warnings to allow samba to be compiled with clang 21.

Subsequent commits will fix the offending code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs: Remove unused SMB_VFS_GETWD()
Volker Lendecke [Tue, 17 Feb 2026 11:22:12 +0000 (12:22 +0100)] 
vfs: Remove unused SMB_VFS_GETWD()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Mar  1 21:22:24 UTC 2026 on atb-devel-224

3 months agovfs_shadow_copy2: Remove special chdir-handling
Volker Lendecke [Tue, 17 Feb 2026 11:03:45 +0000 (12:03 +0100)] 
vfs_shadow_copy2: Remove special chdir-handling

With only changing into the share root, and the share root never being
a @GMT-path or one with a twrp, we don't need special handling.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs_widelinks: Chdir never gets a relative path anymore
Volker Lendecke [Tue, 17 Feb 2026 10:22:13 +0000 (11:22 +0100)] 
vfs_widelinks: Chdir never gets a relative path anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agolib: Remove the "getwd cache"
Volker Lendecke [Mon, 16 Feb 2026 16:40:55 +0000 (17:40 +0100)] 
lib: Remove the "getwd cache"

No longer needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agotorture: Use SINGLETON_CACHE_TALLOC in tests
Volker Lendecke [Mon, 16 Feb 2026 16:38:02 +0000 (17:38 +0100)] 
torture: Use SINGLETON_CACHE_TALLOC in tests

GETWD_CACHE is on its way out. Despite not having _TALLOC in its name
nor it being marked as talloc in memcache.h, memcache_is_talloc()
shows it as being talloc'ed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs: Remove callers of SMB_VFS_GETWD()
Volker Lendecke [Mon, 16 Feb 2026 16:18:42 +0000 (17:18 +0100)] 
vfs: Remove callers of SMB_VFS_GETWD()

We don't chdir() arbitrarily. We can reference conn->connectpath
instead.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs: Significantly simplify vfs_ChDir_shareroot()
Volker Lendecke [Mon, 16 Feb 2026 15:55:58 +0000 (16:55 +0100)] 
vfs: Significantly simplify vfs_ChDir_shareroot()

Now that we are sure we don't chdir to arbitrary paths, and nobody
except vfs_ChDir_shareroot() calls vfs_GetWd() anymore, we can get rid
of the getwd cache and replace the LastDir-check with a simple

if (conn == chdir_lastconn_cache) {
return 0;
}

The places where we reset LastDir to NULL, forcing a real chdir, are
replaced by a call to reset_chdir_lastconn_cache().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs: A connectpath is never "."
Volker Lendecke [Mon, 16 Feb 2026 15:59:42 +0000 (16:59 +0100)] 
vfs: A connectpath is never "."

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs: Inline vfs_ChDir() into vfs_ChDir_shareroot()
Volker Lendecke [Mon, 16 Feb 2026 15:56:50 +0000 (16:56 +0100)] 
vfs: Inline vfs_ChDir() into vfs_ChDir_shareroot()

vfs_ChDir_shareroot() was the only caller of vfs_ChDir()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Make vfs_GetWd() static to vfs.c
Volker Lendecke [Mon, 16 Feb 2026 15:09:13 +0000 (16:09 +0100)] 
smbd: Make vfs_GetWd() static to vfs.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Inline print_impersonation_info()
Volker Lendecke [Mon, 16 Feb 2026 15:05:31 +0000 (16:05 +0100)] 
smbd: Inline print_impersonation_info()

With the fact that we only chdir() to the share root, we can directly
print conn->connectpath and avoid a call to vfs_GetWd()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Make vfs_ChDir() static
Volker Lendecke [Mon, 16 Feb 2026 15:01:47 +0000 (16:01 +0100)] 
smbd: Make vfs_ChDir() static

This makes it clear that we only ever chdir() to the root of a share.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfstest: Remove the chdir/getwd commands
Volker Lendecke [Mon, 16 Feb 2026 14:23:42 +0000 (15:23 +0100)] 
vfstest: Remove the chdir/getwd commands

Not called in test, remove them.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Avoid the VFS' chdir() call in close_cnum()
Volker Lendecke [Mon, 16 Feb 2026 14:19:49 +0000 (15:19 +0100)] 
smbd: Avoid the VFS' chdir() call in close_cnum()

The purpose of this call here is to make a file system
unmountable. For shares backed by a local file system, a direct
chdir(2) syscall to "/" will achieve the same, and shares like cephfs
backed by libraries without a local mount will not be affected
anyway. For them, a VFS level chdir("/") relative to a connection does
not make much sense anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Remove unused create_conn_struct_tos()
Volker Lendecke [Mon, 16 Feb 2026 14:16:07 +0000 (15:16 +0100)] 
smbd: Remove unused create_conn_struct_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agofss_srv: Use create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 14:12:59 +0000 (15:12 +0100)] 
fss_srv: Use create_conn_struct_chdir()

This is the last user of the non-chdir create_conn_struct_tos(). While
I don't fully understand the code, this is an RPC server that *should*
not care about the current working directory. There are some tests for
this in the rpc.fsrvp group of tests, so I don't think this breaks too
badly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Remove unused create_conn_struct_tos_cwd()
Volker Lendecke [Mon, 16 Feb 2026 13:21:17 +0000 (14:21 +0100)] 
smbd: Remove unused create_conn_struct_tos_cwd()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Call create_conn_struct_chdir() in get_referred_path()
Volker Lendecke [Mon, 16 Feb 2026 13:16:46 +0000 (14:16 +0100)] 
smbd: Call create_conn_struct_chdir() in get_referred_path()

create_conn_struct_tos_cwd() provides an attempt to chdir() back to
where we came from. This is flawed, because SMB_VFS_CHDIR() is always
relative to a connection, and conn_struct_tos_destructor() calls
vfs_ChDir() on the fake connection, not the one we came from.

Remove the flawed attempt to chdir() back in get_referred_path(). The
one caller in vfswrap_get_dfs_referrals() changes back to the "real"
connection that issued the dfs call from SMB, and the RPC server
callers don't care. They rely on the chdir("/") in
conn_wrap_destructor().

This adds one chdir("/") in smbd's "get referral" calls, but those
should be rare enough not to cause performance problems.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agodfssrv: Call create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 13:11:57 +0000 (14:11 +0100)] 
dfssrv: Call create_conn_struct_chdir()

This is inside an rpc server, where we don't depend on an implicit
current working directory. We don't need the "jump back to old cwd"
that create_conn_struct_tos_cwd() provided.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosrvsvc: Call create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 13:03:57 +0000 (14:03 +0100)] 
srvsvc: Call create_conn_struct_chdir()

This is inside an rpc server, where we don't depend on an implicit
current working directory. We don't need the "jump back to old cwd"
that create_conn_struct_tos_cwd() provided.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoeventlog: Use create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 12:57:08 +0000 (13:57 +0100)] 
eventlog: Use create_conn_struct_chdir()

I did not find any use of cwd-dependent calls in this code, the
eventlog tdb's are all relative to state_path(), which is absolute. As
this is in a rpc server we don't have to preserve any cwd.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoprinting: Call create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 12:48:54 +0000 (13:48 +0100)] 
printing: Call create_conn_struct_chdir()

This is only linked from rpcd_spoolss, where we don't depend on an
implicit current working directory. We don't need the "jump back to
old cwd" that create_conn_struct_tos_cwd() provided.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agonet: Use create_conn_struct_chdir() in "net vfs"
Volker Lendecke [Mon, 16 Feb 2026 12:43:04 +0000 (13:43 +0100)] 
net: Use create_conn_struct_chdir() in "net vfs"

We don't need to jump back to the previous cwd when exiting from the
net vfs process.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agopysmbd: Use create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 12:14:24 +0000 (13:14 +0100)] 
pysmbd: Use create_conn_struct_chdir()

pysmbd is the one user of fake connection_structs that depends on
not changing to "/" after the connection has been torn down. Add
special handling here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfstest: Use create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 11:46:34 +0000 (12:46 +0100)] 
vfstest: Use create_conn_struct_chdir()

We don't need to return to the old cwd when exiting the process.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Remove unused create_conn_struct_cwd()
Volker Lendecke [Mon, 16 Feb 2026 11:43:12 +0000 (12:43 +0100)] 
smbd: Remove unused create_conn_struct_cwd()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agomdssvc: Use create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 11:40:12 +0000 (12:40 +0100)] 
mdssvc: Use create_conn_struct_chdir()

Simplify mdssvc by using create_conn_struct_chdir()'s destructor plus
the vfs_ChDir_shareroot call.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Add create_conn_struct_chdir()
Volker Lendecke [Mon, 16 Feb 2026 11:36:25 +0000 (12:36 +0100)] 
smbd: Add create_conn_struct_chdir()

This is supposed to replace create_conn_struct_tos() in the next patches. Stay
tuned...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Leave sconn->ev_ctx as NULL for internal fake connections
Volker Lendecke [Thu, 12 Feb 2026 19:54:54 +0000 (20:54 +0100)] 
smbd: Leave sconn->ev_ctx as NULL for internal fake connections

These connection_structs are only there to access files like msdfs
symlinks or printer driver files. They will never participate in async
processing like sending out events or getting delayed for oplocks. Any
such use is a bug, because if you look at create_conn_struct_tos() we
create an event context that we will never poll on, so events posted
there will never finish. Leave the ev_ctx NULL so that we get an early
crash instead of running into problems later.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agomdssvc: Align an integer type
Volker Lendecke [Thu, 12 Feb 2026 19:31:19 +0000 (20:31 +0100)] 
mdssvc: Align an integer type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Remove a pointless TALLOC_FREE()
Volker Lendecke [Thu, 12 Feb 2026 19:14:08 +0000 (20:14 +0100)] 
smbd: Remove a pointless TALLOC_FREE()

This hangs off "c" anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agosmbd: Add vfs_ChDir_shareroot() wrapper
Volker Lendecke [Thu, 12 Feb 2026 19:01:48 +0000 (20:01 +0100)] 
smbd: Add vfs_ChDir_shareroot() wrapper

Clarify where we just change to the root of the export.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoprinting: Streamline move_driver_to_download_area()
Volker Lendecke [Thu, 12 Feb 2026 17:48:03 +0000 (18:48 +0100)] 
printing: Streamline move_driver_to_download_area()

Centralize cleanup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoprinting: Streamline delete_driver_files()
Volker Lendecke [Thu, 12 Feb 2026 13:43:57 +0000 (14:43 +0100)] 
printing: Streamline delete_driver_files()

Centralize cleanup

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoprinting: Streamline get_correct_cversion()
Volker Lendecke [Thu, 12 Feb 2026 12:01:30 +0000 (13:01 +0100)] 
printing: Streamline get_correct_cversion()

Make it return WERROR, centralize cleanup at the end of the function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoprinting: Modernize DEBUGs
Volker Lendecke [Thu, 12 Feb 2026 09:49:28 +0000 (10:49 +0100)] 
printing: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agorpc_server: Move dfs helper routines to srv_dfs_nt.c
Volker Lendecke [Wed, 11 Feb 2026 17:25:30 +0000 (18:25 +0100)] 
rpc_server: Move dfs helper routines to srv_dfs_nt.c

This makes it clear that these callers of create_conn_struct_tos_cwd()
don't really need to chdir() back to whatever cwd the process was in
before. RPC servers don't really have a concept of "implicit" current
working directory that is assumed to be the root dir of the current
share.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agos3/include: Remove unused BIG_UINT
Anoop C S [Sun, 1 Mar 2026 05:55:09 +0000 (11:25 +0530)] 
s3/include: Remove unused BIG_UINT

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Mar  1 11:18:37 UTC 2026 on atb-devel-224

3 months agos3/libsmb: Use PULL_LE_U64 for BIG_UINT
Anoop C S [Sun, 1 Mar 2026 05:53:52 +0000 (11:23 +0530)] 
s3/libsmb: Use PULL_LE_U64 for BIG_UINT

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agos3/include: Remove unused SBIG_UINT
Anoop C S [Sun, 1 Mar 2026 05:44:52 +0000 (11:14 +0530)] 
s3/include: Remove unused SBIG_UINT

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agos3/smbd: Convert smbd_do_qfsinfo() to use PUSH_LE_U64
Anoop C S [Sun, 1 Mar 2026 05:43:29 +0000 (11:13 +0530)] 
s3/smbd: Convert smbd_do_qfsinfo() to use PUSH_LE_U64

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agos3/libsmb: Convert build_fs_quota_buffer() to use PUSH_LE_U64
Anoop C S [Sun, 1 Mar 2026 05:42:21 +0000 (11:12 +0530)] 
s3/libsmb: Convert build_fs_quota_buffer() to use PUSH_LE_U64

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agos3:selftest: update aio_ratelimit tests for burst support
Avan Thakkar [Thu, 22 Jan 2026 16:18:37 +0000 (21:48 +0530)] 
s3:selftest: update aio_ratelimit tests for burst support

- Replace delay_max configuration with burst_mult parameters.
- Add three test cases: basic rate limiting, burst behavior, and recovery

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

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Feb 27 11:52:46 UTC 2026 on atb-devel-224

3 months agodocs-xml/manpages: update doc to add burst_mult parameters
Avan Thakkar [Thu, 22 Jan 2026 15:43:57 +0000 (21:13 +0530)] 
docs-xml/manpages: update doc to add burst_mult parameters

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

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs_aio_ratelimit: support human-readable bandwidth limits
Avan Thakkar [Thu, 22 Jan 2026 14:58:16 +0000 (20:28 +0530)] 
vfs_aio_ratelimit: support human-readable bandwidth limits

Allow read_bw_limit and write_bw_limit to be specified using
size suffixes (K/M/G/T).

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

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs_aio_ratelimit: Add per-share TDB persistence for local rate limiter state
Avan Thakkar [Tue, 2 Dec 2025 08:50:42 +0000 (14:20 +0530)] 
vfs_aio_ratelimit: Add per-share TDB persistence for local rate limiter state

Introduce local TDB storage for saving and restoring ratelimiter state
(iops_tokens, bytes_tokens, last timestamp). Each share now persists
its read/write limiter state under aio_ratelimit.tdb.

Added VERSION pseudo-key for schema versioning

On disconnect, save the latest state and close TDB.

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

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agovfs_aio_ratelimit: introduce burst-aware token bucket model
Avan Thakkar [Mon, 1 Dec 2025 12:34:54 +0000 (18:04 +0530)] 
vfs_aio_ratelimit: introduce burst-aware token bucket model

Refactor the rate limiter to use a continuous token-bucket model with
configurable burst multiplier. This replaces the older time-window and
delay_max logic.

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

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoquic_ko_wrapper: Fix a typo
Volker Lendecke [Tue, 24 Feb 2026 13:35:03 +0000 (14:35 +0100)] 
quic_ko_wrapper: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb 25 13:37:44 UTC 2026 on atb-devel-224

3 months agoquic_ko_wrapper: Fix a comment
Volker Lendecke [Tue, 24 Feb 2026 12:53:40 +0000 (13:53 +0100)] 
quic_ko_wrapper: Fix a comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agodsdb: Simplify samdb_cn_to_lDAPDisplayName()
Volker Lendecke [Tue, 24 Feb 2026 11:02:51 +0000 (12:02 +0100)] 
dsdb: Simplify samdb_cn_to_lDAPDisplayName()

Use GUID_buf_string(), dom_sid_str_buf() and talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agodsdb: Simplify drs_ObjectIdentifier_to_debug_string()
Volker Lendecke [Tue, 24 Feb 2026 11:00:39 +0000 (12:00 +0100)] 
dsdb: Simplify drs_ObjectIdentifier_to_debug_string()

Use GUID_buf_string(), dom_sid_str_buf() and talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agodsdb: Simplify samdb_dn_to_dns_domain() with talloc_asprintf_addbuf()
Volker Lendecke [Tue, 24 Feb 2026 10:54:30 +0000 (11:54 +0100)] 
dsdb: Simplify samdb_dn_to_dns_domain() with talloc_asprintf_addbuf()

Only check for NULL once

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agosmbd: Avoid a pointless if-statement
Volker Lendecke [Tue, 24 Feb 2026 10:19:56 +0000 (11:19 +0100)] 
smbd: Avoid a pointless if-statement

All you can read in optimizing guides is that branches are
expensive...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agosmbd: Introduce helper vars in SMB_QUERY_POSIX_WHOAMI
Volker Lendecke [Tue, 24 Feb 2026 10:18:26 +0000 (11:18 +0100)] 
smbd: Introduce helper vars in SMB_QUERY_POSIX_WHOAMI

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agolibcli: Avoid a talloc in ldap_encode_ndr_dom_sid()
Volker Lendecke [Tue, 24 Feb 2026 10:00:45 +0000 (11:00 +0100)] 
libcli: Avoid a talloc in ldap_encode_ndr_dom_sid()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Avoid casts in idmap_ad_unixids_to_sids()
Volker Lendecke [Tue, 24 Feb 2026 09:50:28 +0000 (10:50 +0100)] 
winbindd: Avoid casts in idmap_ad_unixids_to_sids()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Avoid a few NULL checks in idmap_ad_unixids_to_sids()
Volker Lendecke [Tue, 24 Feb 2026 09:49:17 +0000 (10:49 +0100)] 
winbindd: Avoid a few NULL checks in idmap_ad_unixids_to_sids()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Simplify winbindd_lookuprids_recv()
Volker Lendecke [Tue, 24 Feb 2026 09:43:09 +0000 (10:43 +0100)] 
winbindd: Simplify winbindd_lookuprids_recv()

Only check for NULL once with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Simplify wcache_make_sidlist()
Volker Lendecke [Tue, 24 Feb 2026 09:41:03 +0000 (10:41 +0100)] 
winbindd: Simplify wcache_make_sidlist()

Rely on talloc_asprintf_addbuf's NULL checks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Align integer types
Volker Lendecke [Tue, 24 Feb 2026 09:29:18 +0000 (10:29 +0100)] 
winbindd: Align integer types

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Add a missing NULL check in winbindd_list_trusted_domains()
Volker Lendecke [Tue, 24 Feb 2026 09:28:12 +0000 (10:28 +0100)] 
winbindd: Add a missing NULL check in winbindd_list_trusted_domains()

We did not check the result of talloc_asprintf_append_buffer()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Modernize a DEBUG
Volker Lendecke [Tue, 24 Feb 2026 09:23:21 +0000 (10:23 +0100)] 
winbindd: Modernize a DEBUG

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Simplify collect_onlinestatus()
Volker Lendecke [Tue, 24 Feb 2026 09:22:20 +0000 (10:22 +0100)] 
winbindd: Simplify collect_onlinestatus()

Only check for NULL once with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Simplify append_info3_as_txt()
Volker Lendecke [Tue, 24 Feb 2026 09:20:02 +0000 (10:20 +0100)] 
winbindd: Simplify append_info3_as_txt()

Only check for NULL once with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Simplify winbindd_getuserdomgroups_recv()
Volker Lendecke [Tue, 24 Feb 2026 09:16:41 +0000 (10:16 +0100)] 
winbindd: Simplify winbindd_getuserdomgroups_recv()

Only check for NULL once with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: Call dom_sid_str_buf() only once
Volker Lendecke [Tue, 24 Feb 2026 09:15:27 +0000 (10:15 +0100)] 
winbindd: Call dom_sid_str_buf() only once

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbindd: dom_sid_str_buf() returns "buf"
Volker Lendecke [Tue, 24 Feb 2026 08:56:12 +0000 (09:56 +0100)] 
winbindd: dom_sid_str_buf() returns "buf"

Save a line

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agowinbind: Simplify winbindd_xids_to_sids_recv() with talloc_asprintf_addbuf
Volker Lendecke [Tue, 24 Feb 2026 08:55:16 +0000 (09:55 +0100)] 
winbind: Simplify winbindd_xids_to_sids_recv() with talloc_asprintf_addbuf

Only check for NULL once

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agopam_winbind: Simplify _pam_compose_pwd_restriction_string
Volker Lendecke [Tue, 24 Feb 2026 08:44:49 +0000 (09:44 +0100)] 
pam_winbind: Simplify _pam_compose_pwd_restriction_string

Avoid explicit NULL handling with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 months agoctdb-tests: Update README
Martin Schwenke [Thu, 8 Jan 2026 04:21:15 +0000 (15:21 +1100)] 
ctdb-tests: Update README

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-common: Remove unused function ctdb_set_helper()
Martin Schwenke [Sat, 8 Nov 2025 10:33:34 +0000 (21:33 +1100)] 
ctdb-common: Remove unused function ctdb_set_helper()

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-daemon: Remove helper variable CTDB_DEBUG_LOCKS
Martin Schwenke [Fri, 31 Oct 2025 03:48:23 +0000 (14:48 +1100)] 
ctdb-daemon: Remove helper variable CTDB_DEBUG_LOCKS

Replace with a lock_debug_script member in ctdb_context.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Reorder and group script variables, add comments
Martin Schwenke [Fri, 31 Oct 2025 03:46:23 +0000 (14:46 +1100)] 
ctdb-tests: Reorder and group script variables, add comments

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Remove unused helper variable CTDB_SCRIPTS_HELPER_BINDIR
Martin Schwenke [Wed, 29 Oct 2025 09:46:03 +0000 (20:46 +1100)] 
ctdb-tests: Remove unused helper variable CTDB_SCRIPTS_HELPER_BINDIR

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-daemon: Remove helper variable CTDB_CLUSTER_MUTEX_HELPER
Martin Schwenke [Thu, 30 Oct 2025 11:30:27 +0000 (22:30 +1100)] 
ctdb-daemon: Remove helper variable CTDB_CLUSTER_MUTEX_HELPER

Use path_helperdir() to help construct the path and then cache the
result in the existing static buffer (with length adjusted because
POSIX says the +1 is not necessary).  Given the way this is used by
cluster_mutex_test, there is no (other) sane place to cache it.
path_helperdir_append() could be used to construct the path, but then
there would be an unnecessary talloc() result to free.

The flexibility in unit test cluster_mutex_003.sh was never used, so
remove this test.  If other cluster mutex helpers are added then they
can be tested by separate tests.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-daemon: Remove helper variable CTDB_LOCK_HELPER
Martin Schwenke [Thu, 30 Oct 2025 10:55:50 +0000 (21:55 +1100)] 
ctdb-daemon: Remove helper variable CTDB_LOCK_HELPER

Replace with a lock_helper member in ctdb_context, set using
path_helperdir_append().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-daemon: Remove helper variable CTDB_EVENTD
Martin Schwenke [Wed, 29 Oct 2025 10:20:55 +0000 (21:20 +1100)] 
ctdb-daemon: Remove helper variable CTDB_EVENTD

Simplify the initialisation of the path to eventd in eventd_context
using path_helperdir_append().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-recoverd: Remove some helper variables
Martin Schwenke [Wed, 29 Oct 2025 10:09:48 +0000 (21:09 +1100)] 
ctdb-recoverd: Remove some helper variables

Remove CTDB_RECOVERY_HELPER, CTDB_TAKEOVER_HELPER.  Add new struct
members in ctdb_recoverd to contain the paths, set via
path_helperdir_append().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tools: Remove some helper variables
Martin Schwenke [Mon, 27 Oct 2025 06:36:27 +0000 (17:36 +1100)] 
ctdb-tools: Remove some helper variables

Remove CTDB_EVENT_HELPER, CTDB_LVS_HELPER, CTDB_NATGW_HELPER.  Use
path_helperdir_append() instead.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-common: Add path_helperdir() and path_helperdir_append()
Martin Schwenke [Mon, 27 Oct 2025 04:47:55 +0000 (15:47 +1100)] 
ctdb-common: Add path_helperdir() and path_helperdir_append()

These can be used to locate helpers, either during in-tree
testing (using $CTDB_TEST_HELPER_BINDIR) or in their configured
installation location.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Drop an unnecessary use of CTDB_SCRIPTS_HELPER_BINDIR
Martin Schwenke [Wed, 29 Oct 2025 04:29:57 +0000 (15:29 +1100)] 
ctdb-tests: Drop an unnecessary use of CTDB_SCRIPTS_HELPER_BINDIR

As a helper, ctdb-path is in $CTDB_TEST_HELPER_BINDIR, which is in
$PATH.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Use CTDB_TEST_HELPER_BINDIR inline
Martin Schwenke [Wed, 29 Oct 2025 04:28:22 +0000 (15:28 +1100)] 
ctdb-tests: Use CTDB_TEST_HELPER_BINDIR inline

Replace most remaining uses of CTDB_SCRIPTS_TOOLS_HELPER_DIR and
CTDB_SCRIPTS_HELPER_BINDIR.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Remove redundant PATH adds
Martin Schwenke [Thu, 30 Oct 2025 03:37:11 +0000 (14:37 +1100)] 
ctdb-tests: Remove redundant PATH adds

These are covered because CTDB_TEST_HELPER_BINDIR is now added to
PATH.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Add CTDB_TEST_HELPER_BINDIR
Martin Schwenke [Wed, 29 Oct 2025 04:22:22 +0000 (15:22 +1100)] 
ctdb-tests: Add CTDB_TEST_HELPER_BINDIR

Now that generated scripts are linked into bin/, nothing needs to be
run from the tools/ directory anymore during self-test.  So, introduce
CTDB_TEST_HELPER_BINDIR to replace both CTDB_SCRIPTS_TOOLS_HELPER_DIR
and CTDB_SCRIPTS_HELPER_BINDIR.  Add this directory to PATH.

CTDB_TEST_HELPER_BINDIR will also be used in combination with
CTDB_TEST_MODE to allow helpers to be found via a single mechanism
that uses this single variable.  This will replace the multiple
mechanisms and variables currently used.

For simplicity, leave the old variables alone for now.  Replacing them
in a comprehensible way will take a few steps.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Silence some shellcheck complaints
Martin Schwenke [Wed, 29 Oct 2025 04:48:50 +0000 (15:48 +1100)] 
ctdb-tests: Silence some shellcheck complaints

Add most of the fixed files to the associated shellcheck unit test.
Include a couple of formatting fixups.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Reformat with "shfmt -w -i 0 -fn"
Martin Schwenke [Wed, 29 Oct 2025 04:44:42 +0000 (15:44 +1100)] 
ctdb-tests: Reformat with "shfmt -w -i 0 -fn"

Best reviewed with "git show -w" or similar.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Add a useful comment
Martin Schwenke [Wed, 29 Oct 2025 02:58:00 +0000 (13:58 +1100)] 
ctdb-tests: Add a useful comment

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-tests: Remove unused variables
Martin Schwenke [Wed, 29 Oct 2025 01:01:27 +0000 (12:01 +1100)] 
ctdb-tests: Remove unused variables

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-build: Store generator rules in variables
Martin Schwenke [Sun, 22 Feb 2026 22:40:58 +0000 (09:40 +1100)] 
ctdb-build: Store generator rules in variables

This improves readability and maintainability.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agoctdb-build: Ensure generated scripts are executable and symlinked
Martin Schwenke [Mon, 27 Oct 2025 06:32:47 +0000 (17:32 +1100)] 
ctdb-build: Ensure generated scripts are executable and symlinked

Ensure that all generated scripts are executable.  All of the
generated scripts (except test harnesses ctdb_run_tests,
ctdb_local_daemons) also need to be linked into the bin/ directory so
they can be more easily run during self-test.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agowafsamba: Add support for chmod of generated items
Martin Schwenke [Sun, 22 Feb 2026 22:22:35 +0000 (09:22 +1100)] 
wafsamba: Add support for chmod of generated items

CTDB generates scripts that are run during self-test, so add a chmod
option to SAMBA_GENERATOR().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 months agowafsamba: Add support for symlinking generated items
Martin Schwenke [Sun, 22 Feb 2026 03:31:28 +0000 (14:31 +1100)] 
wafsamba: Add support for symlinking generated items

CTDB generates scripts and these want to be used in self-test.  So,
update SAMBA_GENERATOR() to allow items to be symlinked into bin/.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Signed-off-by: Anoop C S <anoopcs@samba.org>
3 months agothird_party:heimdal: import lorikeet-heimdal-202602190236
Gary Lockyer [Thu, 19 Feb 2026 02:55:36 +0000 (15:55 +1300)] 
third_party:heimdal: import lorikeet-heimdal-202602190236

commits: 4223f36655031fd13ad3b0bedbc937dd9ba40c8d
 1a9371036d4baa7da50e9260e411eefa6cee0811
 53f5f685a474413d009249ecd7750399737dcd39

Action upstream feedback on KB5014754 changes.
pkinit:match_name Implement 3.1.5.2.1.3 Explicit Mapping

Calculate hash for KB5014754 SHA1-PUKEY over entire certificate

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Jennifer Sutton <jsutton@samba.org>
Autobuild-Date(master): Mon Feb 23 21:18:57 UTC 2026 on atb-devel-224

3 months agotest:heimdal:pkinit fixes for SHA1-PUKEY calculation
Gary Lockyer [Thu, 19 Feb 2026 22:55:59 +0000 (11:55 +1300)] 
test:heimdal:pkinit fixes for SHA1-PUKEY calculation

The SHA1 hash for KB5014754 SHA1-PUKEY is calculate over the entire
certificate not just the public key.

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 months agos4:kdc:db-glue:tests free principal
Gary Lockyer [Wed, 18 Feb 2026 23:19:35 +0000 (12:19 +1300)] 
s4:kdc:db-glue:tests free principal

Call krb5_free_principal to quiet valgrind leak reports

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>