]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
3 weeks agoaddns: Remove unused dns_errstr()
Volker Lendecke [Sat, 13 Jun 2026 10:45:42 +0000 (12:45 +0200)] 
addns: Remove unused dns_errstr()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet: Convert net_dns.c to NTSTATUS
Volker Lendecke [Sat, 13 Jun 2026 09:57:27 +0000 (11:57 +0200)] 
net: Convert net_dns.c to NTSTATUS

In the gss code at many places we lost the underlying NTSTATUS code
and just replace it with DNS_GSS_ERROR. Don't loose that information.

This brings a slight change in behaviour for the interactive join
command: Instead of retrying with "the next" nameserver on very
specific errors we retry on all errors. I'm not sure the previous
behaviour did anything good, and as this is an interactive command all
that might happen is that the user has to wait a bit longer on
failure.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet: Move dns_negotiate_sec_ctx() into its only caller
Volker Lendecke [Sat, 13 Jun 2026 08:59:08 +0000 (10:59 +0200)] 
net: Move dns_negotiate_sec_ctx() into its only caller

Now that it's converted to NDR-generated structures and uses
dns_cli_request() from toplevel libcli/dns, dns_negotiate_sec_ctx()
does not have to live in lib/addns anymore. If we were to make this
more generally available, it would move together with
DoDNSUpdateNegotiateGensec() or even DoDNSUpdate().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agoaddns: Move dns_domain_name_from_string() into its only calling file
Volker Lendecke [Sat, 13 Jun 2026 08:51:04 +0000 (10:51 +0200)] 
addns: Move dns_domain_name_from_string() into its only calling file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet dns: Move the functionality of dns_generate_keyname()
Volker Lendecke [Sat, 13 Jun 2026 08:35:14 +0000 (10:35 +0200)] 
net dns: Move the functionality of dns_generate_keyname()

This is just a random GUID string, so I don't think we need to hide it
behind a function. python/samba/tests/dns_base.py also does it with a
plain "uuid.uuid4()".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Avoid QTYPE_ defines, use idl defines
Volker Lendecke [Tue, 31 Mar 2026 18:14:46 +0000 (20:14 +0200)] 
lib/addns: Avoid QTYPE_ defines, use idl defines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Avoid DNS_CLASS defines, use idl defines
Volker Lendecke [Tue, 31 Mar 2026 18:07:41 +0000 (20:07 +0200)] 
lib/addns: Avoid DNS_CLASS defines, use idl defines

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Include librpc/gen_ndr/dns.h
Volker Lendecke [Tue, 31 Mar 2026 17:54:02 +0000 (19:54 +0200)] 
lib/addns: Include librpc/gen_ndr/dns.h

Make gen_ndr/dns.h available, so that we can replace definitions in
lib/addns/dns.h with the IDL-defined ones.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agosource4/libcli/resolve: Convert away from dns_unmarshall
Volker Lendecke [Mon, 27 Apr 2026 16:20:45 +0000 (18:20 +0200)] 
source4/libcli/resolve: Convert away from dns_unmarshall

Use pidl-based DNS routines, avoid hand-marshalling DNS routines
outside of lib/addns.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Make some functions static
Volker Lendecke [Thu, 14 May 2026 08:29:40 +0000 (10:29 +0200)] 
lib/addns: Make some functions static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet: Remove unused "struct dns_connection *conn"
Volker Lendecke [Sat, 13 Jun 2026 09:20:32 +0000 (11:20 +0200)] 
net: Remove unused "struct dns_connection *conn"

With the conversion to PIDL-based dns client routines we don't need it
anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Use NDR marshalling for signed DNS updates
Volker Lendecke [Thu, 14 May 2026 08:14:58 +0000 (10:14 +0200)] 
lib/addns: Use NDR marshalling for signed DNS updates

This together with the previous patch removes a lot of code depending
on the hand-marshalling in lib/addns. Overall it's about 50 lines code
less, but it will make it possible to remove more code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolibcli/dns: Add infrastructure for DNS updates
Volker Lendecke [Sun, 3 May 2026 18:06:15 +0000 (20:06 +0200)] 
libcli/dns: Add infrastructure for DNS updates

This creates struct dns_name_packets equivalent of
dns_create_update_request() in lib/addns to allow the use of dns.idl
structures instead of hand-marshalling DNS packets in lib/addns.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolibcli/dns: Don't use UDP for TSIG/TKEY operations
Volker Lendecke [Sun, 3 May 2026 18:20:01 +0000 (20:20 +0200)] 
libcli/dns: Don't use UDP for TSIG/TKEY operations

An error makes dns_cli_request_udp_done() fall back to TCP.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet ads dns: Use A/AAAA records if the NS query gave them
Volker Lendecke [Mon, 11 May 2026 19:23:56 +0000 (21:23 +0200)] 
net ads dns: Use A/AAAA records if the NS query gave them

Windows tends to give us the addresses in the NS response, so try to
avoid additional round-trips. As before, just use the first record we
were given.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet: Fill in _nameserver.ss_s when -S has been given to net ads join
Volker Lendecke [Sat, 13 Jun 2026 13:14:48 +0000 (15:14 +0200)] 
net: Fill in _nameserver.ss_s when -S has been given to net ads join

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Make sure ads_dns_lookup_ns() returns addresses
Volker Lendecke [Sun, 3 May 2026 11:42:03 +0000 (13:42 +0200)] 
lib/addns: Make sure ads_dns_lookup_ns() returns addresses

Windows tends to return A/AAAA records when looking up nameserver
records, Samba seems not to do that. We want to avoid unnecessary
lookups.

Do it differently from ads_dns_lookup_srv: For SRV records we have an
additional layer on top of ads_dns_lookup_srv_send/recv in
dnsquery_srv.c. I don't think that additional layer is necessary, so
converting the SRV lookup to this scheme is a TODO now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agoaddns: Add a "timeout" parameter to ads_dns_lookup_ns()
Volker Lendecke [Sat, 13 Jun 2026 07:49:40 +0000 (09:49 +0200)] 
addns: Add a "timeout" parameter to ads_dns_lookup_ns()

Will be used as a timeout for subrequests to be triggered for A/AAAA
records like ads_dns_query_srv_send() already does it. Use uint32_t,
tevent_timeout_current_ofs wants that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Add ServerAddress parameter to DoDNSUpdate()
Volker Lendecke [Sun, 3 May 2026 10:42:46 +0000 (12:42 +0200)] 
lib/addns: Add ServerAddress parameter to DoDNSUpdate()

pszServerName was used for two things: Input for getaddrinfo() to find
the name server to talk to, and also for gensec_set_target_hostname()
for finding the Kerberos target principal. Split this up to enable
using the A records from the DNS NS query directly, i.e. giving
DoDNSUpdate() an IP address to talk to.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolib/addns: Prepare for multiple IPs per NS record
Volker Lendecke [Sun, 3 May 2026 07:56:11 +0000 (09:56 +0200)] 
lib/addns: Prepare for multiple IPs per NS record

struct dns_rr_srv for SRV records already supports multiple
IPs. Prepare for the same with NS records. No changes in the callers
required, nobody looks at that yet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agoaddns: Make matching A to NS records case insensitive
Volker Lendecke [Sat, 13 Jun 2026 07:17:16 +0000 (09:17 +0200)] 
addns: Make matching A to NS records case insensitive

We do the same in ads_dns_lookup_srv_done(), there is no reason to
believe the same can not happen for ns records.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agonet_dns: Apply some const to DoDNSUpdate()
Volker Lendecke [Mon, 27 Apr 2026 11:56:27 +0000 (13:56 +0200)] 
net_dns: Apply some const to DoDNSUpdate()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolibcli/dns: Add dns_cli_request() sync wrapper
Volker Lendecke [Thu, 23 Apr 2026 09:13:17 +0000 (11:13 +0200)] 
libcli/dns: Add dns_cli_request() sync wrapper

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolibcli/dns: Make dns_cli_request_send() take a dns_name_packet()
Volker Lendecke [Thu, 23 Apr 2026 08:53:19 +0000 (10:53 +0200)] 
libcli/dns: Make dns_cli_request_send() take a dns_name_packet()

Factor out dns_cli_create_query(), allow dns_cli_request_send() to be
used for other transactions than just DNS_OPCODE_QUERY.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agolibsmb: Convert resolve_name() to return struct samba_sockaddr
Volker Lendecke [Sat, 13 Jun 2026 12:51:47 +0000 (14:51 +0200)] 
libsmb: Convert resolve_name() to return struct samba_sockaddr

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
3 weeks agosmbd: Remove unnecessary code
Volker Lendecke [Wed, 1 Jul 2026 16:02:01 +0000 (18:02 +0200)] 
smbd: Remove unnecessary code

A few lines above we already have zeroed out the first 16 bytes of
blob_out.data.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jul  3 05:51:26 UTC 2026 on atb-devel-224

3 weeks agosmbd: Move smb1-specific code out of the common negprot_spnego()
Volker Lendecke [Wed, 1 Jul 2026 16:00:24 +0000 (18:00 +0200)] 
smbd: Move smb1-specific code out of the common negprot_spnego()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agosmbd: Move two SMB1-only functions to smb1_utils.c
Volker Lendecke [Wed, 1 Jul 2026 15:39:59 +0000 (17:39 +0200)] 
smbd: Move two SMB1-only functions to smb1_utils.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agolib: Some README.Coding for message_push_blob()
Volker Lendecke [Thu, 2 Jul 2026 14:28:24 +0000 (16:28 +0200)] 
lib: Some README.Coding for message_push_blob()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agolib: Add some overflow protection to message_push_blob()
Volker Lendecke [Wed, 1 Jul 2026 15:34:54 +0000 (17:34 +0200)] 
lib: Add some overflow protection to message_push_blob()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agosmbd: Remove code commented out >15y ago
Volker Lendecke [Wed, 1 Jul 2026 15:14:33 +0000 (17:14 +0200)] 
smbd: Remove code commented out >15y ago

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agoauth3: A bit README.Coding in load_auth_module()
Volker Lendecke [Wed, 1 Jul 2026 15:08:05 +0000 (17:08 +0200)] 
auth3: A bit README.Coding in load_auth_module()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agoauth3: Reduce indentation with an early return
Volker Lendecke [Wed, 1 Jul 2026 15:05:54 +0000 (17:05 +0200)] 
auth3: Reduce indentation with an early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agoauth3: Modernize DEBUGs
Volker Lendecke [Wed, 1 Jul 2026 15:04:45 +0000 (17:04 +0200)] 
auth3: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agoauth3: Put "module_name" on the stack
Volker Lendecke [Wed, 1 Jul 2026 15:03:17 +0000 (17:03 +0200)] 
auth3: Put "module_name" on the stack

Avoid having to do a SAFE_FREE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agolib: Avoid ZERO_STRUCT with {} plus calling asn1_load_nocopy
Volker Lendecke [Wed, 1 Jul 2026 11:01:37 +0000 (13:01 +0200)] 
lib: Avoid ZERO_STRUCT with {} plus calling asn1_load_nocopy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agolib: Avoid ZERO_STRUCTP with struct assignments
Volker Lendecke [Wed, 1 Jul 2026 10:57:43 +0000 (12:57 +0200)] 
lib: Avoid ZERO_STRUCTP with struct assignments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agogensec: Avoid an "else"
Volker Lendecke [Wed, 1 Jul 2026 10:54:28 +0000 (12:54 +0200)] 
gensec: Avoid an "else"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agokdc: Make sure fields are initialized
Volker Lendecke [Tue, 30 Jun 2026 11:38:25 +0000 (13:38 +0200)] 
kdc: Make sure fields are initialized

Use struct initializations

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agopassdb: Avoid explicit NULL checks with talloc_asprintf_addbuf()
Volker Lendecke [Tue, 30 Jun 2026 11:22:04 +0000 (13:22 +0200)] 
passdb: Avoid explicit NULL checks with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agowinbind: Avoid explicit NULL checks with talloc_asprintf_addbuf()
Volker Lendecke [Tue, 30 Jun 2026 11:12:12 +0000 (13:12 +0200)] 
winbind: Avoid explicit NULL checks with talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 weeks agolib/ldb-samba: add support for the netlogon attribte for --show-binary
Stefan Metzmacher [Thu, 28 May 2026 14:31:54 +0000 (16:31 +0200)] 
lib/ldb-samba: add support for the netlogon attribte for --show-binary

Can be used for searches typically used via CLDAP.

ldbsearch -H ldap://172.31.9.115 -U% -b '' -s base \
       '(&(NtVer=\16\00\00\00))' netlogon --show-binary

Note '(NtVer=\16\00\00\00)' alone doesn't work and
results in no entries.

The value is actually netlogon_nt_version_flags in little endian,
in this example:

NETLOGON_NT_VERSION_5 |
NETLOGON_NT_VERSION_5EX |
NETLOGON_NT_VERSION_WITH_CLOSEST_SITE

Note filters like this also work against Windows,
but samba doesn't handle them yet:

'(&(NtVer=\16\00\00\00)(DnsDomain=ForestDnsZones.w2025p-l8.base))'
'(&(NtVer=\16\00\00\00)(DnsDomain=DomainDnsZones.w2025p-l8.base))'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul  2 13:07:31 UTC 2026 on atb-devel-224

3 weeks agolibcli/netlogon: add some const to pull_{netlogon_samlogon,nbt_netlogon}_response()
Stefan Metzmacher [Thu, 28 May 2026 14:30:19 +0000 (16:30 +0200)] 
libcli/netlogon: add some const to pull_{netlogon_samlogon,nbt_netlogon}_response()

pull_* functions should use the data blob read-only.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agos3:libsmb: let dsgetdcname_rediscover() try process_dc_dns() before process_dc_netbios()
Stefan Metzmacher [Wed, 20 May 2026 14:22:27 +0000 (16:22 +0200)] 
s3:libsmb: let dsgetdcname_rediscover() try process_dc_dns() before process_dc_netbios()

It's 2026 we typically have AD domains, and most of the time no nmbd
running.

So we should try CLDAP before falling back name_status_find(),
this allows us to detect that the domain is an AD domain even if
we searched with the netbios domain name.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul  2 09:33:10 UTC 2026 on atb-devel-224

3 weeks agos3:rpc_server/dfs: fix temporary read of unrelated or non-existing memory
Stefan Metzmacher [Thu, 14 May 2026 11:34:13 +0000 (13:34 +0200)] 
s3:rpc_server/dfs: fix temporary read of unrelated or non-existing memory

This was reported by Arjun Basnet with Securin Labs.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 weeks agos4:cracknames: make consistent use of ldb_binary_encode_string()
Stefan Metzmacher [Thu, 14 May 2026 11:36:33 +0000 (13:36 +0200)] 
s4:cracknames: make consistent use of ldb_binary_encode_string()

A client provided value can be passed into a filter
without going through ldb_binary_encode_string()

But the value is only appended via a to "name=%s",
so there's no leading "(", which means
in lib/ldb/common/ldb_parse.c:356: the value-parsing loop terminates
at the first unescaped ')', so a payload like "users)(hidden=*" collapses to
"(name=users)" with the trailing bytes silently discarded. An escaped "\)" makes
ldb_parse_tree() return NULL rather than admit injection. Combined with
LDB_SCOPE_ONELEVEL, the attribute list restricted to ["name"], and the fact that
a DRSUAPI-authenticated client can already issue arbitrary LDAP searches via
dcesrv_samdb_connect_as_user(), there is no escalation surface.

So this is only hardening helping AI to avoid reporting
false positives.

This was reported by Arjun Basnet with Securin Labs.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 weeks agopam_winbind: fix partial configuration argument matching
shumikhinaka [Tue, 30 Jun 2026 19:51:34 +0000 (23:51 +0400)] 
pam_winbind: fix partial configuration argument matching

get_config_item_int and get_conf_item_string function used strncmp
to check command line arguments, but didn't verify the trailing character.
This allowed partial prefix matches
(e.g., matching "itemXYZ=value" when looking for "item").

Refactored lookup-logic to ensure correct parsing.

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): Wed Jul  1 09:30:23 UTC 2026 on atb-devel-224

4 weeks agos3:srvsvc: add NULL and empty string check in is_hidden_share()
Daniil Sarafannikov [Thu, 25 Jun 2026 20:20:34 +0000 (00:20 +0400)] 
s3:srvsvc: add NULL and empty string check in is_hidden_share()

The function lp_servicename() can return NULL string. Also there
is no guarantee that string is not empty. Add explicit checks for
both cases to avoid invalid access in net_name[len - 1].

Also remove use of True/False.

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: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jul  1 07:18:54 UTC 2026 on atb-devel-224

4 weeks agos3:utils: Fix dereference of NULL ctx when memory is not allocated
Daniil Sarafannikov [Thu, 25 Jun 2026 21:06:26 +0000 (01:06 +0400)] 
s3:utils: Fix dereference of NULL ctx when memory is not allocated

In case talloc_zero returns NULL, we must return NULL from
function check_ctx_create(). Otherwise, we dereference NULL
pointer when accessing fields of ctx struct.

Suggested-by: Anoop C S <anoopcs@samba.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): Tue Jun 30 13:39:52 UTC 2026 on atb-devel-224

4 weeks agos3:utils: Fix possible dereference of NULL ctx
Daniil Sarafannikov [Tue, 23 Jun 2026 17:03:03 +0000 (21:03 +0400)] 
s3:utils: Fix possible dereference of NULL ctx

In case check_ctx_create in net_registry_check_db() returns NULL,
the pointer ctx is NULL and execution jumps to 'done' label,
where function check_ctx_transaction_stop is called.
In this fuction the ctx pointer is dereferenced instantly,
so the NULL pointer will be dereferenced.

In case check_ctx_create returns NULL,
we can just return -1 from net_registry_check_db.

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: Volker Lendecke <vl@samba.org>
4 weeks agos3:smbd/utmp: fix potential negative index in ut_id_encode
Daniil Sarafannikov [Mon, 22 Jun 2026 18:05:30 +0000 (22:05 +0400)] 
s3:smbd/utmp: fix potential negative index in ut_id_encode

session_global_id is a uint32_t, but ut_id_encode() takes int.
In case session ID is larger than INT_MAX, the conversion may
lead to negative value and after modulo operation `i % nbase`
it may be negative.

Change the argument type to unsigned int and update all
callers (sys_utmp_fill, sys_utmp_claim, sys_utmp_yield) to
use uint32_t.

Pair-Programmed-With: Dina Tagantseva <dinchik@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>
4 weeks agos3:winbindd: only call init_dc_connection_rpc() for NCACN_NP connections
Stefan Metzmacher [Thu, 25 Jun 2026 15:22:07 +0000 (17:22 +0200)] 
s3:winbindd: only call init_dc_connection_rpc() for NCACN_NP connections

As init_dc_connection_rpc() will return NT_STATUS_TRUSTED_DOMAIN_FAILURE
if domain->conn.cli is NULL and this is the case when we
have domain->conn.ignore_smb_disconnected as true.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14638
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16067
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16151

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 26 16:10:29 UTC 2026 on atb-devel-224

4 weeks agosmbd: check the return value before the ACE-lists out args
Ralph Boehme [Mon, 8 Jun 2026 12:12:14 +0000 (14:12 +0200)] 
smbd: check the return value before the ACE-lists out args

If unpack_canon_ace() fails and returns false, file_ace_list and dir_ace_list
will be left at their initial NULL values, so we exit out at

if (!file_ace_list && !dir_ace_list) {
return NT_STATUS_OK;
}

instead of at the subsequent error checking code for acl_perms.

This subtle change was introduced by commit
81533e2d39cae11b7ea06f289a7c398ed3c51da9 and causes attempts to set an
non-canonical ACL by clients to return NT_STATUS_OK, instead of failing with
NT_STATUS_ACCESS_DENIED.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jun 26 12:50:29 UTC 2026 on atb-devel-224

4 weeks agosmbd: prepare for correct error handling for callers of unpack_canon_ace()
Ralph Boehme [Mon, 8 Jun 2026 12:11:33 +0000 (14:11 +0200)] 
smbd: prepare for correct error handling for callers of unpack_canon_ace()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 weeks agosmbtorture: add test smb2.acls.NON-CANONICAL-ORDER
Ralph Boehme [Mon, 8 Jun 2026 13:18:35 +0000 (15:18 +0200)] 
smbtorture: add test smb2.acls.NON-CANONICAL-ORDER

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 weeks agosmbtorture: split smb2.acls into acls-with-sysacl and acls-ignore-sysacl
Ralph Boehme [Mon, 8 Jun 2026 13:49:57 +0000 (15:49 +0200)] 
smbtorture: split smb2.acls into acls-with-sysacl and acls-ignore-sysacl

The smb2.acls test suite contains tests (OWNER-RIGHTS-DENY1 and DENY1) that use
non-canonical ACLs (containing out-of-order DENY ACEs).  Under standard POSIX
draft/system ACL mapping, such non-canonical ACLs cannot be represented
on the underlying file system, hence the current code is supposed to fail
attempts to set such ACLs in the Samba POSIX ACL mapping backend.

However, as the current code wrongly silently swallows the error returned from
the low level mapping function unpack_canon_ace() and a subsequent commit is
going to fix this, the tests mentioned above will start failing.

As these non-canonical ACL are in fact valid ACLs and eg Windows allows setting
them and they only fail when Samba uses POSIX ACL backend, adjust the tests to
run against a share that uses acl_xattr without POSIX ACLs:

- smb2.acls-with-sysacl: Runs tests that are compatible with system POSIX
  ACL mapping, executed against the standard 'tmp' share.
- smb2.acls-ignore-sysacl: Contains tests that require Windows-like ACL
  handling (like non-canonical ACE ordering) which are executed against
  the 'acl_xattr_ign_sysacl_windows' share (where system ACLs are ignored).

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 weeks agosmbd: Make smb_set_file_unix_basic() slightly easier to read
Volker Lendecke [Sun, 22 Mar 2026 16:14:49 +0000 (17:14 +0100)] 
smbd: Make smb_set_file_unix_basic() slightly easier to read

Having set_owner/set_grp on the same side of the "!=" makes it easier
for the eye to parse.

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

4 weeks agolibsmb: Align an integer type
Volker Lendecke [Tue, 10 Mar 2026 10:14:48 +0000 (11:14 +0100)] 
libsmb: Align an integer type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosrv_witness: Use ssaddr_str_buf
Volker Lendecke [Mon, 11 May 2026 08:08:31 +0000 (10:08 +0200)] 
srv_witness: Use ssaddr_str_buf

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Convert smbd_release_ip_state() to samba_sockaddr
Volker Lendecke [Mon, 11 May 2026 08:04:29 +0000 (10:04 +0200)] 
smbd: Convert smbd_release_ip_state() to samba_sockaddr

While there, remove a failure condition that never triggered:
print_sockaddr() never returned NULL

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Avoid a few nasty casts in smbd_add_connection()
Volker Lendecke [Mon, 11 May 2026 07:35:56 +0000 (09:35 +0200)] 
smbd: Avoid a few nasty casts in smbd_add_connection()

Use struct samba_sockaddr instead of casting

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agoposixacl: Make sure all fields in smb_acl_entry are initialized
Volker Lendecke [Mon, 22 Jun 2026 15:19:46 +0000 (17:19 +0200)] 
posixacl: Make sure all fields in smb_acl_entry are initialized

Use a struct initialization

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Remove code disabled at least 19 years ago...
Volker Lendecke [Wed, 24 Jun 2026 10:00:38 +0000 (12:00 +0200)] 
smbd: Remove code disabled at least 19 years ago...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Fix a typo
Volker Lendecke [Thu, 25 Jun 2026 08:08:06 +0000 (10:08 +0200)] 
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Simplify unlink_internals()
Volker Lendecke [Wed, 24 Jun 2026 15:43:49 +0000 (17:43 +0200)] 
smbd: Simplify unlink_internals()

All callers have already done the stat on smb_fname if it
exists by using openat_pathref_fsp() via synthetic_pathref() or
filename_convert_dirfsp() etc.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Pass "new_dirfsp" to unlink_internals
Volker Lendecke [Wed, 24 Jun 2026 15:25:42 +0000 (17:25 +0200)] 
smbd: Pass "new_dirfsp" to unlink_internals

There's no reason why we shouldn't.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Simplify create_file_unixpath()
Volker Lendecke [Wed, 24 Jun 2026 15:42:40 +0000 (17:42 +0200)] 
smbd: Simplify create_file_unixpath()

We don't need to call vfs_stat() before openat_pathref_fsp() to check
whether a file exists. openat_pathref_fsp() is well doing that on its
own.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Simplify call_trans2setfileinfo()
Volker Lendecke [Mon, 22 Jun 2026 08:00:06 +0000 (10:00 +0200)] 
smbd: Simplify call_trans2setfileinfo()

We don't need the logic for "info_level_handled" anymore,
smbd_do_setfilepathinfo() is just the "default" case.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Simplify call_trans2qfilepathinfo()
Volker Lendecke [Sun, 21 Jun 2026 16:36:12 +0000 (18:36 +0200)] 
smbd: Simplify call_trans2qfilepathinfo()

Let the callers handle sending out the results.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Small simplification in smb1 qinfo
Volker Lendecke [Wed, 17 Jun 2026 21:15:33 +0000 (23:15 +0200)] 
smbd: Small simplification in smb1 qinfo

handle_trans2qfilepathinfo_result() only used "fixed_portion" for an
error check. Move that check to the only caller where both arguments
in the comparison are different.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Slightly simplify posix acl handling
Volker Lendecke [Sun, 22 Mar 2026 15:10:34 +0000 (16:10 +0100)] 
smbd: Slightly simplify posix acl handling

Avoid checking for posix_acl!=NULL in every iteration. We don't change
it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Simplify smb_set_file_unix_basic() with PULL_LE_U64
Volker Lendecke [Sun, 22 Mar 2026 15:08:34 +0000 (16:08 +0100)] 
smbd: Simplify smb_set_file_unix_basic() with PULL_LE_U64

This is what we have PULL_LE_U64 for.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Modernize some DEBUGs
Volker Lendecke [Sun, 22 Mar 2026 14:49:52 +0000 (15:49 +0100)] 
smbd: Modernize some DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agosmbd: Move copy_internals() to SMB1-only code
Volker Lendecke [Wed, 11 Mar 2026 16:10:04 +0000 (17:10 +0100)] 
smbd: Move copy_internals() to SMB1-only code

Make it static to its only caller.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 weeks agopdb_ldap: add check for empty name in ldapsam_create_user()
Daniil Sarafannikov [Mon, 22 Jun 2026 18:16:13 +0000 (22:16 +0400)] 
pdb_ldap: add check for empty name in ldapsam_create_user()

Function ldapsam_create_user() should be called only
with non-empty name. Add an explicit check for it
in the beginning. Without it a buffer underflow can happen
in the first condition for setting is_machine.

Pair-Programmed-With: Dina Tagantseva <dinchik@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>
Reviewed-by: Noel Power <npower@samba.org>
4 weeks agoctdb-daemon: Remove incorrect comment
Martin Schwenke [Thu, 25 Jun 2026 07:35:27 +0000 (17:35 +1000)] 
ctdb-daemon: Remove incorrect comment

Commit bcd7444c57447983f571cbbe3ceed7d5558040e9 made this comment
incorrect, so remove it.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Jun 25 23:35:19 UTC 2026 on atb-devel-224

4 weeks agoctdb-daemon: Improve some debug
Martin Schwenke [Mon, 18 May 2026 02:31:26 +0000 (12:31 +1000)] 
ctdb-daemon: Improve some debug

TAKE_IP needs the word "message" to distinguish from "control".
Neither need the location, since the messages are now clear.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoctdb-daemon: Modernise some debugs
Martin Schwenke [Sun, 17 May 2026 09:27:23 +0000 (19:27 +1000)] 
ctdb-daemon: Modernise some debugs

The success message doesn't need a location (so D_INFO() rather than
DBG_INFO()) - the message is unique.

The others are rare errors, so use DBG_ERR() to include the function
name.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoctdb-daemon: Remove some debugs
Martin Schwenke [Sun, 17 May 2026 09:21:37 +0000 (19:21 +1000)] 
ctdb-daemon: Remove some debugs

These are duplicated, at the same debug level, in the depths of
ctdb_event_script_callback() (actually, in ctdb_event_script_run()).

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoctdb-daemon: Clean up debug messages
Martin Schwenke [Sun, 17 May 2026 09:16:11 +0000 (19:16 +1000)] 
ctdb-daemon: Clean up debug messages

These are difficult to read.  The location is unnecessary since each
of these are only done in one place.  Remove "public address" from the
messages because it seems obvious.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoctdb-daemon: Modernise some debugs
Martin Schwenke [Sun, 17 May 2026 09:13:13 +0000 (19:13 +1000)] 
ctdb-daemon: Modernise some debugs

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoctdb-daemon: Clean up a debug message
Martin Schwenke [Sun, 17 May 2026 06:15:44 +0000 (16:15 +1000)] 
ctdb-daemon: Clean up a debug message

This is annoyingly verbose when there are no arguments.  Drop the
location details and the "with arguments" noise. Arguments are now in
square brackets, when present.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agovfs_ceph_rgw: Init librgw only once for every client
Vinit Agnihotri [Tue, 23 Jun 2026 09:47:51 +0000 (15:17 +0530)] 
vfs_ceph_rgw: Init librgw only once for every client

Currently we create new instance of librgw on every connect, even
for the same client. Since librgw lacks reference counting mechanism,
destroying instance in any dis-connect for the client results into
invalid handle for other instances.

This change thus initialises and shutdown librgw only once.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Jun 25 14:17:09 UTC 2026 on atb-devel-224

4 weeks agovfs_ceph_rgw: Read librgw init parameters from [global]
Anoop C S [Wed, 24 Jun 2026 04:26:44 +0000 (09:56 +0530)] 
vfs_ceph_rgw: Read librgw init parameters from [global]

librgw can only be initialized once per process, so the parameters
that feed into librgw_create() - 'id', 'config_file', 'keyring_file'
and 'debug' - must be the same across all shares. Read them from
[global] section instead of per share so the configuration reflects
this constraint.

Other parameters like 'user_id', 'access_key', 'secret_access_key'
and 'bucket' remain per share as before.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 weeks agovfs_ceph_rgw: Fix config memory leak on load failure
Anoop C S [Thu, 25 Jun 2026 06:21:53 +0000 (11:51 +0530)] 
vfs_ceph_rgw: Fix config memory leak on load failure

Free config_tmp when vfs_ceph_rgw_load_config() fails after allocation.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 weeks agos3:libsmb: Parse the username string correctly
Andreas Schneider [Fri, 19 Jun 2026 09:26:05 +0000 (11:26 +0200)] 
s3:libsmb: Parse the username string correctly

It could be a UPN or domain prefixed username.

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

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): Thu Jun 25 12:19:53 UTC 2026 on atb-devel-224

4 weeks agos3:torture: Add libsmbclient set_credentials test
Andreas Schneider [Wed, 24 Jun 2026 12:18:10 +0000 (14:18 +0200)] 
s3:torture: Add libsmbclient set_credentials test

This checks if we can parse UPNs or DOMAIN\user provided usernames.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
5 weeks agowinbindd: Add a per-domain failover log message with reason
Shweta Sodani [Thu, 19 Feb 2026 14:19:28 +0000 (19:49 +0530)] 
winbindd: Add a per-domain failover log message with reason

Adding a new log message that describe for domain controller failover
in winbindd_domain and cause of failover. (DC Connectivity, Kerberos,
LDAP failures)

Snippet of log message:

  print_failover_log:
  ========================================
  DC FAILOVER: SUCCESSFULLY FAILED OVER
  ========================================
  Domain Name: CORP
  Domain Alt Name: CORP.LOCAL
  Status: SUCCESS
  Failover Reason: DC_CONNECTIVITY
  Source DC (before failover): dc2.corp.local
  Destination DC (after failover): dc1.corp.local
  Current DC Name: dc1.corp.local
  Failover Start Time: 1771930355.281380
  Failover End Time: 1771930355.613872
  Elapsed Time (seconds): 0.332494
  ========================================

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Jun 24 19:24:13 UTC 2026 on atb-devel-224

5 weeks agolibcli/smb: Fix buffer overflow in smb311_capabilities_parse()
Daniil Sarafannikov [Fri, 19 Jun 2026 11:15:46 +0000 (15:15 +0400)] 
libcli/smb: Fix buffer overflow in smb311_capabilities_parse()

This fixes a potential overflow in loop caused by incorrect
bound. Instead of using the wrong constant both signing and
encryption loops now use ARRAY_SIZE() on the target array.
As encryption const is larger, out-of-bounds write happened:
c.signing.algos[c.signing.num_algos] = algo.

Pair-Programmed-With: Denis Rastyogin <gerben@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): Tue Jun 23 11:12:08 UTC 2026 on atb-devel-224

5 weeks agoS4/dfs_server: fix potential underflow in get_dcs_insite
Egor Mikhailov [Thu, 18 Jun 2026 05:35:47 +0000 (09:35 +0400)] 
S4/dfs_server: fix potential underflow in get_dcs_insite

get_dcs_insite unconditionally truncates the last character of sAMAccountName
by index len - 1. If sAMAccountName is empty, this leads to an underflow (index -1)
and memory corruption.

This fix ensures sAMAccountName length is validated before truncation.

Pair-Programmed-With: Sergey Zhidkih <rx1513@altlinux.org>
Signed-off-by: Egor Mikhailov <mikhailovev@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): Tue Jun 23 09:15:50 UTC 2026 on atb-devel-224

5 weeks agovfs_ceph_rgw: Add new module parameter 'id'
Vinit Agnihotri [Fri, 19 Jun 2026 08:48:45 +0000 (14:18 +0530)] 
vfs_ceph_rgw: Add new module parameter 'id'

Module parameter 'id' represents 'Client id portion of the Ceph
client name used by librgw'.

Additionally updated new parameter in man page.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jun 22 15:36:07 UTC 2026 on atb-devel-224

5 weeks agos3:utils: Fix buffer underflow in parse_timeout for empty strings
shumikhinaka [Thu, 11 Jun 2026 14:49:58 +0000 (18:49 +0400)] 
s3:utils: Fix buffer underflow in parse_timeout for empty strings

The parse_timeout function is called with a command-line argument. The user
may pass an empty string, which will result in undefined behavior until
the result is checked.

A check for the string length has been added immediately after the strlen()
call. If an empty string is passed, the function returns 0, preventing
incorrect access to the array.

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: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 19 13:03:44 UTC 2026 on atb-devel-224

5 weeks agokdc-heimdal: avoid NULL dereference when task is NULL
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

5 weeks agodocs-xml/manpages: Add man page for vfs_ceph_rgw
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

5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>
5 weeks 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>