]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 hours agokdc-heimdal: avoid NULL dereference when task is NULL master
Daniil Sarafannikov [Thu, 11 Jun 2026 13:56:45 +0000 (17:56 +0400)] 
kdc-heimdal: avoid NULL dereference when task is NULL

kdc_post_fork() may be called with NULL task pointer leading to a
call of task_server_terminate() with NULL pointer, where it will
be dereferenced.

Add an explicit NULL check and instead of attempting to terminate
a NULL task, log the error and return.

Pair-Programmed-With: Timofei Fedotov <sovtouch@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 19 08:22:25 UTC 2026 on atb-devel-224

20 hours agodocs-xml/manpages: Add man page for vfs_ceph_rgw gitlab/master
Vinit Agnihotri [Thu, 13 Nov 2025 05:37:59 +0000 (11:07 +0530)] 
docs-xml/manpages: Add man page for vfs_ceph_rgw

Document all module parameters.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Jun 18 15:58:55 UTC 2026 on atb-devel-224

21 hours agovfs_ceph_rgw: Add renameat method
Vinit Agnihotri [Thu, 26 Feb 2026 06:57:37 +0000 (12:27 +0530)] 
vfs_ceph_rgw: Add renameat method

rgw object store treats dirname as a prefix.
Thus if a particular prefix is part object name for number of objects,
renaming prefix does not reflect for other objects.

Therefor librgw do not recommend renaming directories, thus this
changelist fails dir renaming attempts. Renaming files are also
prohibited due to basic rgw limitation. See inline comments for details.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fstatat method
Vinit Agnihotri [Tue, 16 Jun 2026 10:04:40 +0000 (15:34 +0530)] 
vfs_ceph_rgw: Add fstatat method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fremovexattr method
Vinit Agnihotri [Wed, 3 Jun 2026 09:50:36 +0000 (15:20 +0530)] 
vfs_ceph_rgw: Add fremovexattr method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add lchown method
Vinit Agnihotri [Tue, 2 Jun 2026 11:28:11 +0000 (16:58 +0530)] 
vfs_ceph_rgw: Add lchown method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fchown method
Vinit Agnihotri [Tue, 2 Jun 2026 11:15:20 +0000 (16:45 +0530)] 
vfs_ceph_rgw: Add fchown method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fchmod method
Vinit Agnihotri [Tue, 2 Jun 2026 10:46:07 +0000 (16:16 +0530)] 
vfs_ceph_rgw: Add fchmod method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fstatvfs method
Vinit Agnihotri [Tue, 2 Jun 2026 10:25:55 +0000 (15:55 +0530)] 
vfs_ceph_rgw: Add fstatvfs method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add disk_free method
Vinit Agnihotri [Fri, 15 May 2026 07:51:17 +0000 (13:21 +0530)] 
vfs_ceph_rgw: Add disk_free method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add unlinkat method
Vinit Agnihotri [Thu, 26 Feb 2026 07:04:44 +0000 (12:34 +0530)] 
vfs_ceph_rgw: Add unlinkat method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add mkdirat method
Vinit Agnihotri [Thu, 26 Feb 2026 06:55:59 +0000 (12:25 +0530)] 
vfs_ceph_rgw: Add mkdirat method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add pwrite method
Vinit Agnihotri [Thu, 26 Feb 2026 06:53:27 +0000 (12:23 +0530)] 
vfs_ceph_rgw: Add pwrite method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fsetxattr method
Vinit Agnihotri [Thu, 26 Feb 2026 06:50:29 +0000 (12:20 +0530)] 
vfs_ceph_rgw: Add fsetxattr method

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add opendir, closedir, rewinddir and readdir method
Vinit Agnihotri [Mon, 12 Jan 2026 07:27:25 +0000 (12:57 +0530)] 
vfs_ceph_rgw: Add opendir, closedir, rewinddir and readdir method

readdir handling:
- rgw_readdir2() returns maximum 1000 entries per call. We cachec 100
  entries and supply entries from this cache, we maintain 'whence'.
- This 'whence' then act as an argument to subsequent readdir calls
that it can begin giving entries after 'whence'.
- In case of more than cached entries we call readdir only after upper
  layer consumes all previous entries. This is done to keep max memory
usage fix regardless of number of entries and also ensure we respond in
timely manner.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fntimes, fcntl and ftruncate methods
Shachar Sharon [Mon, 5 Jan 2026 10:11:17 +0000 (15:41 +0530)] 
vfs_ceph_rgw: Add fntimes, fcntl and ftruncate methods

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fsync_send/recv methods
Shachar Sharon [Mon, 5 Jan 2026 10:07:15 +0000 (15:37 +0530)] 
vfs_ceph_rgw: Add fsync_send/recv methods

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add fgetxattr method
Vinit Agnihotri [Mon, 5 Jan 2026 10:03:19 +0000 (15:33 +0530)] 
vfs_ceph_rgw: Add fgetxattr method

rgw_getxattrs always returns EINVAL on failure and sets errno.
Therefore use errno to return correct error code. In case of return code
is EINVAL but errno is 0, we return ENODATA as error.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add get_real_filename_at, get/set dos attribute methods
Vinit Agnihotri [Thu, 1 Jan 2026 12:10:35 +0000 (17:40 +0530)] 
vfs_ceph_rgw: Add get_real_filename_at, get/set dos attribute methods

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add sync and async read methods
Vinit Agnihotri [Thu, 1 Jan 2026 12:04:50 +0000 (17:34 +0530)] 
vfs_ceph_rgw: Add sync and async read methods

Pair-Programmed-With: Shachar Sharon <ssharon@redhat.com>
Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add openat, close and fstat methods
Vinit Agnihotri [Thu, 1 Jan 2026 10:44:41 +0000 (16:14 +0530)] 
vfs_ceph_rgw: Add openat, close and fstat methods

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add realpath, chdir, stat and lstat methods
Vinit Agnihotri [Thu, 1 Jan 2026 10:27:14 +0000 (15:57 +0530)] 
vfs_ceph_rgw: Add realpath, chdir, stat and lstat methods

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agovfs_ceph_rgw: Add connect and dis-connect methods to module
Vinit Agnihotri [Thu, 1 Jan 2026 07:28:00 +0000 (12:58 +0530)] 
vfs_ceph_rgw: Add connect and dis-connect methods to module

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
21 hours agosource3/wscript: Add new vfs module 'vfs_ceph_rgw'
Vinit Agnihotri [Wed, 12 Nov 2025 12:09:54 +0000 (17:39 +0530)] 
source3/wscript: Add new vfs module 'vfs_ceph_rgw'

Define new vfs module 'vfs_ceph_rgw' which serves as a handler for
hosting s3 bucket over object store defined by ceph-rgw.
This shall make use of librgw library to interface with s3 bucket

- Add configuration option --enable-cephrgw.
- Add 'vfs_ceph_rgw' module to build system.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 days agogensec: Slightly simplify gensec_security_oids_from_ops()
Volker Lendecke [Thu, 11 Jun 2026 17:13:27 +0000 (19:13 +0200)] 
gensec: Slightly simplify gensec_security_oids_from_ops()

We checked for "ops == NULL" above, and we never change it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Jun 17 09:33:52 UTC 2026 on atb-devel-224

2 days agogensec: Fix an error path memleak in gensec_security_oids_from_ops()
Volker Lendecke [Thu, 11 Jun 2026 11:56:33 +0000 (13:56 +0200)] 
gensec: Fix an error path memleak in gensec_security_oids_from_ops()

Probably irrelevant, mostly to please possible static checkers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agogensec: Remove unused "skip" parameter from gensec_security_by_oid_list()
Volker Lendecke [Thu, 11 Jun 2026 11:53:27 +0000 (13:53 +0200)] 
gensec: Remove unused "skip" parameter from gensec_security_by_oid_list()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agogensec: Remove unused "skip" parameter from gensec_security_oids()
Volker Lendecke [Thu, 11 Jun 2026 11:50:53 +0000 (13:50 +0200)] 
gensec: Remove unused "skip" parameter from gensec_security_oids()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agospnego: Simplify removing SPNEGO from a mech_types list
Volker Lendecke [Thu, 11 Jun 2026 11:44:59 +0000 (13:44 +0200)] 
spnego: Simplify removing SPNEGO from a mech_types list

This will enable removing the "skip" logic from gensec_security_oids()
and gensec_security_by_oid_list(). I find in particular the latter
function hard to follow, this patch will make it possible to slightly
simplify it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agogensec: Make gensec_security_by_oid_list() callable with skip==NULL
Volker Lendecke [Thu, 11 Jun 2026 11:24:17 +0000 (13:24 +0200)] 
gensec: Make gensec_security_by_oid_list() callable with skip==NULL

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agospnego: Remove a "const" that is not required
Volker Lendecke [Thu, 11 Jun 2026 11:21:47 +0000 (13:21 +0200)] 
spnego: Remove a "const" that is not required

We don't need the pointer to "mech_types" to be const, all we need is
to be able to point to const strings.

Why this patch? With this we can use functions from util_strlist.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agospnego: Fully initialize spnego_out structures
Volker Lendecke [Thu, 11 Jun 2026 11:03:00 +0000 (13:03 +0200)] 
spnego: Fully initialize spnego_out structures

Use struct initialization to benefit from NULL-initializing omitted
fields.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib: Simplify get_full_smb_filename()
Volker Lendecke [Thu, 7 May 2026 11:08:27 +0000 (13:08 +0200)] 
lib: Simplify get_full_smb_filename()

No point going full NTSTATUS if all this does is talloc_asprintf. One
call to map_errno_from_nt_status() less :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib: Convert get_peer_addr() to use ssaddr_buf
Volker Lendecke [Sun, 10 May 2026 18:10:22 +0000 (20:10 +0200)] 
lib: Convert get_peer_addr() to use ssaddr_buf

While there remove get_peer_addr_internal, returning the sockaddr was
not used.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agonet ads: Use ssaddr_str_buf()
Volker Lendecke [Tue, 16 Jun 2026 13:26:36 +0000 (15:26 +0200)] 
net ads: Use ssaddr_str_buf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agosmbd: Use ssaddr_str_buf()
Volker Lendecke [Sun, 10 May 2026 18:23:09 +0000 (20:23 +0200)] 
smbd: Use ssaddr_str_buf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib: Use ssaddr_str_buf()
Volker Lendecke [Sun, 10 May 2026 17:50:24 +0000 (19:50 +0200)] 
lib: Use ssaddr_str_buf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib: Add ssaddr_str_buf()
Volker Lendecke [Sun, 10 May 2026 07:59:36 +0000 (09:59 +0200)] 
lib: Add ssaddr_str_buf()

I know, this is the next variant of printing an IP address. Added
because I was tired of switch-casing for inet_ntop. This flavor is
in line with the type-safety of dom_sid_str_buf().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib/addns: Properly initialize dns_rr_ss in ads_dns_lookup()
Volker Lendecke [Sun, 3 May 2026 11:40:04 +0000 (13:40 +0200)] 
lib/addns: Properly initialize dns_rr_ss in ads_dns_lookup()

We've allocated state->nss only with talloc_array(), so dns_rr_ss.ss
was never properly initialized. Nobody looked at that yet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib/addns: Remove unused defines
Volker Lendecke [Thu, 30 Apr 2026 19:16:41 +0000 (21:16 +0200)] 
lib/addns: Remove unused defines

All current users of DNS_OPCODE_UPDATE reference dns.idl,
ERROR_INVALID_PARAMETER is defined elsewhere as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolibdns: Change struct dns_rr_srv to samba_sockaddr
Volker Lendecke [Thu, 28 May 2026 08:44:18 +0000 (10:44 +0200)] 
libdns: Change struct dns_rr_srv to samba_sockaddr

One call to sockaddr_storage_to_samba_sockaddr less ...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agoaddns: Remove unused async_dns_lookup_a[aaa]
Volker Lendecke [Fri, 29 May 2026 11:49:04 +0000 (13:49 +0200)] 
addns: Remove unused async_dns_lookup_a[aaa]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolib: Convert ads_dns_query_srv_send() to ads_dns_lookup_in()
Volker Lendecke [Wed, 27 May 2026 10:31:20 +0000 (12:31 +0200)] 
lib: Convert ads_dns_query_srv_send() to ads_dns_lookup_in()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agoutils: Convert net ads dns to ads_dns_lookup_in()
Volker Lendecke [Wed, 27 May 2026 10:31:20 +0000 (12:31 +0200)] 
utils: Convert net ads dns to ads_dns_lookup_in()

We can always ask for AAAA.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agoaddns: Add ads_dns_lookup_in()
Volker Lendecke [Wed, 27 May 2026 08:44:58 +0000 (10:44 +0200)] 
addns: Add ads_dns_lookup_in()

The next patches will convert all users of ads_dns_lookup_a[aaaa].

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agoaddns: Rename struct dns_tkey_record to addns_tkey_record
Volker Lendecke [Wed, 27 May 2026 09:01:38 +0000 (11:01 +0200)] 
addns: Rename struct dns_tkey_record to addns_tkey_record

This was preventing us from including librpc/gen_ndr/dns.h along with
lib/addns/dns.h.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolibdns: Make dns_res_rec_get_sockaddr() safe against invalid recs
Volker Lendecke [Sat, 23 May 2026 17:36:56 +0000 (19:36 +0200)] 
libdns: Make dns_res_rec_get_sockaddr() safe against invalid recs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agolibdns: Convert dns_res_rec_get_sockaddr() to samba_sockaddr
Volker Lendecke [Sat, 23 May 2026 14:01:44 +0000 (16:01 +0200)] 
libdns: Convert dns_res_rec_get_sockaddr() to samba_sockaddr

Avoid a few ugly casts

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 days agos3:vfs_streams_xattr: Use dirfsp in streams_xattr_unlinkat()
Andreas Schneider [Fri, 12 Jun 2026 13:50:40 +0000 (15:50 +0200)] 
s3:vfs_streams_xattr: Use dirfsp in streams_xattr_unlinkat()

Since commit 09f49fb56a4 ("smbd: Simplify delete_all_streams()"),
delete_all_streams() uses synthetic_smb_fname() instead of
synthetic_pathref(), passing a relative base_name to SMB_VFS_UNLINKAT()
that is relative to dirfsp, not the share root.

streams_xattr_unlinkat() creates a synthetic_pathref() for the base file
when fsp is NULL, but was using handle->conn->cwd_fsp (the share root)
instead of the passed dirfsp. This caused path resolution to fail for
files in subdirectories, leaving xattr streams intact after an OVERWRITE
or OVERWRITE_IF disposition.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 16 12:41:25 UTC 2026 on atb-devel-224

3 days agos3:smbd: Allow STREAM_INFORMATION query on alternate stream handles
Andreas Schneider [Mon, 15 Jun 2026 09:57:31 +0000 (11:57 +0200)] 
s3:smbd: Allow STREAM_INFORMATION query on alternate stream handles

according to MS-FSA querying for SMB_FILE_STREAM_INFORMATION on a stream is
valid and MS-FSA 2.1.5.12.29 FileStreamInformation tells us to return the streams
associated with the underlying File object:

* For each Stream ThisStream of Open.File ...

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

Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Close all handles in test_stream_io() in smb2.streams
Andreas Schneider [Fri, 14 Nov 2025 09:07:15 +0000 (10:07 +0100)] 
s4:torture: Close all handles in test_stream_io() in smb2.streams

Also check the return value from check_stream_list(). No change in behaviour.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Use torture_result() in check_stream_list() in smb2.streams
Andreas Schneider [Fri, 12 Jun 2026 13:02:04 +0000 (15:02 +0200)] 
s4:torture: Use torture_result() in check_stream_list() in smb2.streams

This change reveals a bug in the server: currently we do fail a getinfo request
SMB_FILE_STREAM_INFORMATION with NT_STATUS_INVALID_PARAMETER when issued on a
stream handle, but according to MS-FSA this is wrong, as "2.1.5.12.29
FileStreamInformation" just tells us to return the streams associated with the
underlying File object:

* For each Stream ThisStream of Open.File ...

The existing streams tests "io" and "create-disposition" make use of this
indirectly via the helper function check_stream_list(). As these tests didn't
check the return value from check_stream_list() and check_stream_list() doesn't
update the torture result state with a failure code, the tests were passing.

Mark these tests as knownfail until we've fixed the server code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Move smb2_util_close() do done in create_file_with_stream()
Andreas Schneider [Fri, 14 Nov 2025 09:27:00 +0000 (10:27 +0100)] 
s4:torture: Move smb2_util_close() do done in create_file_with_stream()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Add missing CHECK_STATUS() in test_stream_io()
Andreas Schneider [Fri, 14 Nov 2025 09:34:22 +0000 (10:34 +0100)] 
s4:torture: Add missing CHECK_STATUS() in test_stream_io()

Reviewed-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
3 days agos4:torture: Cleanup to to use the right name
Andreas Schneider [Fri, 14 Nov 2025 09:14:40 +0000 (10:14 +0100)] 
s4:torture: Cleanup to to use the right name

Not a bug, but just use the right union.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Make sure we close handles correctly in test_stream_names()
Andreas Schneider [Fri, 14 Nov 2025 09:14:24 +0000 (10:14 +0100)] 
s4:torture: Make sure we close handles correctly in test_stream_names()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Always close handle in check_stream() in smb2.streams
Andreas Schneider [Fri, 14 Nov 2025 09:12:21 +0000 (10:12 +0100)] 
s4:torture: Always close handle in check_stream() in smb2.streams

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 days agos4:torture: Close handles opened by torture_smb2_testdir() in smb2.streams test
Andreas Schneider [Fri, 14 Nov 2025 08:49:08 +0000 (09:49 +0100)] 
s4:torture: Close handles opened by torture_smb2_testdir() in smb2.streams test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 days agos3:rpc_server: Add check for empty account
Daniil Sarafannikov [Thu, 11 Jun 2026 15:09:57 +0000 (19:09 +0400)] 
s3:rpc_server: Add check for empty account

The code below uses account[strlen(account)-1] but there is
no clear guarantees that account can not be empty string.

Add the check for non-emptiness of account and return error
code in case it is empty.

Pair-Programmed-With: Sergey Zhidkih <rx1513@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sat Jun 13 19:22:29 UTC 2026 on atb-devel-224

6 days agos3:tests: Fix argument checks in test shell scripts
Andreas Schneider [Tue, 12 Nov 2024 07:53:50 +0000 (08:53 +0100)] 
s3:tests: Fix argument checks in test shell scripts

Fix the argument count check to match the number of required
positional parameters.

Sample failure:
[595(5736)/3145 at 15m52s, 1 errors] samba3.blackbox.update_keytab(ad_member_idmap_nss:local)
source3/script/tests/test_update_keytab.sh: line 16: shift: 2: shift count out of range

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sat Jun 13 10:30:59 UTC 2026 on atb-devel-224

6 days agos4:torture: Fix NULL pointer dereference in lpcfg_set_cmdline
kshumikhina [Thu, 11 Jun 2026 14:23:08 +0000 (18:23 +0400)] 
s4:torture: Fix NULL pointer dereference in lpcfg_set_cmdline

If orig_share is NULL, the program will jump to the done label, where the
lpcfg_set_cmdline function will be called without any checks; within that
function, no checks are performed either, and orig_share will be dereferenced.

Added a check if (orig_share != NULL) before calling lpcfg_set_cmdline
in the cleanup block.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Shumikhina Ksenia <shumikhinaka@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Jun 13 09:25:05 UTC 2026 on atb-devel-224

6 days agonsswitch:tests: Use testit_grep to get error printed if cmd fails
Andreas Schneider [Mon, 28 Oct 2024 14:09:44 +0000 (15:09 +0100)] 
nsswitch:tests: Use testit_grep to get error printed if cmd fails

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 Jun 12 17:30:41 UTC 2026 on atb-devel-224

6 days agos3: fix NULL pointer dereference in tcopy_passwd via pw_gecos
kshumikhina [Wed, 3 Jun 2026 21:50:52 +0000 (01:50 +0400)] 
s3: fix NULL pointer dereference in tcopy_passwd via pw_gecos

If gecos, displayName, and cn attributes are all missing from the LDAP entry,
unix_pw.pw_gecos remains NULL. This causes a crash inside tcopy_passwd due
to a NULL pointer dereference.

Fix this by falling back to an empty string, matching the behavior of
pw_dir and pw_shell.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Shumikhina Ksenia <shumikhinaka@sgu.ru>
Reviewed-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): Fri Jun 12 15:22:01 UTC 2026 on atb-devel-224

7 days agos4:dsdb: check if domain is not empty
Daniil Sarafannikov [Thu, 11 Jun 2026 14:58:37 +0000 (18:58 +0400)] 
s4:dsdb: check if domain is not empty

domain[strlen(domain)-1] leads to UB if strlen(domain) == 0,
so we add check that domain is not empty before accessing
the last symbol.

Pair-Programmed-With: Dmitriy Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 12 11:41:01 UTC 2026 on atb-devel-224

7 days agobootstrap: Update to Fedora 44
Andreas Schneider [Tue, 9 Jun 2026 08:59:24 +0000 (10:59 +0200)] 
bootstrap: Update to Fedora 44

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 Jun 12 09:41:28 UTC 2026 on atb-devel-224

7 days agopython: Catch UnsupportedAlgorithm in get_public_key()
Andreas Schneider [Wed, 10 Jun 2026 11:33:02 +0000 (13:33 +0200)] 
python: Catch UnsupportedAlgorithm in get_public_key()

cryptography.exceptions.UnsupportedAlgorithm is raised by
load_der_public_key() when the DER data references an unknown key OID,
which the test exercises with a bogus OID.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 days agolibcli: Fix another stringop-overflow false positive
Andreas Schneider [Tue, 9 Jun 2026 13:08:56 +0000 (15:08 +0200)] 
libcli: Fix another stringop-overflow false positive

libcli/auth/netlogon_creds_cli.c: In function ‘netlogon_creds_cli_check_negotiate_caps’:
lib/replace/replace.h:850:24: error: ‘memset_explicit’ writing 16 bytes into a
region of size 8 overflows the destination [-Werror=stringop-overflow=]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 days agos3:dbwrap: Fix zeroing wrec->added
Andreas Schneider [Tue, 9 Jun 2026 09:52:10 +0000 (11:52 +0200)] 
s3:dbwrap: Fix zeroing wrec->added

In file included from source3/include/includes.h:23,
                 from source3/lib/dbwrap/dbwrap_watch.c:20:
source3/lib/dbwrap/dbwrap_watch.c: In function ‘dbwrap_watched_watch_remove_instance’:
lib/replace/replace.h:850:24: error: ‘memset_explicit’ writing 32 bytes into a
region of size 24 overflows the destination [-Werror=stringop-overflow=]

GCC 15's -Wstringop-overflow analysis of memset_explicit (via the ZERO_STRUCT
macro) tracks the pointer through the (char *) cast and misidentifies the
destination as the first member pid (24 bytes) rather than the enclosing struct
dbwrap_watcher (32 bytes). This is a GCC false positive.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
7 days agotsocket: Use direct struct initialization
Volker Lendecke [Mon, 1 Jun 2026 12:05:28 +0000 (14:05 +0200)] 
tsocket: Use direct struct initialization

Avoid a ZERO_STRUCTP

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Jun 11 13:19:34 UTC 2026 on atb-devel-224

7 days agotsocket: Use direct struct initialization
Volker Lendecke [Mon, 1 Jun 2026 12:01:18 +0000 (14:01 +0200)] 
tsocket: Use direct struct initialization

Avoid a ZERO_STRUCT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agolibcli: Remove unnecessary NULL initializations
Volker Lendecke [Mon, 1 Jun 2026 11:53:53 +0000 (13:53 +0200)] 
libcli: Remove unnecessary NULL initializations

tevent_req_create already initializes "state" to all zeros.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agonet: Improve "net cache list"
Volker Lendecke [Tue, 2 Jun 2026 13:06:02 +0000 (15:06 +0200)] 
net: Improve "net cache list"

Just looking at the last character in a cache value to be 0 is not
enough to make it properly printable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agonet: Fix a memleak in "net cache list"
Volker Lendecke [Wed, 10 Jun 2026 07:36:22 +0000 (09:36 +0200)] 
net: Fix a memleak in "net cache list"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agosmbd: Fix DBG string
Volker Lendecke [Tue, 26 May 2026 12:57:40 +0000 (14:57 +0200)] 
smbd: Fix DBG string

The format string says "0x", so we should use PRIx32 instead of
PRIu32.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agoauth3: Fix whitespace
Volker Lendecke [Thu, 21 May 2026 05:31:34 +0000 (07:31 +0200)] 
auth3: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agosmbd: Inline dos_PutUniCode() into its only caller
Volker Lendecke [Wed, 20 May 2026 13:29:45 +0000 (15:29 +0200)] 
smbd: Inline dos_PutUniCode() into its only caller

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agolib: Convert dos_PutUniCode() to use an externally visible fn
Volker Lendecke [Thu, 11 Jun 2026 08:51:40 +0000 (10:51 +0200)] 
lib: Convert dos_PutUniCode() to use an externally visible fn

push_string_check() is a macro calling into push_string_check_fn(),
which calls directly into push_ucs2() if STR_UNICODE is set and
STR_ASCII is not set, which is the case in this calling site.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agolib: Remove unused "null_terminate" parameter from dos_PutUniCode()
Volker Lendecke [Wed, 20 May 2026 13:14:48 +0000 (15:14 +0200)] 
lib: Remove unused "null_terminate" parameter from dos_PutUniCode()

We only have one caller of this routine, and that sends "false".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agogensec: Remove a pointless #define
Volker Lendecke [Tue, 9 Jun 2026 13:29:06 +0000 (15:29 +0200)] 
gensec: Remove a pointless #define

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agogensec: Add NULL checks of talloc_reference() to gensec_subcontext_start()
Volker Lendecke [Tue, 9 Jun 2026 13:05:11 +0000 (15:05 +0200)] 
gensec: Add NULL checks of talloc_reference() to gensec_subcontext_start()

talloc_reference() can fail. While there, remove a pointer dereference
by introducing a local variable to build up the resulting subcontext.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agogensec: Remove a duplicate talloc_reference()
Volker Lendecke [Tue, 9 Jun 2026 13:03:16 +0000 (15:03 +0200)] 
gensec: Remove a duplicate talloc_reference()

This was done just one line above, we don't need two references.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agogensec: Remove some duplicate assignments
Volker Lendecke [Tue, 9 Jun 2026 12:59:42 +0000 (14:59 +0200)] 
gensec: Remove some duplicate assignments

A few lines above we have

(**gensec_security) = *parent;

which already initializes those struct elements.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 days agogensec: Fix a typo
Volker Lendecke [Sun, 3 May 2026 10:15:19 +0000 (12:15 +0200)] 
gensec: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 days agovfs_ceph_new: use proper 'name' in unlinkat
Shachar Sharon [Sun, 7 Jun 2026 07:26:14 +0000 (10:26 +0300)] 
vfs_ceph_new: use proper 'name' in unlinkat

Commit 5cab6a9be79 ("vfs_ceph_new: Enhance logging for improved
debugging and code flow visibility") improved logging by using the
modern 'smb_fname_str_dbg' function. However, it also changed unlinkat
hook to use this debug-logging function for 'name'. Revert this specific
change.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Jun 11 06:37:38 UTC 2026 on atb-devel-224

10 days agolibsmb: Fix dsgetdcname in cases where IPv6 addresses might be available
Volker Lendecke [Fri, 5 Jun 2026 10:21:42 +0000 (12:21 +0200)] 
libsmb: Fix dsgetdcname in cases where IPv6 addresses might be available

Previous code stored a struct NETLOGON_SAM_LOGON_RESPONSE_EX in
gencache for later retrieval. NETLOGON_SAM_LOGON_RESPONSE_EX can not
hold IPv6 addresses, so we had to replace it with "127.0.0.1". When
retrieving this later, we were using "127.0.0.1" as the DC address
that we were returning from dsgetdcname() via
dsgetdcname_cache_fetch(). This turns out to be not the right answer.

This changes dsgetdcname() to store the full struct
netr_DsRGetDCNameInfo that can hold IPv6 addresses. We also store it
under a different cache key including all function arguments, so that
existing cache entries can not mislead us.

This patch moves all cache handling to the main routine, which to me
makes it simpler to read.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jun  8 19:59:49 UTC 2026 on atb-devel-224

10 days agolibsmb: Simplify dsgetdcname()
Volker Lendecke [Tue, 2 Jun 2026 10:47:39 +0000 (12:47 +0200)] 
libsmb: Simplify dsgetdcname()

Using talloc_stackframe() is a common pattern in Samba for temporary
storage. Avoid the explicit "ptr_to_free" and replace it with a more
common pattern.

Also, the information that is stored "retry_query_with_null" is
available further down, use that directly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 days agotests: Fix samba4.blackbox.net_ads_join flakyness
Volker Lendecke [Tue, 2 Jun 2026 15:06:29 +0000 (17:06 +0200)] 
tests: Fix samba4.blackbox.net_ads_join flakyness

We have to leave against the same DC that we joined against, the
replication cycle might not have kicked in.

Normally, the server affinity cache takes care of this, but in this
test it's disabled.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 days agotests: Fix some wbinfo_lookuprids_cache flakyness
Volker Lendecke [Fri, 5 Jun 2026 09:37:55 +0000 (11:37 +0200)] 
tests: Fix some wbinfo_lookuprids_cache flakyness

If the key contains spaces, the shell qouting through "testit" does
not work properly. Avoid having to fix that quoting by replacing
spaces with '\20'.

You can force it by setting the

my $samsid = "S-1-5-21-1-32-" . int(rand(4294967295));

in selftest/target/Samba3.pm.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Jun  8 14:49:01 UTC 2026 on atb-devel-224

11 days agolibsecurity: Fix security_acl_dup()'s talloc hierarchy
Volker Lendecke [Thu, 28 May 2026 17:43:51 +0000 (19:43 +0200)] 
libsecurity: Fix security_acl_dup()'s talloc hierarchy

With claims and conditions, ACEs are no longer simple blobs, they
themselves are structures with talloc children. This means
talloc_memdup() is no longer sufficient to copy an ACE. Copy the whole
ACL via NDR.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=16095
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jun  8 11:47:54 UTC 2026 on atb-devel-224

2 weeks agolib:printer_driver: Added pointer validation
shumikhinaka [Wed, 3 Jun 2026 21:31:45 +0000 (01:31 +0400)] 
lib:printer_driver: Added pointer validation

If no comma is found, strchr_m will return NULL. p will be set to NULL, and
if (p) will not be executed. The variable p will remain set to NULL and will
be passed to the spoolss_driver_version_to_qword function.

If strchr_m returns NULL, the function immediately terminates and returns the
status NT_STATUS_INVALID_PARAMETER. This prevents invalid data from being
passed to subsequent functions.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Shumikhina Ksenia <shumikhinaka@sgu.ru>
Reviewed-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): Thu Jun  4 12:05:45 UTC 2026 on atb-devel-224

2 weeks agoutil_sd: fix incorrect strings match
Daniil Sarafannikov [Mon, 18 May 2026 12:28:01 +0000 (16:28 +0400)] 
util_sd: fix incorrect strings match

parse_ace() accepted strings like "ALLOWED123" as valid ACE
types because strncmp() compared only prefixes without
NULL terminators.

Switch to exact string comparison to ensure only valid
ACE type names are accepted.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Jun  3 08:26:04 UTC 2026 on atb-devel-224

2 weeks agoprinter_driver: fix incorrect processing of empty string
Daniil Sarafannikov [Mon, 11 May 2026 21:55:02 +0000 (01:55 +0400)] 
printer_driver: fix incorrect processing of empty string

get_string_token() accessed s[strlen(s) - 1] without checking
for empty strings. If a configuration value is present but empty,
this results in an out-of-bound read.

Add explicit empty string check before accessing last character.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 weeks agogenrand_util: fix possibly signed char modulo
Daniil Sarafannikov [Mon, 11 May 2026 21:46:13 +0000 (01:46 +0400)] 
genrand_util: fix possibly signed char modulo

generate_random_str_list_buf() fills the buffer with random bytes
using generate_secret_buffer(), but later uses the values as
char (possibly signed) when calculating the index into the
character list.

On platforms where char is signed, this may result in a negative
index and out-of-bounds read.

Cast buffer values to uint8_t before calculating modulo to ensure
the index is non-negative.

Pair-Programmed-With: Dmitry Mikhalchenko <tascad@altlinux.org>
Signed-off-by: Daniil Sarafannikov <sarafannikovda@sgu.ru>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 weeks agos4:dsdb: count_attrs fix cast-align warning
Gary Lockyer [Thu, 9 Apr 2026 01:22:58 +0000 (13:22 +1200)] 
s4:dsdb: count_attrs fix cast-align warning

data.dptr is allocated by malloc, so dptr will be correctly aligned.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Fri May 29 04:15:56 UTC 2026 on atb-devel-224

3 weeks agos4:lib:messaging:handlers fix cast-align warning
Gary Lockyer [Wed, 8 Apr 2026 22:33:39 +0000 (10:33 +1200)] 
s4:lib:messaging:handlers fix cast-align warning

Have added asserts to check the alignment, as do_inject_build and do_sleep are
only enabled in developer and selftest builds.

The pointers sig_p  and seconds_p where added for code readability, you can
dereference the result of discard_align_p directly i.e.
int sig = *discard_align_p(int, data->data);
but that's not immediately obvious

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 weeks agos4:libcli:resolve:dns_ex fix cast-align warning
Gary Lockyer [Wed, 8 Apr 2026 21:34:04 +0000 (09:34 +1200)] 
s4:libcli:resolve:dns_ex fix cast-align warning

rr->data is allocated via talloc in dns_unmarshal_rr so it will be correctly
aligned

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 weeks agos4:torture:smb:dir fix cast-align warnings
Gary Lockyer [Wed, 8 Apr 2026 00:50:47 +0000 (12:50 +1200)] 
s4:torture:smb:dir fix cast-align warnings

Use memcpy to extract the pointer, suppressing the cast-align warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
3 weeks agobootstrap: we don't use python3-requests
Douglas Bagnall [Wed, 27 May 2026 22:38:52 +0000 (10:38 +1200)] 
bootstrap: we don't use python3-requests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 28 18:42:21 UTC 2026 on atb-devel-224

3 weeks agotests:gpo: drop unused mock requests module
Douglas Bagnall [Wed, 27 May 2026 22:37:34 +0000 (10:37 +1200)] 
tests:gpo: drop unused mock requests module

Since 4c2db6489be1364a8ce2841f7eedcd976fa1463b (for CVE-2026-3012)
gp_cert_auto_enroll_ext does not use the requests module, so for the
test we no longer need to intercept it using monkey patching.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agobuild: add -Werror=tautological-compare
Stefan Metzmacher [Thu, 28 May 2026 09:26:31 +0000 (11:26 +0200)] 
build: add -Werror=tautological-compare

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

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