]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
8 days agodocs-xml: Update documentation for --use-kerberos and --use-krb5-ccache
Andreas Schneider [Tue, 5 Aug 2025 07:15:43 +0000 (09:15 +0200)] 
docs-xml: Update documentation for --use-kerberos and --use-krb5-ccache

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Aug  5 11:49:35 UTC 2025 on atb-devel-224

8 days agolib:cmdline: Check if we have a valid default ccache
Andreas Schneider [Fri, 25 Apr 2025 15:32:16 +0000 (17:32 +0200)] 
lib:cmdline: Check if we have a valid default ccache

If you don't specify anything, and we have a valid ccache then try to
use it!

> smbclient -L //samba1.earth.milkyway.site
Anonymous login successful

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        IPC$            IPC       IPC Service (Samba 4.22.1)
SMB1 disabled -- no workgroup available

In case the user specifies a principal, it will ask for a password:

> bin/smbclient -L //samba1.earth.milkyway.site -Ualice1@EARTH.MILKYWAY.SITE
Password for [alice1@EARTH.MILKYWAY.SITE]:

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 days agolibrpc:gse: Implement storing tickets into an emtpy ccache
Andreas Schneider [Fri, 4 Apr 2025 11:37:21 +0000 (13:37 +0200)] 
librpc:gse: Implement storing tickets into an emtpy ccache

smbclient //server/share --krb5-use-ccache=/tmp/foo

Will write the ticket to the specified ccache.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 days agoauth:creds: Add cli_credentials_get_out_ccache_name()
Andreas Schneider [Fri, 4 Apr 2025 11:33:19 +0000 (13:33 +0200)] 
auth:creds: Add cli_credentials_get_out_ccache_name()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 days agoauth:creds: Always store the ccache name
Andreas Schneider [Fri, 4 Apr 2025 11:32:41 +0000 (13:32 +0200)] 
auth:creds: Always store the ccache name

This will allow us to specify the cache as one to fill with credentials.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 days agoauth:creds: Make sure when parsing username that realm is uppercase
Andreas Schneider [Fri, 25 Apr 2025 09:30:14 +0000 (11:30 +0200)] 
auth:creds: Make sure when parsing username that realm is uppercase

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 days agosource3/printing: Fix CID 1273086 - Resource Leak
Shwetha K Acharya [Thu, 31 Jul 2025 12:59:05 +0000 (18:29 +0530)] 
source3/printing: Fix CID 1273086 - Resource Leak

Ensure print_queue_struct *q is initialized to NULL to avoid
undefined behavior when freeing on error paths. Move SAFE_FREE(q)
outside the ret > 0 block to ensure q is always freed.

Signed-off-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Aug  5 09:20:17 UTC 2025 on atb-devel-224

8 days agocoverity: Add some additional check for strequal()
Andreas Schneider [Tue, 29 Jul 2025 12:44:50 +0000 (14:44 +0200)] 
coverity: Add some additional check for strequal()

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>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Aug  5 07:09:04 UTC 2025 on atb-devel-224

8 days agocoverity: Update README.md
Andreas Schneider [Fri, 3 Feb 2023 10:30:34 +0000 (11:30 +0100)] 
coverity: Update README.md

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>
8 days agocoverity: Rename README to README.md
Andreas Schneider [Fri, 3 Feb 2023 10:22:40 +0000 (11:22 +0100)] 
coverity: Rename README to README.md

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>
8 days agocoverity: Add makefile to build/test the modelling file
Andreas Schneider [Fri, 3 Feb 2023 10:20:17 +0000 (11:20 +0100)] 
coverity: Add makefile to build/test the modelling file

This allows to check that it compiles at least with gcc.

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>
8 days agocoverity: Add some documentation for the modelling file
Andreas Schneider [Thu, 2 Feb 2023 16:27:01 +0000 (17:27 +0100)] 
coverity: Add some documentation for the modelling file

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>
8 days agogitlab-ci: Update build instructions for Coverity
Andreas Schneider [Tue, 29 Jul 2025 13:59:08 +0000 (15:59 +0200)] 
gitlab-ci: Update build instructions for Coverity

See https://scan.coverity.com/download?tab=other

ref: https://documentation.blackduck.com/bundle/coverity-docs/page/cli/topics/command_reference.html
ref: https://documentation.blackduck.com/bundle/coverity-docs/page/cli/topics/options_reference.html

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>
11 days agolib/tdb: let tdbtool return error on failure
Günther Deschner [Wed, 30 Jul 2025 16:54:20 +0000 (18:54 +0200)] 
lib/tdb: let tdbtool return error on failure

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

Unless there is a striking reason not to do so tdbtool should return a
non-zero return code when a failure was encountered. Most known callers
have to parse stdout to check whether a command has succeeded or failed.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Aug  2 08:20:53 UTC 2025 on atb-devel-224

11 days agos3-selftest: fix test_wbinfo_lookuprids_cache.sh
Günther Deschner [Thu, 31 Jul 2025 13:35:04 +0000 (15:35 +0200)] 
s3-selftest: fix test_wbinfo_lookuprids_cache.sh

This script is using tdbtool for deleting keys of a particular
winbind NDR operation for regression testing. There are two issues here:

The opnum for this winbind NDR operation has changed (as new calls have
been added to the interface), it is no longer 16 but now 17. Better try
to lookup the current opnum from the IDL.

As tdbtool always returns with success error code regardless of the
success of its command - in this case a delete key operation - the test
is simply not able to fail at all (patch following to fix tdbtool
itself).

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
12 days agolibrpc:ndr:keycredlink fix CID 1660828
Gary Lockyer [Thu, 31 Jul 2025 19:58:52 +0000 (07:58 +1200)] 
librpc:ndr:keycredlink fix CID 1660828

Fixes:

*** CID 1660828:         Control flow issues  (UNREACHABLE)
/librpc/ndr/ndr_keycredlink.c: 752             in pull_DER_RSA_KEY()
746      goto out;
747      }
748      if (!asn1_end_tag(asn)) { /* PublicKeyInfo */
749      return ndr_pull_error(ndr,
750            NDR_ERR_UNREAD_BYTES,
751            "ASN1 element PublicKeyInfo");
>>>     CID 1660828:         Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "goto out;".
752      goto out;
753      }

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Aug  1 14:21:17 UTC 2025 on atb-devel-224

12 days agos3:smbd: Fix CID 1449599 replacing memcpy to memmove to avoid overflow
Shweta Sodani [Fri, 1 Aug 2025 06:15:52 +0000 (11:45 +0530)] 
s3:smbd: Fix CID 1449599 replacing memcpy to memmove to avoid overflow

Here reply_smb1_outbuf is allocating the req->outbuf buffer, hence
safest way to use is memmove that has a checks for overlap instead of
memcpy.

This fixes coverity issue#1449599

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Aug  1 11:03:06 UTC 2025 on atb-devel-224

13 days agolibrpc:bcrypt_rsakey_blob: exponent and modulus lengths can't be zero
Douglas Bagnall [Wed, 30 Jul 2025 09:18:09 +0000 (21:18 +1200)] 
librpc:bcrypt_rsakey_blob: exponent and modulus lengths can't be zero

Apart from it making no sense, without these ranges we end up
allocating a NULL buffer and aborting.

We also put a maximum size on the RSA key, in case we could get
tricked into a DoS by pulling a large buffer and trying crypto maths
on it.

 6 0x572ebce2749a in talloc_abort samba/lib/talloc/talloc.c:506:3
 7 0x572ebce271d4 in talloc_chunk_from_ptr samba/lib/talloc/talloc.c:0
 8 0x572ebce271d4 in __talloc_with_prefix samba/lib/talloc/talloc.c:762:12
 9 0x572ebce235f9 in __talloc samba/lib/talloc/talloc.c:825:9
10 0x572ebce235f9 in _talloc_named_const samba/lib/talloc/talloc.c:982:8
11 0x572ebce235f9 in _talloc_memdup samba/lib/talloc/talloc.c:2441:9
12 0x572ebc8f6a4f in data_blob_talloc_named samba/lib/util/data_blob.c:56:25
13 0x572ebc7d23bd in pull_BCRYPT_RSAPUBLIC_BLOB samba/librpc/ndr/ndr_keycredlink.c:878:17
14 0x572ebc7d23bd in ndr_pull_KeyMaterialInternal samba/librpc/ndr/ndr_keycredlink.c:959:10
15 0x572ebc788e90 in LLVMFuzzerTestOneInput samba/bin/default/lib/fuzzing/fuzz_ndr_keycredlink_TYPE_STRUCT.c:282:13

REF: https://issues.oss-fuzz.com/issues/435039896

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): Thu Jul 31 05:45:07 UTC 2025 on atb-devel-224

2 weeks agos3/libsmb: check the negative-conn-cache in resolve_ads()
Ralph Boehme [Thu, 3 Jul 2025 16:42:04 +0000 (18:42 +0200)] 
s3/libsmb: check the negative-conn-cache in resolve_ads()

This way we throw away blacklisted servers right away when learning about them
from the DNS SRV query.

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

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 Jul 30 10:10:21 UTC 2025 on atb-devel-224

2 weeks agos3/libsmb: check command in make_dc_info_from_cldap_reply()
Ralph Boehme [Wed, 2 Jul 2025 16:49:51 +0000 (18:49 +0200)] 
s3/libsmb: check command in make_dc_info_from_cldap_reply()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agolibads: check for if DCs are in paused state when processing CLDAP replies
Ralph Boehme [Thu, 3 Jul 2025 10:50:53 +0000 (12:50 +0200)] 
libads: check for if DCs are in paused state when processing CLDAP replies

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agos3/libads: get rid of additional loop calling add_failed_connection_entry()
Ralph Boehme [Tue, 1 Jul 2025 16:19:32 +0000 (18:19 +0200)] 
s3/libads: get rid of additional loop calling add_failed_connection_entry()

Just call add_failed_connection_entry() in the initial loop at all places where
we have a "bad" result.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agos3:libads: let get_kdc_ip_string() check for a blacklisted server name
Stefan Metzmacher [Tue, 4 Jul 2023 16:07:51 +0000 (18:07 +0200)] 
s3:libads: let get_kdc_ip_string() check for a blacklisted server name

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agos3:libads: let cldap_ping_list() check for a blacklisted server name
Stefan Metzmacher [Wed, 16 Feb 2022 12:09:14 +0000 (13:09 +0100)] 
s3:libads: let cldap_ping_list() check for a blacklisted server name

If we black listed a server we should not use it even if
it responses to CLDAP requests.

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

Pair-Programmed-With: Ralph Boehme <slow@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agowinbindd: blacklist servers returning ACCESS_DENIED/authoritative=0
Stefan Metzmacher [Wed, 16 Feb 2022 13:23:16 +0000 (14:23 +0100)] 
winbindd: blacklist servers returning ACCESS_DENIED/authoritative=0

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agowinbindd: always use winbind_add_failed_connection_entry() wrapper
Stefan Metzmacher [Wed, 16 Feb 2022 13:18:50 +0000 (14:18 +0100)] 
winbindd: always use winbind_add_failed_connection_entry() wrapper

We should not use add_failed_connection_entry() directly.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agos3:conncache: improve debugging for the negative connection cache
Stefan Metzmacher [Wed, 16 Feb 2022 13:18:20 +0000 (14:18 +0100)] 
s3:conncache: improve debugging for the negative connection cache

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2 weeks agodsdb: fix bug 15872, use-after-free
Douglas Bagnall [Sun, 22 Jun 2025 03:05:39 +0000 (15:05 +1200)] 
dsdb: fix bug 15872, use-after-free

We were finding the old element, reallocing, then copying,
which is the wrong order.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 30 02:03:40 UTC 2025 on atb-devel-224

2 weeks agoiconv: fixed coverity issue CID1609382
Xavi Hernandez [Tue, 29 Jul 2025 08:31:45 +0000 (10:31 +0200)] 
iconv: fixed coverity issue CID1609382

The issue is not a real bug as it is implemented, but it's better to not
mix signed and unsigned types to avoid potential future issues.

Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 30 00:44:28 UTC 2025 on atb-devel-224

2 weeks agos3:lib: Fix CID 1497484 use-after-free.
Vinit Agnihotri [Tue, 29 Jul 2025 05:02:06 +0000 (10:32 +0530)] 
s3:lib: Fix CID 1497484 use-after-free.

p was not set to NULL after being free'd, this can cause a
use-after-free situation.

This fixes coverity issue#1497484

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): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jul 29 15:01:42 UTC 2025 on atb-devel-224

2 weeks agos4:kdc Support for key trust authentication
Gary Lockyer [Fri, 25 Jul 2025 01:22:27 +0000 (13:22 +1200)] 
s4:kdc Support for key trust authentication

Extract the public kes from msDS-KeyCredentialLink and populate the sdb
structure.  These values can then be passed to Kergeros to allow key
trust authentication.

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): Tue Jul 29 05:31:10 UTC 2025 on atb-devel-224

2 weeks agos4:kdc:sdb: Add support for key trust public keys
Gary Lockyer [Thu, 17 Jul 2025 02:12:08 +0000 (14:12 +1200)] 
s4:kdc:sdb: Add support for key trust public keys

Add public keys to the sdb entry to allow them to be passed to Kerberos
for key trust authentication.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 weeks agos4:kdc: Fix clang-tidy error in db-glue.c
Gary Lockyer [Wed, 16 Jul 2025 23:47:39 +0000 (11:47 +1200)] 
s4:kdc: Fix clang-tidy error in db-glue.c

../../source4/kdc/db-glue.c:968:14: warning: Access to field 'kvno' results in a dereference of a null pointer (loaded from variable 'entry') [clang-analyzer-core.NullDereference]
  968 |         entry->kvno = returned_kvno;
      |         ~~~~~       ^
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 weeks agolibrpc: keycredlink support X509 public keys
Gary Lockyer [Fri, 11 Jul 2025 01:41:42 +0000 (13:41 +1200)] 
librpc: keycredlink support X509 public keys

Add support for X509 encoded public keys in msDSKeyCredentialLink
KeyMaterial.

Note: Only RSA public keys are supported.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 weeks agolibrpc/idl: Add idl for tpm20_rsakey_blob
Gary Lockyer [Mon, 30 Jun 2025 21:43:07 +0000 (09:43 +1200)] 
librpc/idl: Add idl for tpm20_rsakey_blob

Idl and tests for TPM20_RSAKEY_BLOB, one of the possible encoding of
msDSKeyCredentialLink KeyMaterial
Derived from:
    https://dox.ipxe.org/Tpm20_8h_source.html#l00164
    https://stackoverflow.com/questions/78958315/cannot-parse-tpm2-0-public-key

Note: this is a greatly simplified implementation that only handles TPM
      version 2, RSA public keys.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 weeks agolibrpc/idl: update keycredlink comments
Gary Lockyer [Mon, 23 Jun 2025 22:45:58 +0000 (10:45 +1200)] 
librpc/idl: update keycredlink comments

Replace // comments with /* */ and document the KeyId and KeyHash
elements.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 weeks agolibrpc/idl: Add idl for BCRYPT_RSAKEY_BLOB
Gary Lockyer [Mon, 23 Jun 2025 03:01:37 +0000 (15:01 +1200)] 
librpc/idl: Add idl for BCRYPT_RSAKEY_BLOB

Idl and tests for BCRYPT_RSAKEY_BLOB
See https://learn.microsoft.com/en-us/windows/win32/api/
            bcrypt/ns-bcrypt-bcrypt_rsakey_blob

This is one of the encodings of msDSKeyCredentialLink KeyMaterial when
KeyUsage is KEY_USAGE_NGC. As there appears to be no official
documentation on the contents of KeyMaterial have based this on.

    https://github.com/p0dalirius/pydsinternals/blob/271dd969e07a8939044bfc498d94443082ec6fa9/
            dsinternals/common/data/hello/KeyCredential.py#L75-L92

Note: only RSA public keys are handled

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 weeks agoctdb-tests: Fix CID 1659221 - Error handling issues (CHECKED_RETURN)
Martin Schwenke [Sat, 26 Jul 2025 02:22:55 +0000 (12:22 +1000)] 
ctdb-tests: Fix CID 1659221 - Error handling issues (CHECKED_RETURN)

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jul 28 06:45:51 UTC 2025 on atb-devel-224

2 weeks agoctdb-tcp: Fix CID 1291643 - Resource leak (RESOURCE_LEAK)
Martin Schwenke [Sun, 1 Jun 2025 01:05:31 +0000 (11:05 +1000)] 
ctdb-tcp: Fix CID 1291643 - Resource leak (RESOURCE_LEAK)

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agoctdb-tests: Fix CID 1373387 - Time of check time of use (TOCTOU)
Martin Schwenke [Fri, 7 Oct 2016 03:30:19 +0000 (14:30 +1100)] 
ctdb-tests: Fix CID 1373387 - Time of check time of use (TOCTOU)

Coverity doesn't like the fopen(3) after stat(2).  This is test code
that runs in a simple test environment, so this doesn't really matter.

However, reorder the code to put the stat(2) after the fopen(3).  This
means that the test still does all the same checks and it should now
make Coverity happy.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Anoop C S <anoopcs@samba.org>
2 weeks agogitignore: remove clang-format
Gary Lockyer [Thu, 24 Jul 2025 23:24:37 +0000 (11:24 +1200)] 
gitignore: remove clang-format

As we do have a project blessed clang-format, it should not be in
gitignore

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Jul 26 06:02:34 UTC 2025 on atb-devel-224

2 weeks agos3-net: fix "net ads kerberos" krb5ccname handling
Günther Deschner [Sun, 20 Jul 2025 16:00:22 +0000 (18:00 +0200)] 
s3-net: fix "net ads kerberos" krb5ccname handling

We can only rely on KRB5CCNAME being set, --use-krb5-ccname content is
not available.

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

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): Thu Jul 24 17:31:14 UTC 2025 on atb-devel-224

2 weeks agos3-selftest: add tests for "net ads kerberos" commands
Günther Deschner [Sun, 20 Jul 2025 15:59:37 +0000 (17:59 +0200)] 
s3-selftest: add tests for "net ads kerberos" commands

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 weeks agoctdb-server: Load optional tunables.d/ directory
Martin Schwenke [Wed, 25 Jun 2025 12:18:16 +0000 (22:18 +1000)] 
ctdb-server: Load optional tunables.d/ directory

Change the variable name to "path" so it makes sense to reuse it for
the directory.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Jul 23 00:02:47 UTC 2025 on atb-devel-224

3 weeks agoctdb-server: Whitespace fixes
Martin Schwenke [Wed, 25 Jun 2025 12:21:39 +0000 (22:21 +1000)] 
ctdb-server: Whitespace fixes

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-tests: Add tests for tunables directory loading
Martin Schwenke [Fri, 27 Jun 2025 07:35:03 +0000 (17:35 +1000)] 
ctdb-tests: Add tests for tunables directory loading

The missing 2nd file testcase becomes the missing directory testcase,
because you can't easily have both.  See the comment in
tunable_test.c.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-common: Add tunable directory loading
Martin Schwenke [Fri, 27 Jun 2025 05:11:59 +0000 (15:11 +1000)] 
ctdb-common: Add tunable directory loading

This is simpler than include files and more general than just allowing
a 2nd file to be loaded.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-tests: Allow tunables unit test to process a second file
Martin Schwenke [Wed, 25 Jun 2025 12:14:05 +0000 (22:14 +1000)] 
ctdb-tests: Allow tunables unit test to process a second file

The second file is optional.

Make $tfile the default to avoid having to update all of the single
file testcases.

Add test cases for second file.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-common: Log tunables filename instead of function name
Martin Schwenke [Fri, 27 Jun 2025 05:05:04 +0000 (15:05 +1000)] 
ctdb-common: Log tunables filename instead of function name

When loading multiple files, this is more informative.

Tweak a couple of error messages to ensure they all mention
"tunables".

Update the unit testcases to match.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-common: Log a message if the tunables file does not exist
Martin Schwenke [Sun, 29 Jun 2025 00:16:20 +0000 (10:16 +1000)] 
ctdb-common: Log a message if the tunables file does not exist

Switch the unit test script to INFO debug level to ensure this output
appears when expected.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-tests: Add logging support to the tunables unit test
Martin Schwenke [Sat, 28 Jun 2025 02:01:41 +0000 (12:01 +1000)] 
ctdb-tests: Add logging support to the tunables unit test

Make tunable_test respect CTDB_DEBUGLEVEL.  Using test_options.[ch]
would be overkill here.  This means including logging.c - we can't
link to the subsystem containing logging.c because the file being
tested (tunable.c) is part of that subsystem.

Support logging in the test script.  tunable_ok() builds the logging
output for the good path.  Set the debug level to NOTICE and update
expected results for individual failure path tests.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-common: Require separate initialisation of tunable defaults
Martin Schwenke [Wed, 25 Jun 2025 10:46:26 +0000 (20:46 +1000)] 
ctdb-common: Require separate initialisation of tunable defaults

Dropping this from ctdb_tunable_load_file() allows that function to be
called multiple times for different files.  The caller sets the
defaults.

In the test script, factor out the handling of a single tunables file
in a similar way.  Ignoring missing/unreadable files is OK because
this function will only be called for test successes (hence "ok" in
the name).  There will never be existing, unreadable files.  The code
being tested ignores missing files, so do that here too.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-tests: Reformat with "shfmt -w -p -i 0 -fn"
Martin Schwenke [Sat, 28 Jun 2025 02:12:33 +0000 (12:12 +1000)] 
ctdb-tests: Reformat with "shfmt -w -p -i 0 -fn"

Best reviewed with "git show -w".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agoctdb-common: Fix includes to make file standalone
Martin Schwenke [Wed, 25 Jun 2025 10:44:52 +0000 (20:44 +1000)] 
ctdb-common: Fix includes to make file standalone

Avoid lots of red underlines in my editor.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 weeks agolibcli/smb: use talloc_asprintf_addbuf() in smbXcli_session_dump_keys()
Ralph Boehme [Mon, 21 Jul 2025 10:59:55 +0000 (12:59 +0200)] 
libcli/smb: use talloc_asprintf_addbuf() in smbXcli_session_dump_keys()

Avoids DEBUGADD() which can lead to intersected output in the logfile.

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): Tue Jul 22 15:09:11 UTC 2025 on atb-devel-224

3 weeks agosmbd: now also use smbXcli_session_dump_keys() in the server
Ralph Boehme [Sat, 19 Jul 2025 06:56:29 +0000 (08:56 +0200)] 
smbd: now also use smbXcli_session_dump_keys() in the server

Adds support for dumping keys in format for Wireshark
~/.wireshark/smb2_seskey_list

Example:

  debug encryption: dumping generated session keys
  Session Id    [0000] 7D 00 00 E8 57 E0 31 01                             }...W.1.
  Session Key   [0000] 71 54 77 50 C1 DD 66 68   A8 51 D8 DE 23 F4 91 01   qTwP..fh .Q..#...
  Signing Key   [0000] B1 29 AC EF 41 30 AE D2   43 00 1F 67 87 29 BF DB   .)..A0.. C..g.)..
  App Key       [0000] 6A 88 5C 51 51 22 FF 5C   25 95 A2 5C E2 2C FC 5D   j.\QQ".\ %..\.,.]
  ServerIn Key  [0000] 20 08 EB A2 14 99 17 03   9C A5 9A BB B8 48 88 3C    ....... .....H.<
  ServerOut Key [0000] 15 AA C2 0D 19 AB 4C 26   64 E8 FC 94 B1 FE 27 5A   ......L& d.....'Z
  Wireshark configuration line
  7d0000e857e03101,71547750c1dd6668a851d8de23f49101,15aac20d19ab4c2664e8fc94b1fe275a,2008eba2149917039ca59abbb848883c

When setting

    debug encryption = yes
    debug encryption:wireshark keyfile = /home/slow/.wireshark/smb2_seskey_list

the keys are appended directly to Wireshark's keyfile. Wireshark has to be
restarted to pick them up.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agolibcli/smb2: dump encryption key in format for Wireshark ~/.wireshark/smb2_seskey_list
Ralph Boehme [Sat, 19 Jul 2025 12:54:10 +0000 (14:54 +0200)] 
libcli/smb2: dump encryption key in format for Wireshark ~/.wireshark/smb2_seskey_list

This allows dumping the keys and quickly feeding them into Wireshark by adding
them to ~/.wireshark/smb2_seskey_list.

Example:

  debug encryption: dumping generated session keys
  Session Id    [0000] 7D 00 00 E8 57 E0 31 01                             }...W.1.
  Session Key   [0000] 71 54 77 50 C1 DD 66 68   A8 51 D8 DE 23 F4 91 01   qTwP..fh .Q..#...
  Signing Key   [0000] B1 29 AC EF 41 30 AE D2   43 00 1F 67 87 29 BF DB   .)..A0.. C..g.)..
  App Key       [0000] 6A 88 5C 51 51 22 FF 5C   25 95 A2 5C E2 2C FC 5D   j.\QQ".\ %..\.,.]
  ServerIn Key  [0000] 20 08 EB A2 14 99 17 03   9C A5 9A BB B8 48 88 3C    ....... .....H.<
  ServerOut Key [0000] 15 AA C2 0D 19 AB 4C 26   64 E8 FC 94 B1 FE 27 5A   ......L& d.....'Z
  Wireshark configuration line
  7d0000e857e03101,71547750c1dd6668a851d8de23f49101,15aac20d19ab4c2664e8fc94b1fe275a,2008eba2149917039ca59abbb848883c

When setting

    debug encryption = yes
    debug encryption:wireshark keyfile = /home/slow/.wireshark/smb2_seskey_list

the keys are appended directly to Wireshark's keyfile. Wireshark has to be
restarted to pick them up.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agos4/libcli/smb2: dump encryption keys if enabled
Ralph Boehme [Fri, 18 Jul 2025 17:28:44 +0000 (19:28 +0200)] 
s4/libcli/smb2: dump encryption keys if enabled

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agos4/libcli/smb2: pass lp_ctx to smb2_session_init() and remember debug encryption...
Ralph Boehme [Fri, 18 Jul 2025 17:27:48 +0000 (19:27 +0200)] 
s4/libcli/smb2: pass lp_ctx to smb2_session_init() and remember debug encryption settings

Not yet used, that comes next.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agolibcli/smb: also dump signing_algo in smbXcli_session_dump_keys()
Ralph Boehme [Sat, 19 Jul 2025 13:43:03 +0000 (15:43 +0200)] 
libcli/smb: also dump signing_algo in smbXcli_session_dump_keys()

The server side already does that and I'm aiming for consolidating server and
client code for dumping the keys.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agolibcli/smb: make smbXcli_session_dump_keys() usable for the server side
Ralph Boehme [Sat, 19 Jul 2025 12:26:50 +0000 (14:26 +0200)] 
libcli/smb: make smbXcli_session_dump_keys() usable for the server side

By passing the individual keys directly instead of passing the wrapping state
objects, smbXcli_session_dump_keys() can later also be used by the server code.

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agolibcli/smb: move cli_session_dump_keys() to libsmb
Ralph Boehme [Fri, 18 Jul 2025 15:43:12 +0000 (17:43 +0200)] 
libcli/smb: move cli_session_dump_keys() to libsmb

More callers to come...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 weeks agothird_party/quic_ko_wrapper: Remove unused config check
Anoop C S [Fri, 18 Jul 2025 13:54:09 +0000 (19:24 +0530)] 
third_party/quic_ko_wrapper: Remove unused config check

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Jul 22 08:55:10 UTC 2025 on atb-devel-224

3 weeks agovfs_virsufilter: Fix the invocation of SMB_VFS_NEXT_CONNECT
Rabinarayan Panigrahi [Tue, 15 Jul 2025 15:45:49 +0000 (21:15 +0530)] 
vfs_virsufilter: Fix the invocation of SMB_VFS_NEXT_CONNECT

virusfilter is failing if path is defined for virusfilter:quarantine
as next module is not initialized by mean time. So rearranged invocation
of SMB_VFS_NEXT_CONNECT call

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

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Jul 21 11:28:12 UTC 2025 on atb-devel-224

3 weeks agosmbd: fix mode being sent to possibly_set_archive
Srinivas Rao V [Thu, 3 Jul 2025 14:19:46 +0000 (10:19 -0400)] 
smbd: fix mode being sent to possibly_set_archive

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

possibly_set_archive is being passed smb_fname->st.st_ex_mode.
Inside the function same variable is getting assigned to itself.
Fixed this to send unx_mode to possibly_set_archive.

Signed-off-by: Srinivas Rao V <Srinivas.Rao.V@ibm.com>
Reviewed-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): Fri Jul 18 22:25:05 UTC 2025 on atb-devel-224

3 weeks agovfs_ceph_new: cleanup to async path
Shweta Sodani [Mon, 14 Jul 2025 13:17:58 +0000 (18:47 +0530)] 
vfs_ceph_new: cleanup to async path

Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Jul 17 23:13:36 UTC 2025 on atb-devel-224

3 weeks agos3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over quic-ngtcp2
Stefan Metzmacher [Mon, 19 May 2025 12:56:14 +0000 (14:56 +0200)] 
s3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over quic-ngtcp2

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 17 10:00:51 UTC 2025 on atb-devel-224

3 weeks agos3:libsmb: add support for userspace quic support using ngtcp2
Stefan Metzmacher [Tue, 6 May 2025 09:32:43 +0000 (11:32 +0200)] 
s3:libsmb: add support for userspace quic support using ngtcp2

By default we fallback to ngtcp2 if the kernel has no quic.ko
support.

To force it the following option can be used:

  client smb transport:force_ngtcp2_quic=yes

To disable it the following option can be used:

  client smb transport:allow_ngtcp2_quic=no

From within libsmbclient.so we can't use it at all
as there's no way monitor the connection in order
to handle acked and keep alive pings.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos4:lib/tls: add tstream_tls_ngtcp2_connect_send/recv
Stefan Metzmacher [Sun, 4 May 2025 16:20:56 +0000 (18:20 +0200)] 
s4:lib/tls: add tstream_tls_ngtcp2_connect_send/recv

This implemented a tstream_context for a single QUIC
stream using libngtcp2 over an udp socket.

This will allow us to support the SMB over QUIC protocol
on the client side even without quic.ko kernel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agolib/tsocket: optimize tdgram_recvfrom_done() into tdgram_recvfrom_send()
Stefan Metzmacher [Fri, 16 May 2025 14:29:19 +0000 (16:29 +0200)] 
lib/tsocket: optimize tdgram_recvfrom_done() into tdgram_recvfrom_send()

For callers using tdgram_bsd_optimize_recvfrom() it is every useful
to know it data was already waiting in the socket.

In that case the result from tdgram_bsd_recvfrom_send() would
already report tevent_req_is_in_progress() as false.

But the result of tdgram_recvfrom_send() available to the
caller would see tevent_req_is_in_progress() reporting true.

With this change also the result of tdgram_recvfrom_send()
would report tevent_req_is_in_progress() as false,
which will be useful for callers, which would otherwise
set a timeout on the request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over quic_ko_wrapper
Stefan Metzmacher [Tue, 29 Apr 2025 14:20:35 +0000 (16:20 +0200)] 
s3:selftest: run smb2.{bench,connect,credits,ioctl,rw} over quic_ko_wrapper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agoselftest: let 'fileserver' support quic
Stefan Metzmacher [Fri, 2 May 2025 10:48:21 +0000 (12:48 +0200)] 
selftest: let 'fileserver' support quic

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agoselftest: use quic_ko_wrapper if available
Stefan Metzmacher [Tue, 22 Apr 2025 10:26:19 +0000 (12:26 +0200)] 
selftest: use quic_ko_wrapper if available

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agothird_party: add quic_ko_wrapper to simulate IPPROTO_QUIC sockets
Stefan Metzmacher [Fri, 2 May 2025 12:44:42 +0000 (14:44 +0200)] 
third_party: add quic_ko_wrapper to simulate IPPROTO_QUIC sockets

For now this is only part of Samba, so no real third_party,
but in future we may decide have a standalone repository
or move it to https://github.com/lxin/quic.git

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agothird_party: import ngtcp2 v1.13.0 from https://github.com/ngtcp2/ngtcp2.git
Stefan Metzmacher [Fri, 2 May 2025 12:32:11 +0000 (14:32 +0200)] 
third_party: import ngtcp2 v1.13.0 from https://github.com/ngtcp2/ngtcp2.git

This imports commit 7dd482f949f145632c482d01af2184954b471795.

It will be used to implement a quic_ko_wrapper, but also
used as userspace client too.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3:libsmb: add support for SMB_TRANSPORT_TYPE_QUIC
Stefan Metzmacher [Thu, 3 Apr 2025 23:17:19 +0000 (01:17 +0200)] 
s3:libsmb: add support for SMB_TRANSPORT_TYPE_QUIC

This requires https://github.com/lxin/quic, which provides a kernel
module quic.ko for Linux (tested with Linux 6.8 and 6.14).

The userspace libquic is mirrored under third_party/quic for now.

This can be activated by adding 'quic' to 'client smb transports'.

The following smb.conf options are also relevant:
'tls enabled'
'tls ca directories'
'tls trust system cas'
'tls cafile'
'tls crlfile'
'tls verify peer'

Note that tools like smbclient are able to take
--option='client smb transports = quic" --option='tls verify peer=no_check'
in order to test it without changing smb.conf,
You may not want to use 'tls verify peer=no_check' for
production, it would make the transport as unprotected
as a tcp connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos3:smbd: add support for SMB_TRANSPORT_TYPE_QUIC
Stefan Metzmacher [Thu, 3 Apr 2025 15:32:58 +0000 (17:32 +0200)] 
s3:smbd: add support for SMB_TRANSPORT_TYPE_QUIC

This requires https://github.com/lxin/quic, which provides a kernel
module quic.ko for Linux (tested with Linux 6.8 and 6.14).

The userspace libquic is mirrored under third_party/quic for now.

This can be activated by adding 'quic' to 'server smb transports'.

The following smb.conf options are also relevant:
'tls enabled'
'tls cafile'
'tls certfile'
'tls keyfile'

If the files pointed to by 'tls cafile', 'tls certfile' and
'tls keyfile' all don't exist, self-signed tls certificates are
generated automatically at startup.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agos4:lib/tls: add tstream_tls_params_quic_{prepare,enabled() and tstream_tls_quic_hands...
Stefan Metzmacher [Mon, 7 Apr 2025 11:46:23 +0000 (13:46 +0200)] 
s4:lib/tls: add tstream_tls_params_quic_{prepare,enabled() and tstream_tls_quic_handshake[_{send,recv}]()

This requires https://github.com/lxin/quic, which provides a kernel
module quic.ko for Linux (tested with Linux 6.8 and 6.14).

The userspace libquic is mirrored under third_party/quic for now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agothird_party: import quic from https://github.com/lxin/quic.git
Stefan Metzmacher [Tue, 15 Apr 2025 09:00:17 +0000 (11:00 +0200)] 
third_party: import quic from https://github.com/lxin/quic.git

For now the VERSION argument to third_party/quic/update.sh
is ignored as there are no versions yet. For now we require
version 1.1 (not releases) for a system library, in order to make sure
it is recent enough.

This import is based on commit 846dddb24f007c8356ce3c19c74445160a8d94f7.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agosystem_gnutls: print the found gnutls version and detected features
Stefan Metzmacher [Wed, 16 Apr 2025 18:15:07 +0000 (20:15 +0200)] 
system_gnutls: print the found gnutls version and detected features

This makes it easier to analyze build failures.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agolib/param: allow smb_transport[s]_parse() to handle 'quic'
Stefan Metzmacher [Thu, 3 Apr 2025 15:04:13 +0000 (17:04 +0200)] 
lib/param: allow smb_transport[s]_parse() to handle 'quic'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 weeks agolibcli/smb: define SMB_TRANSPORT_TYPE_QUIC
Stefan Metzmacher [Thu, 3 Apr 2025 15:03:57 +0000 (17:03 +0200)] 
libcli/smb: define SMB_TRANSPORT_TYPE_QUIC

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 weeks agoAdd check for the GPO link to have at least two attributes separated by semicolumn...
Aleksandr Sharov [Fri, 4 Jul 2025 13:32:28 +0000 (15:32 +0200)] 
Add check for the GPO link to have at least two attributes separated by semicolumn. Allows to handle empty links.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15877
RN: Fix handling of empty GPO link

Singed-off-by: Alex Sharov (kororland@gmail.com)
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 10 18:55:33 UTC 2025 on atb-devel-224

4 weeks agotests: Rename local variable: prefix_abs -> prefix
Pavel Filipenský [Fri, 4 Jul 2025 13:10:58 +0000 (15:10 +0200)] 
tests: Rename local variable: prefix_abs -> prefix

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul 10 16:15:24 UTC 2025 on atb-devel-224

4 weeks agoselftest: Remove no longer used PREFIX_ABS from environment
Pavel Filipenský [Thu, 3 Jul 2025 21:18:59 +0000 (23:18 +0200)] 
selftest: Remove no longer used PREFIX_ABS from environment

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agotests: Replace PREFIX_ABS with PREFIX
Pavel Filipenský [Thu, 3 Jul 2025 21:07:37 +0000 (23:07 +0200)] 
tests: Replace PREFIX_ABS with PREFIX

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest:s4: Delete no longer used hash key 'prefix_abs' from ctx
Pavel Filipenský [Thu, 3 Jul 2025 20:49:10 +0000 (22:49 +0200)] 
selftest:s4: Delete no longer used hash key 'prefix_abs' from ctx

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest: Remove prefix_abs from ctx hash key
Pavel Filipenský [Thu, 3 Jul 2025 20:48:38 +0000 (22:48 +0200)] 
selftest: Remove prefix_abs from ctx hash key

prefix is an absolute path now.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest:s4: Fix prefix in setup functions
Pavel Filipenský [Thu, 3 Jul 2025 20:39:00 +0000 (22:39 +0200)] 
selftest:s4: Fix prefix in setup functions

The parameter '$prefix' passed to setup_...() is already an absolute
path, no need to maintain '$prefix_abs' in Samba4.pm.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest:s3: Fix prefix in setup functions
Pavel Filipenský [Thu, 3 Jul 2025 21:32:30 +0000 (23:32 +0200)] 
selftest:s3: Fix prefix in setup functions

The parameter '$prefix' passed to setup_...() is already an absolute
path, no need to maintain '$prefix_abs' in Samba3.pm.

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 weeks agoselftest: Make '$prefix' absolute path and remove '$prefix_abs'
Pavel Filipenský [Thu, 3 Jul 2025 19:56:59 +0000 (21:56 +0200)] 
selftest: Make '$prefix' absolute path and remove '$prefix_abs'

This fixes the issue with failing test

make -j20 test TESTS="samba4.blackbox.samba-tool_ntacl.ad_member"

Due to ./st/ntacl_testdirtop/dir1/symlink: broken symbolic link
to ./st/ntacl_testdirtop/testfile

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 weeks agos3:winbind: Initialize and setup idmap child in winbindd_getgrnam()
Samuel Cabrero [Mon, 7 Jul 2025 11:15:43 +0000 (13:15 +0200)] 
s3:winbind: Initialize and setup idmap child in winbindd_getgrnam()

Make sure the idmap child is initialized before delegating the name unmapping.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Tue Jul  8 07:21:26 UTC 2025 on atb-devel-224

5 weeks agos3:winbind: Initialize and setup idmap child in winbindd_getpwnam()
Samuel Cabrero [Mon, 7 Jul 2025 11:04:15 +0000 (13:04 +0200)] 
s3:winbind: Initialize and setup idmap child in winbindd_getpwnam()

Make sure the idmap child is initialized before delegating the name unmapping.

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

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
5 weeks agosmbd: avoid mangling names in smbd_dirptr_lanman2_match_fn() for POSIX
Ralph Boehme [Sun, 25 May 2025 18:05:59 +0000 (20:05 +0200)] 
smbd: avoid mangling names in smbd_dirptr_lanman2_match_fn() for POSIX

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul  7 17:45:13 UTC 2025 on atb-devel-224

5 weeks agosmbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lan...
Ralph Boehme [Sun, 25 May 2025 18:04:53 +0000 (20:04 +0200)] 
smbd: pass dirfsp instead of conn and dptr to smbd_dirptr_lanman2_entry() and get_lanman2_dir_entry()

No change in behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibsmb: use parse_finfo_posix_info in is_bad_finfo_name()
Ralph Boehme [Mon, 26 May 2025 08:37:42 +0000 (10:37 +0200)] 
libsmb: use parse_finfo_posix_info in is_bad_finfo_name()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibsmb: set finfo->flags.posix in parse_finfo_posix_info()
Ralph Boehme [Mon, 26 May 2025 08:37:18 +0000 (10:37 +0200)] 
libsmb: set finfo->flags.posix in parse_finfo_posix_info()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibsmb: add flags to struct file_info
Ralph Boehme [Mon, 26 May 2025 08:35:21 +0000 (10:35 +0200)] 
libsmb: add flags to struct file_info

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agotests: expand SMB3 POSIX test for Windows illegal characters behaviour
Ralph Boehme [Sun, 25 May 2025 13:15:27 +0000 (15:15 +0200)] 
tests: expand SMB3 POSIX test for Windows illegal characters behaviour

The test was testing file creation, but not FIND behaviour.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 weeks agolibads: fix get_kdc_ip_string() ...
Ralph Boehme [Fri, 4 Jul 2025 15:50:40 +0000 (17:50 +0200)] 
libads: fix get_kdc_ip_string() ...

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

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): Mon Jul  7 16:46:29 UTC 2025 on atb-devel-224