]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
8 hours agolibsmb: Avoid smb-level encryption if quic is trusted master
Volker Lendecke [Thu, 21 Aug 2025 10:17:55 +0000 (12:17 +0200)] 
libsmb: Avoid smb-level encryption if quic is trusted

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Aug 22 14:55:47 UTC 2025 on atb-devel-224

9 hours agolibsmb: Add "smb_encryption_over_quic" to smb311_capabilities
Volker Lendecke [Thu, 21 Aug 2025 10:15:25 +0000 (12:15 +0200)] 
libsmb: Add "smb_encryption_over_quic" to smb311_capabilities

Put here from the "client smb encryption over quic" settings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agoparam: Add "client smb encryption over quic"
Volker Lendecke [Thu, 21 Aug 2025 08:42:15 +0000 (10:42 +0200)] 
param: Add "client smb encryption over quic"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Don't request SMB-level encryption over trusted quic
Volker Lendecke [Mon, 18 Aug 2025 15:13:59 +0000 (17:13 +0200)] 
smbd: Don't request SMB-level encryption over trusted quic

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Reply with SMB2_ACCEPT_TRANSPORT_LEVEL_SECURITY if we trust quic
Volker Lendecke [Fri, 8 Aug 2025 10:06:13 +0000 (12:06 +0200)] 
smbd: Reply with SMB2_ACCEPT_TRANSPORT_LEVEL_SECURITY if we trust quic

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Add the "server smb encryption over quic" parameter
Volker Lendecke [Thu, 14 Aug 2025 13:32:12 +0000 (15:32 +0200)] 
smbd: Add the "server smb encryption over quic" parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Pass smbXsrv_connection to lp_server_smb_encrypt()
Volker Lendecke [Mon, 18 Aug 2025 15:06:05 +0000 (17:06 +0200)] 
smbd: Pass smbXsrv_connection to lp_server_smb_encrypt()

We'll modify the value of "server smb encrypt" when we have a trusted
quic transport

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agoparam: Fix whitespace
Volker Lendecke [Mon, 18 Aug 2025 14:25:38 +0000 (16:25 +0200)] 
param: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Switch from a != to a ==
Volker Lendecke [Tue, 12 Aug 2025 13:06:39 +0000 (15:06 +0200)] 
smbd: Switch from a != to a ==

Simpler to read for me

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Avoid an "else"
Volker Lendecke [Wed, 13 Aug 2025 13:27:39 +0000 (15:27 +0200)] 
smbd: Avoid an "else"

We return in the if-branch

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Modernize DEBUGs
Volker Lendecke [Wed, 13 Aug 2025 13:06:54 +0000 (15:06 +0200)] 
smbd: Modernize DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Add a comment matching the other flags
Volker Lendecke [Wed, 13 Aug 2025 11:55:42 +0000 (13:55 +0200)] 
smbd: Add a comment matching the other flags

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Make a few encryption-related functions static to smbstatus
Volker Lendecke [Mon, 11 Aug 2025 15:02:52 +0000 (17:02 +0200)] 
smbd: Make a few encryption-related functions static to smbstatus

Only referenced there, I got confused by them being part of smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Fix a typo
Volker Lendecke [Mon, 11 Aug 2025 13:16:54 +0000 (15:16 +0200)] 
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agosmbd: Shed a nested if-expression
Volker Lendecke [Mon, 11 Aug 2025 13:12:31 +0000 (15:12 +0200)] 
smbd: Shed a nested if-expression

Review with "git show -w". This is easier to read for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agodocs: Fix "server smb encrypt" for SMB3+
Volker Lendecke [Mon, 11 Aug 2025 12:40:16 +0000 (14:40 +0200)] 
docs: Fix "server smb encrypt" for SMB3+

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agolibsmb: Negotiate SMB2_ACCEPT_TRANSPORT_LEVEL_SECURITY over quic
Volker Lendecke [Thu, 7 Aug 2025 10:35:23 +0000 (12:35 +0200)] 
libsmb: Negotiate SMB2_ACCEPT_TRANSPORT_LEVEL_SECURITY over quic

If we trust quic, indicate to the server that we do so.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agolib: tstream_tls_verify_peer_trusted()
Volker Lendecke [Thu, 7 Aug 2025 06:56:08 +0000 (08:56 +0200)] 
lib: tstream_tls_verify_peer_trusted()

We can only trust a tls connection if at connection setup we checked
the certificates

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agolibcli: Add tls_verify_peer_state to smbXcli_transport
Volker Lendecke [Mon, 4 Aug 2025 12:59:15 +0000 (14:59 +0200)] 
libcli: Add tls_verify_peer_state to smbXcli_transport

We have to carry a copy over from the tstream_tls_params used to
connect, we can't get this information out once the tls-protected
tstream is established

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agotls: Add tstream_tls_params_verify_peer()
Volker Lendecke [Mon, 4 Aug 2025 11:53:49 +0000 (13:53 +0200)] 
tls: Add tstream_tls_params_verify_peer()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 hours agolibcli: Introduce helper var in smbXcli_negprot_smb2_subreq()
Volker Lendecke [Thu, 7 Aug 2025 09:53:59 +0000 (11:53 +0200)] 
libcli: Introduce helper var in smbXcli_negprot_smb2_subreq()

Saves a few bytes of code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 days agothird_party:quic_ko_wrapper Fix compilation with clang-20 gitlab/master
Gary Lockyer [Thu, 14 Aug 2025 21:38:07 +0000 (09:38 +1200)] 
third_party:quic_ko_wrapper Fix compilation with clang-20

Rework the code to remove the non portable variable length array in the union.
Based on the code in wrap_msghdr_add_cmsghdr().

NOTE: this removes the 64 bit alignment, which I think should be ok.

./../third_party/quic_ko_wrapper/quic_ko_wrapper.c:3523:11: error:
   fields must have a constant size: 'variable length array in structure'
   extension will never be supported
  3523 |                 uint8_t cmbuf[cmspace];
       |                         ^
1 error generated.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Wed Aug 20 15:04:34 UTC 2025 on atb-devel-224

2 days agothird_party:quic Fix compilation with clang-20
Gary Lockyer [Thu, 14 Aug 2025 21:33:24 +0000 (09:33 +1200)] 
third_party:quic Fix compilation with clang-20

Add -Wno-error=format-nonliteral so that quic builds with clang 20

../../third_party/quic/libquic/handshake.c:106:35: error:
   format string is not a string literal [-Werror,-Wformat-nonliteral]
  106 |         rc = vsnprintf(msg, sizeof(msg), fmt, arg);
      |                                          ^~~
../../third_party/quic/libquic/handshake.c:135:35: error:
   format string is not a string literal [-Werror,-Wformat-nonliteral]
  135 |         rc = vsnprintf(msg, sizeof(msg), fmt, arg);
      |                                          ^~~
../../third_party/quic/libquic/handshake.c:164:35: error:
   format string is not a string literal [-Werror,-Wformat-nonliteral]
  164 |         rc = vsnprintf(msg, sizeof(msg), fmt, arg);
      |                                          ^~~

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 days agothird_party: fix libquic build on older systems
Björn Baumbach [Fri, 8 Aug 2025 15:31:34 +0000 (17:31 +0200)] 
third_party: fix libquic build on older systems

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 days agopytest:samba-tool group: remove unused imports
Douglas Bagnall [Fri, 1 Aug 2025 04:25:13 +0000 (16:25 +1200)] 
pytest:samba-tool group: remove unused imports

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Aug 20 05:35:03 UTC 2025 on atb-devel-224

2 days agopytest: run user_keytrust tests as computer keytrust tests
Douglas Bagnall [Sun, 17 Aug 2025 09:59:07 +0000 (09:59 +0000)] 
pytest: run user_keytrust tests as computer keytrust tests

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopytest: adapt user_keytrust tests to be objectclass agnostic
Douglas Bagnall [Sun, 17 Aug 2025 09:58:39 +0000 (09:58 +0000)] 
pytest: adapt user_keytrust tests to be objectclass agnostic

We will reuse the tests for the computer keytrust command.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agosamba-tool: copy user_keytrust to computer keytrust
Douglas Bagnall [Sun, 17 Aug 2025 09:57:55 +0000 (09:57 +0000)] 
samba-tool: copy user_keytrust to computer keytrust

This is exactly a copy of user/keytrust.py to computer_keytrust.py
with a title-case-preserving `s/user/computer/`.

It works. The Computer model differs from the User model in that it
appends a '$' to the end of account names if it senses the lack,
otherwise these commands are using the same code paths.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agosamba-tool computer: remove unused imports
Douglas Bagnall [Sun, 17 Aug 2025 08:39:38 +0000 (20:39 +1200)] 
samba-tool computer: remove unused imports

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agosamba-tool: add user keytrust command
Douglas Bagnall [Wed, 6 Aug 2025 02:01:14 +0000 (14:01 +1200)] 
samba-tool: add user keytrust command

This allows manipulation of key credential links for users.

See `man -l bin/default/docs-xml/manpages/samba-tool.8` for
documentation.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agosamba-tool: Command.message() can print multiple lines
Douglas Bagnall [Wed, 13 Aug 2025 04:21:14 +0000 (16:21 +1200)] 
samba-tool: Command.message() can print multiple lines

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopy:key_credential_link: filter_kcl_list helper for samba-tool
Douglas Bagnall [Sun, 17 Aug 2025 08:34:57 +0000 (08:34 +0000)] 
py:key_credential_link: filter_kcl_list helper for samba-tool

This will be used in `samba-tool user keytrust delete` and `samba-tool
computer keytrust delete` and is mainly to deduplicate that code.

Potentially it could also be used in `keytrust view`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopy:key_credential_list: add kcl_in_list function
Douglas Bagnall [Fri, 15 Aug 2025 05:36:11 +0000 (17:36 +1200)] 
py:key_credential_list: add kcl_in_list function

This compares the key material and DN of a KeyCredentialLinkDn with a
list of others, which is a different sense of equality than the
default (which considers GUIDs and binary equality).

This will be used by samba-tool to check whether a link is in fact a
duplicate even if it seems not to be due to some insignificant field
being non-identical.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopy:key_credential_links: allow encoding=='auto'
Douglas Bagnall [Fri, 15 Aug 2025 05:35:33 +0000 (17:35 +1200)] 
py:key_credential_links: allow encoding=='auto'

'auto' is the same as None. This is helpful to samba-tool.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agosamba-tool: add verbose flag to @exception_to_command_error
Douglas Bagnall [Wed, 13 Aug 2025 22:33:00 +0000 (10:33 +1200)] 
samba-tool: add verbose flag to @exception_to_command_error

Helpful in development.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopy:tests: test key_credential_link module
Douglas Bagnall [Fri, 8 Aug 2025 03:04:51 +0000 (15:04 +1200)] 
py:tests: test key_credential_link module

These tests use the samba.key_credential_link module and a real samdb.

The existing key_credential_link tests address the IDL generated
structures more directly.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopython:key_credential_link: add descriptive methods
Douglas Bagnall [Wed, 11 Jun 2025 04:16:54 +0000 (16:16 +1200)] 
python:key_credential_link: add descriptive methods

In samba-tool we are going to want a KeyCredentialLinkDn to be able
to describe itself. We're adding the methods here because
`samba-tool user` and `samba-tool computer` will both want to use
them.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agopython:models: do not re-use mutable defaults
Douglas Bagnall [Wed, 13 Aug 2025 05:19:16 +0000 (17:19 +1200)] 
python:models: do not re-use mutable defaults

This ensures that model.save works when a field has the many flag set,
but the object has no attribute of that name, and the caller appends
to the attribute list, like this:

      user.key_credential_link.append(link)

When we get to save, and are doing this:

      value = getattr(self, attr)
      old_value = getattr(existing_obj, attr)
      if value != old_value:
         # commit the change

the .append() will have added the item to both value and old_value
because they are the same list. But not any more.

This was a problem because the Field instance is attached to the
model class, not the model instance.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agosamba-tool: add decorator to catch exception types
Douglas Bagnall [Sat, 9 Aug 2025 04:27:42 +0000 (16:27 +1200)] 
samba-tool: add decorator to catch exception types

Often we [think we] know that all exceptions of a certain type should
be formatted as CommandErrors (i.e., the traceback is suppressed, and
the message is assumed intelligible). Rather than riddling .run() with
try...except blocks to do this, we can

@exception_to_command_error(ModelError)
def run(...)

which makes any ModelError into a CommandError in that samba-tool command.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agoman samba-tool: computer keytrust
Douglas Bagnall [Mon, 18 Aug 2025 09:02:57 +0000 (21:02 +1200)] 
man samba-tool: computer keytrust

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agoman samba-tool: user keytrust
Douglas Bagnall [Wed, 11 Jun 2025 02:20:51 +0000 (14:20 +1200)] 
man samba-tool: user keytrust

This documentation anticipates changes that will occur over the next
~20 commits.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2 days agoman samba-tool: don't suggest non-existent option in synopsis.
Douglas Bagnall [Mon, 18 Aug 2025 08:56:04 +0000 (20:56 +1200)] 
man samba-tool: don't suggest non-existent option in synopsis.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
3 days agotdbtorture: Fix CID 1034816: proper calloc usage
Shachar Sharon [Tue, 19 Aug 2025 09:18:28 +0000 (12:18 +0300)] 
tdbtorture: Fix CID 1034816: proper calloc usage

Standard signature is 'calloc(n_elems, elem_size)', where element size
(in particular, when using 'sizeof') comes as 2nd arg. The actual
allocation size does not care for ordering but swapping the order
confuses static-analysis tools like Coverity, as well as naive readers.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Aug 19 18:08:02 UTC 2025 on atb-devel-224

3 days agonsswitch/libwbclient: Fix CID #1034862 Resource leak
Günther Deschner [Mon, 18 Aug 2025 15:14:00 +0000 (17:14 +0200)] 
nsswitch/libwbclient: Fix CID #1034862 Resource leak

Guenther

Signed-off-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): Tue Aug 19 09:45:46 UTC 2025 on atb-devel-224

3 days agonsswitch/libwbclient: Fix CID #1034853 Resource leak
Günther Deschner [Sat, 16 Aug 2025 14:45:15 +0000 (16:45 +0200)] 
nsswitch/libwbclient: Fix CID #1034853 Resource leak

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
3 days agoexamples/libsmbclient: Fix CID #1273089 Resource leak
Günther Deschner [Wed, 13 Aug 2025 17:04:39 +0000 (19:04 +0200)] 
examples/libsmbclient: Fix CID #1273089 Resource leak

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
4 days agosmbd: Fix CID 1664060: Incorrect expression (IDENTICAL_BRANCHES)
Volker Lendecke [Mon, 18 Aug 2025 08:46:21 +0000 (10:46 +0200)] 
smbd: Fix CID 1664060: Incorrect expression (IDENTICAL_BRANCHES)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug 18 13:04:27 UTC 2025 on atb-devel-224

4 days agotldap: Fix CID 1664062: Error handling issues (CHECKED_RETURN)
Volker Lendecke [Mon, 18 Aug 2025 08:44:46 +0000 (10:44 +0200)] 
tldap: Fix CID 1664062: Error handling issues (CHECKED_RETURN)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
4 days agopdb_ldap: Fix memory leak CID#1363095
Vinit Agnihotri [Mon, 18 Aug 2025 07:32:04 +0000 (13:02 +0530)] 
pdb_ldap: Fix memory leak CID#1363095

Signed-off-by: Vinit Agnihotri <vagnihot@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): Mon Aug 18 12:03:30 UTC 2025 on atb-devel-224

7 days agosmbd: improve lease break when handling overwrite create disposition
Ralph Boehme [Fri, 8 Aug 2025 11:52:59 +0000 (13:52 +0200)] 
smbd: improve lease break when handling overwrite create disposition

If the contending create uses overwrite create disposition, but has caused a
sharing violation and the existing create has a SMB2_LEASE_HANDLE, then the
server should just send break the SMB2_LEASE_HANDLE.

The break will then either result in a close and the contending open succeeds,
or a STATUS_SHARING_VIOLATION. Either way, there's no need to additionally break
SMB2_LEASE_READ or SMB2_LEASE_WRITE.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Aug 15 16:51:05 UTC 2025 on atb-devel-224

7 days agosmbtorture: add test "smb2.lease.sharing_violation"
Ralph Boehme [Sat, 9 Aug 2025 10:31:17 +0000 (12:31 +0200)] 
smbtorture: add test "smb2.lease.sharing_violation"

Verifies an existing RWH lease on a file is only broken to RW when a contending
create fails with STATUS_SHARING_VIOLATION.

Passes against Windows, fails against Samba.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agosmbd: when going to truncate the file, explicitly set the filesize to 0
Ralph Boehme [Thu, 7 Aug 2025 17:15:43 +0000 (19:15 +0200)] 
smbd: when going to truncate the file, explicitly set the filesize to 0

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agosmbtorture: add test smb2.lease.lock3
Ralph Boehme [Sat, 9 Aug 2025 09:53:23 +0000 (11:53 +0200)] 
smbtorture: add test smb2.lease.lock3

Verifies a create with overwrite disposition on a file with a byterange lock can
get an RH lease.

Passes against Windows, fails against Samba.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agos3/locking: fix checking for byterange locks when granting RH lease
Ralph Boehme [Thu, 7 Aug 2025 16:44:27 +0000 (18:44 +0200)] 
s3/locking: fix checking for byterange locks when granting RH lease

From MS-FSA 2.1.5.18 "Server Requests an Oplock":

...

* Else If Type is LEVEL_GRANULAR:
    * If RequestedOplockLevel is READ_CACHING or (READ_CACHING|HANDLE_CACHING):
        * The operation MUST be failed with STATUS_OPLOCK_NOT_GRANTED under either of the
          following conditions:
            * Open.Stream.ByteRangeLockList is not empty and Open.Stream.AllocationSize
              is greater than any ByteRangeLock.LockOffset in
              Open.Stream.ByteRangeLockList.

...

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agos3/locking: modernize file_has_brlocks()
Ralph Boehme [Sat, 9 Aug 2025 09:41:45 +0000 (11:41 +0200)] 
s3/locking: modernize file_has_brlocks()

No change in behaviour. Minimizes diff in the next commit that introduce a
behaviour change.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agosmbd: make file_has_brlocks() public
Ralph Boehme [Sat, 9 Aug 2025 09:39:55 +0000 (11:39 +0200)] 
smbd: make file_has_brlocks() public

Prepares for a change to file_has_brlocks() in the next commit. No change in
behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agosmbd: avoid granting "H"-only lease
Ralph Boehme [Mon, 2 Jun 2025 10:07:26 +0000 (12:07 +0200)] 
smbd: avoid granting "H"-only lease

If an "RH" lease was requested and due to existing brl-lock we do not grant
an "R" lease, we end up granting an "H"-only lease which is not a valid lease
state.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agosmbtorture: add test smb2.lease.lock2
Ralph Boehme [Sat, 9 Aug 2025 07:09:47 +0000 (09:09 +0200)] 
smbtorture: add test smb2.lease.lock2

Verifies byterange locks only affect lease state if the lock is actually
"backed" by the file. Eg, if a file has size 0, byterange locks will never
affect lease state.

Passes against Windows, fails against Samba.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agosmbd: return correct reparse tag DFS when listing directories
Ralph Boehme [Fri, 15 Aug 2025 08:13:33 +0000 (10:13 +0200)] 
smbd: return correct reparse tag DFS when listing directories

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Aug 15 15:37:05 UTC 2025 on atb-devel-224

7 days agoCI: add Python test samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag
Ralph Boehme [Thu, 14 Aug 2025 15:18:08 +0000 (17:18 +0200)] 
CI: add Python test samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agopython/tests: also populate self.server in calls LibsmbTests setup()
Ralph Boehme [Fri, 15 Aug 2025 09:49:27 +0000 (11:49 +0200)] 
python/tests: also populate self.server in calls LibsmbTests setup()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agopylibsmb: add SMB2_FIND_ID_BOTH_DIRECTORY_INFO
Ralph Boehme [Fri, 15 Aug 2025 08:14:53 +0000 (10:14 +0200)] 
pylibsmb: add SMB2_FIND_ID_BOTH_DIRECTORY_INFO

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agovfs_xattr_tdb: fix dangling symlink detection
Ralph Boehme [Fri, 15 Aug 2025 09:50:26 +0000 (11:50 +0200)] 
vfs_xattr_tdb: fix dangling symlink detection

The caller might not have called stat on smb_fname.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agos3/rpc_server/dfs: fix creating a DFS link
Ralph Boehme [Thu, 14 Aug 2025 17:20:02 +0000 (19:20 +0200)] 
s3/rpc_server/dfs: fix creating a DFS link

If there's no existing link, get_referred_path() returns NT_STATUS_OBJECT_PATH_NOT_FOUND.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 days agolib: Make file_ploadv() static
Volker Lendecke [Fri, 15 Aug 2025 08:09:18 +0000 (10:09 +0200)] 
lib: Make file_ploadv() static

All callers want to see lines.

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): Fri Aug 15 11:53:56 UTC 2025 on atb-devel-224

7 days agoctdb: Use file_lines_ploadv()
Volker Lendecke [Fri, 15 Aug 2025 08:07:41 +0000 (10:07 +0200)] 
ctdb: Use file_lines_ploadv()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 days agolib: Move file_lines_ploadv() to lib/util/
Volker Lendecke [Fri, 15 Aug 2025 08:04:55 +0000 (10:04 +0200)] 
lib: Move file_lines_ploadv() to lib/util/

Make it available to ctdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 days agolib: Fix memory leak CID#1469247
Vinit Agnihotri [Tue, 12 Aug 2025 06:02:00 +0000 (11:32 +0530)] 
lib: Fix memory leak CID#1469247

pointer 'p' gets duplicated in file_lines_parse(), but not free'd
before returning.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
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 Aug 15 08:53:53 UTC 2025 on atb-devel-224

7 days agolib:util: Fix resourse leak CID#1412633
Vinit Agnihotri [Thu, 14 Aug 2025 10:34:17 +0000 (16:04 +0530)] 
lib:util: Fix resourse leak CID#1412633

Stop using un-needed variable 'handle', this variable is not used
anywhere later.
Also load_module() internally allocates and uses handle, which suffice
for its operation.

This fixes resource leak issue reported by coverity #1412633

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
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 Aug 15 06:19:51 UTC 2025 on atb-devel-224

8 days agos3-vfs_fruit: add 'fruit:veto_localized' option
Günther Deschner [Mon, 24 Oct 2022 13:42:54 +0000 (15:42 +0200)] 
s3-vfs_fruit: add 'fruit:veto_localized' option

This new boolean option allows to automatically treat ".localized" as
vetoed files. Any attempts to access a ".localized" file or directory
will result in an access failure. MacOS tries to check for the presence
of such a file to check for the need of localized name display in
directory listings or checks for .localized directories containing name
translations).  In large directory listings, typically half of the
compound SMB2 queries are done for ".localized", causing a significant
performance impact in particular with clustered filesystems.

More information can be found here:
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemAdvancedPT/LocalizingtheNameofaDirectory/LocalizingtheNameofaDirectory.html

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Aug 14 11:08:11 UTC 2025 on atb-devel-224

8 days agolib: docs: talloc: fix a wrong cd command
Michael Adam [Wed, 13 Aug 2025 11:05:23 +0000 (13:05 +0200)] 
lib: docs: talloc: fix a wrong cd command

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Aug 14 06:27:38 UTC 2025 on atb-devel-224

8 days agolib:tdb: Remove obsolete web page
Andreas Schneider [Wed, 13 Aug 2025 14:38:10 +0000 (16:38 +0200)] 
lib:tdb: Remove obsolete web page

The current one is the doxygen generated one.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 days agolib:talloc: Remove obsolete web page
Andreas Schneider [Wed, 13 Aug 2025 14:37:04 +0000 (16:37 +0200)] 
lib:talloc: Remove obsolete web page

The current one is the doxygen generated one.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 days agocoverity: Fix running coverity in our pipeline
Andreas Schneider [Thu, 7 Aug 2025 14:14:43 +0000 (16:14 +0200)] 
coverity: Fix running coverity in our pipeline

It fails to run if it doesn't find this file. You need it if you run
Coverity locally.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
9 days agolibads: change netlogon_pings() behaviour wrt to min_servers parameter
Ralph Boehme [Thu, 24 Jul 2025 10:59:30 +0000 (12:59 +0200)] 
libads: change netlogon_pings() behaviour wrt to min_servers parameter

Currently if a caller passes min_servers=X with X>1, netlogon_pings() will fail
if it can't contact X DCs. This is not really what we want. What we want is: we
want at least one DC, and up to X.

Change implemenentation in that sense and rename the min_servers argument to
wanted_servers to express this behaviour change.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Aug 13 19:31:10 UTC 2025 on atb-devel-224

9 days agolibads: reverse termination condition in netlogon_pings_done()
Ralph Boehme [Thu, 24 Jul 2025 10:55:30 +0000 (12:55 +0200)] 
libads: reverse termination condition in netlogon_pings_done()

No change in behaviour, prepares for upcoming change and minimizes its diff.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 days agoidmap_ad: add and use ldap_timeout and fix LDAP server failover
Ralph Boehme [Thu, 24 Jul 2025 13:49:19 +0000 (15:49 +0200)] 
idmap_ad: add and use ldap_timeout and fix LDAP server failover

The key parts are:

1. If an LDAP search fails with the hardcoded fatal error, remove the
retry. That would only retry the query against the same server, taken
from the DCINFO cache key. Instead, force a DC rediscovery.

2. Set a default ldap_timeout and pass it to tldap_search(). This
avoids tldap_search() hanging forever on a stale TCP connection.

3. The LDAP server idmap_ad is using is not necessarily the same DC
we're using for RPC, so in case we learn about a dead DC, put it in
the negative-conn-cache.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 days agotldap: use tevent_req_set_endtime() to terminate LDAP searches
Ralph Boehme [Mon, 21 Jul 2025 04:44:22 +0000 (06:44 +0200)] 
tldap: use tevent_req_set_endtime() to terminate LDAP searches

Needed to detect unresponsive LDAP servers, otherwise we might be sitting up to
924.6 seconds after sending a request before the kernel notifies us of a broken
connection.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 days agowinbindd: use find_domain_from_name_noinit() in find_dns_domain_name()
Ralph Boehme [Tue, 22 Jul 2025 17:16:14 +0000 (19:16 +0200)] 
winbindd: use find_domain_from_name_noinit() in find_dns_domain_name()

Avoid triggering a connection to a DC of a trusted domain.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 days agolibads: fix get_kdc_ip_string()
Ralph Boehme [Tue, 22 Jul 2025 17:22:31 +0000 (19:22 +0200)] 
libads: fix get_kdc_ip_string()

Correctly handle the interaction between optionally passed in DC via
pss and DC lookup.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 days agos4:torture/smb2: Fix torture test case smb2.acls.ACCESS_BASED
Vinit Agnihotri [Wed, 30 Jul 2025 04:46:05 +0000 (10:16 +0530)] 
s4:torture/smb2: Fix torture test case smb2.acls.ACCESS_BASED

Currently this test case fails to run against windows target, as
it is hardcoded to use sharename as "hideunread".

This change enables this test case to be executed against windows,
by omitting use of hideunread share and relevant flags.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Aug 13 18:29:53 UTC 2025 on atb-devel-224

9 days agos4:torture/smb2: Mark smb2.acl.SDFLAGSVSCHOWN as not supported for windows
Vinit Agnihotri [Fri, 11 Jul 2025 12:39:58 +0000 (18:09 +0530)] 
s4:torture/smb2: Mark smb2.acl.SDFLAGSVSCHOWN as not supported for windows

Test case is expecting return code of NT_STATUS_OK for changing owner to
'everyone', however 'Windows 2016 server' is returning error code as
NT_STATUS_INVALID_OWNER and test case fails.

Same error code is returned if tested against targets w2k16, win2k12R2, win10, win11,
win7, win8 and winxp as well.

Thus marking this case as not supported for all windows versions till, issue is resolved.

Singed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 days agos4:torture/smb2: Restore original sd for every test case finish
Vinit Agnihotri [Mon, 14 Jul 2025 08:10:02 +0000 (13:40 +0530)] 
s4:torture/smb2: Restore original sd for every test case finish

Some tests are not restoring original sd, at end of test.
This causes create test file to stay with incorrect access, resulting
into failure of smb2_deltree() to clear them up, which in-turn causes
other test cases to fail with 'object name collision' for mkdir test
directory.

Fix:
- Call setinfo on testfile with original sd.
- Fix some typos

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 days agos4:torture: Add new target 'w2k16'
Vinit Agnihotri [Fri, 11 Jul 2025 12:39:08 +0000 (18:09 +0530)] 
s4:torture: Add new target 'w2k16'

This fix adds new target 'w2k16' which sets default value for option
'hide_on_access_denied' to true.

'windows 2016 server' returns NT_STATUS_OBJECT_NAME_NOT_FOUND on a createfile when
access is denied rather than NT_STATUS_ACCESS_DENIED. Above option
takes care of this behaviour.

Move TARGET_IS_WINDOWS to utils.h and add all presently defined windows
targets for the same.

Singed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
9 days agothird_party:ngtcp2 Fix compilation with clang-20
Gary Lockyer [Tue, 12 Aug 2025 23:52:36 +0000 (11:52 +1200)] 
third_party:ngtcp2 Fix compilation with clang-20

Add -Wno-error=implicit-fallthrough and -Wno-error=format-nonliteral so that
ngtcp2 builds with clang 20

[1972/4994] Compiling third_party/ngtcp2/lib/ngtcp2_objalloc.c
../../third_party/ngtcp2/lib/ngtcp2_rtb.c:1120:7: error:
   unannotated fall-through between switch labels
   [-Werror,-Wimplicit-fallthrough]
   1120 |       case NGTCP2_ECN_STATE_UNKNOWN:
        |       ^
../../third_party/ngtcp2/lib/ngtcp2_rtb.c:1120:7: note:
   insert '__attribute__((fallthrough));' to silence this warning
   1120 |       case NGTCP2_ECN_STATE_UNKNOWN:
        |       ^
        |       __attribute__((fallthrough));
../../third_party/ngtcp2/lib/ngtcp2_rtb.c:1120:7: note:
   insert 'break;' to avoid fall-through
   1120 |       case NGTCP2_ECN_STATE_UNKNOWN:
        |       ^
        |       break;
1 error generated.

../../third_party/ngtcp2/lib/ngtcp2_log.c:818:35: error:
   format string is not a string literal [-Werror,-Wformat-nonliteral]
   818 |   n = vsnprintf(buf, sizeof(buf), fmt, ap);
       |                                   ^~~
1 error generated.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Aug 13 03:58:43 UTC 2025 on atb-devel-224

9 days agopython:key_credential_link: old python compatibility
Douglas Bagnall [Tue, 12 Aug 2025 22:58:36 +0000 (10:58 +1200)] 
python:key_credential_link: old python compatibility

int.to_bytes assumed these defaults in recent versions

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
9 days agopython:models: add key credential link DN to domain fields
Douglas Bagnall [Wed, 6 Aug 2025 02:00:55 +0000 (14:00 +1200)] 
python:models: add key credential link DN to domain fields

This will soon be needed by samba-tool, and is also going to be used
in some tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
9 days agos3-utils: Fix CID #1517309 Resource leak in net offlinejoin code.
Günther Deschner [Tue, 12 Aug 2025 12:37:06 +0000 (14:37 +0200)] 
s3-utils: Fix CID #1517309 Resource leak in net offlinejoin code.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Aug 13 01:51:11 UTC 2025 on atb-devel-224

9 days agolibcli/smb: Fix CID #710784 Resource leak
Günther Deschner [Mon, 11 Aug 2025 14:58:51 +0000 (16:58 +0200)] 
libcli/smb: Fix CID #710784 Resource leak

buf was (re-)allocated on NULL context thus not part of frame that is
freed.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 days agolib/util: Fix CID 1414760 - Memory leak
Shweta Sodani [Mon, 4 Aug 2025 11:39:23 +0000 (17:09 +0530)] 
lib/util: Fix CID 1414760 - Memory leak

local variable 't' is reusing in child process, resulting the leaking
the tfork object as a side effect.

This fixes coverity issue#1414760

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Aug 12 09:32:19 UTC 2025 on atb-devel-224

10 days agonsswitch: support all known DS lookup flags in wbclient's wbcLookupDomainController()
Günther Deschner [Mon, 14 Jul 2025 18:18:08 +0000 (20:18 +0200)] 
nsswitch: support all known DS lookup flags in wbclient's wbcLookupDomainController()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Aug 12 08:26:55 UTC 2025 on atb-devel-224

10 days agovfs_default: Use already available SMBPROFILE_*_X macros
Anoop C S [Wed, 2 Jul 2025 09:36:17 +0000 (15:06 +0530)] 
vfs_default: Use already available SMBPROFILE_*_X macros

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 days agovfs_ceph_new: Use already available SMBPROFILE_*_X macros
Anoop C S [Wed, 2 Jul 2025 09:34:27 +0000 (15:04 +0530)] 
vfs_ceph_new: Use already available SMBPROFILE_*_X macros

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 days agos3/smbd: Use SMBPROFILE_IOBYTES_ASYNC_STATE_X macro
Anoop C S [Wed, 2 Jul 2025 09:42:20 +0000 (15:12 +0530)] 
s3/smbd: Use SMBPROFILE_IOBYTES_ASYNC_STATE_X macro

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
10 days agos3/include: Define SMBPROFILE_*_ASYNC_STATE_X macros
Anoop C S [Wed, 2 Jul 2025 09:38:58 +0000 (15:08 +0530)] 
s3/include: Define SMBPROFILE_*_ASYNC_STATE_X macros

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
11 days agocompression/tests: Fix possible out of bound access CID:1517301
Vinit Agnihotri [Fri, 8 Aug 2025 12:23:14 +0000 (17:53 +0530)] 
compression/tests: Fix possible out of bound access CID:1517301

This would fix additional coverity issue:1517285

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Aug 11 22:59:26 UTC 2025 on atb-devel-224

13 days agoutils: Fix memory leak CID:1499405
Vinit Agnihotri [Fri, 8 Aug 2025 13:17:57 +0000 (18:47 +0530)] 
utils: Fix memory leak CID:1499405

free memory allocated to status on error condition.

Signed-off-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Aug  9 07:37:05 UTC 2025 on atb-devel-224

2 weeks agovfs: Convert pread, pwrite and fsync recv interfaces to macros
Anoop C S [Fri, 11 Jul 2025 15:10:12 +0000 (20:40 +0530)] 
vfs: Convert pread, pwrite and fsync recv interfaces to macros

Following the common convention of using uppercase letters for macros,
convert SMB_VFS_PREAD_RECV, SMB_VFS_PWRITE_RECV and SMB_VFS_FSYNC_RECV
functions to equivalent macros.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Aug  8 13:04:52 UTC 2025 on atb-devel-224

2 weeks agosmbclient: fix handling errors from do_put in mput
Ralph Boehme [Wed, 30 Jul 2025 07:53:40 +0000 (09:53 +0200)] 
smbclient: fix handling errors from do_put in mput

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Aug  8 11:59:33 UTC 2025 on atb-devel-224

2 weeks agopython:ndr: improve type annotation and docs for pack/unpack
Douglas Bagnall [Wed, 9 Jul 2025 00:50:31 +0000 (12:50 +1200)] 
python:ndr: improve type annotation and docs for pack/unpack

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Aug  8 00:29:00 UTC 2025 on atb-devel-224