]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
9 days agoVERSION: Disable GIT_SNAPSHOT for the 4.23.1 release. v4-23-stable samba-4.23.1
Jule Anger [Fri, 26 Sep 2025 13:45:23 +0000 (15:45 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.23.1 release.

Signed-off-by: Jule Anger <janger@samba.org>
9 days agoWHATSNEW: Add release notes for Samba 4.23.1.
Jule Anger [Fri, 26 Sep 2025 13:44:21 +0000 (15:44 +0200)] 
WHATSNEW: Add release notes for Samba 4.23.1.

Signed-off-by: Jule Anger <janger@samba.org>
9 days agoctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE
Martin Schwenke [Fri, 15 Aug 2025 05:01:58 +0000 (15:01 +1000)] 
ctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE

At the moment CTDB_SOCKET can be used outside of test mode even though
nobody should do this.  So, no longer allow this.

This means ensuring CTDB_TEST_MODE is set in the in the
"clusteredmember" selftest environment, so that CTDB_SOCKET is
respected there..

Details...

The associated use of chown(2) and chmod(2), used to secure the socket
in ctdb_daemon.c:ux_socket_bind(), potentially enables a symlink race
attack.  However, the chown(2) is currently not done in test mode, so
restricting the use of CTDB_SOCKET to test mode solves the potential
security issue.

Also, sprinkle warnings about use of CTDB_TEST_MODE in appropriate
places, just to attempt to limit unwanted behaviour.

An alternative could be to use the socket file descriptor with
fchown(2) and fchmod(2).  However, these system calls are not well
defined on sockets.  Still, this was previously done in CTDB's early
days (using the poorly documented method where they are allowed in
Linux (only?) before calling bind(2)).  It was removed (due to
portability issues, via commits
cf1056df94943ddcc3d547d4533b4bc04f57f265 and
2da3fe1b175a468fdff4aa4f65627facd2c28394) and replaced with the
current post-bind chown(2) and chmod(2).

I would like to remove the CTDB_SOCKET environment variable entirely,
since setting CTDB_TEST_MODE and CTDB_BASE covers all reasonable test
environments.  However, I have a feeling that people use it for
interactive testing, and that can still be done in CTDB_TEST_MODE.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reported-by: *GUIAR OQBA * <techokba@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 25 09:02:06 UTC 2025 on atb-devel-224

(cherry picked from commit 7e2358fcf7be177d6e5de6e26f9d7c5af4acbb0c)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Fri Sep 26 13:32:06 UTC 2025 on atb-devel-224

9 days agoctdb-common: Factor out checking of CTDB_TEST_MODE
Martin Schwenke [Fri, 15 Aug 2025 04:59:49 +0000 (14:59 +1000)] 
ctdb-common: Factor out checking of CTDB_TEST_MODE

For use elsewhere.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
(cherry picked from commit 4c12a36eb5b44fb08d0461e6fa77fcdb4a128433)

9 days agoctdb-pmda: Do not directly support CTDB_SOCKET environment variable
Martin Schwenke [Fri, 15 Aug 2025 02:08:47 +0000 (12:08 +1000)] 
ctdb-pmda: Do not directly support CTDB_SOCKET environment variable

Always use whatever CTDB uses in the current environment.

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

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit c4794e40529c63c696ecc3f8f27c810c22dd63a5)

9 days agoFix crash in DLZ plugin for incorrect setup
Alexander Bokovoy [Fri, 19 Sep 2025 13:23:41 +0000 (16:23 +0300)] 
Fix crash in DLZ plugin for incorrect setup

When bind is not yet setup properly, logging errors should be done
through the temporary handle.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Sep 20 06:49:37 UTC 2025 on atb-devel-224

(cherry picked from commit 821cf798d87162b1f3b5d7388891d15fea0a969a)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Fri Sep 26 10:36:53 UTC 2025 on atb-devel-224

9 days agovfs_ceph_new: Use integer value instead of boolean
Anoop C S [Mon, 22 Sep 2025 05:41:46 +0000 (11:11 +0530)] 
vfs_ceph_new: Use integer value instead of boolean

ceph_ll_fsync() API[1] accepts the third and final argument as integer
and not a boolean value.

[1] https://github.com/ceph/ceph/blob/main/src/include/cephfs/libcephfs.h#L2041

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

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Sep 22 12:24:35 UTC 2025 on atb-devel-224

(cherry picked from commit 5200c120f34c4a28fa9f4cb55b46dbb9d90eb758)

9 days agovfs_ceph_new: dont use ceph_ll_nonblocking_readv_writev for fsync_send
Shachar Sharon [Wed, 17 Sep 2025 11:25:27 +0000 (14:25 +0300)] 
vfs_ceph_new: dont use ceph_ll_nonblocking_readv_writev for fsync_send

Commit 4ae922413844 ("vfs_ceph_new: use libcephfs nonblocking API for
async-io ops") uses ceph_ll_nonblocking_readv_writev for fsync_send.
However, the actual behaviour of libcephfs when using this API with
'fsync=true' is not async-fsync, as one may assume. Instead,
vfs_ceph_new should use a nonblocking fsync API[1], once it is ready.

Removed the usage of ceph_ll_nonblocking_readv_writev for fsync.

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

[1] https://github.com/ceph/ceph/commit/c88a21c30d8b265adb152f631d2629d29539f7b7

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 82c0988a8bc3d3e364e2d56ad8ea27e359fbc3f0)

2 weeks agowinbind: Initialize idmap in winbindd_getgroups
Volker Lendecke [Fri, 12 Sep 2025 16:19:29 +0000 (18:19 +0200)] 
winbind: Initialize idmap in winbindd_getgroups

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15914
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): Sat Sep 13 05:44:20 UTC 2025 on atb-devel-224

(cherry picked from commit beaf661b1ec1f048efc8eb2b383fc989a79ae009)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Wed Sep 17 08:48:10 UTC 2025 on atb-devel-224

2 weeks agoctdb: Fix redefinitoin of pmdaResult
Andreas Schneider [Fri, 12 Sep 2025 13:37:38 +0000 (15:37 +0200)] 
ctdb: Fix redefinitoin of pmdaResult

../../ctdb/utils/pmda/pmda_ctdb.c:52:9: warning: 'pmdaResult' redefined
   52 | #define pmdaResult pmResult
      |         ^~~~~~~~~~
In file included from ../../ctdb/utils/pmda/pmda_ctdb.c:35:
/usr/include/pcp/pmda.h:30:9: note: this is the location of the previous definition
   30 | #define pmdaResult pmResult_v2
      |         ^~~~~~~~~~

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

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): Sat Sep 13 08:12:42 UTC 2025 on atb-devel-224

(cherry picked from commit d4b448c305f674646001e293d8aa6ebc0ca6dc77)

3 weeks agoWHATSNEW: fix typo
Jule Anger [Fri, 12 Sep 2025 08:45:13 +0000 (10:45 +0200)] 
WHATSNEW: fix typo

3 weeks agoVERSION: Bump version up to Samba 4.23.1...
Jule Anger [Fri, 12 Sep 2025 08:23:25 +0000 (10:23 +0200)] 
VERSION: Bump version up to Samba 4.23.1...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
3 weeks agoVERSION: Disable GIT_SNAPSHOT for the 4.23.0 release. samba-4.23.0
Jule Anger [Fri, 12 Sep 2025 08:22:43 +0000 (10:22 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.23.0 release.

Signed-off-by: Jule Anger <janger@samba.org>
3 weeks agoWHATSNEW: Add release notes for Samba 4.23.0.
Jule Anger [Fri, 12 Sep 2025 08:22:31 +0000 (10:22 +0200)] 
WHATSNEW: Add release notes for Samba 4.23.0.

Signed-off-by: Jule Anger <janger@samba.org>
3 weeks agos4:auth: Fix 'no delegation' logic in gensec_gssapi_start()
Andreas Schneider [Wed, 10 Sep 2025 13:13:37 +0000 (15:13 +0200)] 
s4:auth: Fix 'no delegation' logic in gensec_gssapi_start()

This fixes samba4.ntvfs.cifs.krb5.base.lock test with MIT Kerberos.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 66d3e5e49d34b0a4bfb8f2c862d48d11e27b2ea2)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Fri Sep 12 07:23:04 UTC 2025 on atb-devel-224

3 weeks agothird_party: Bump version for socket_wrapper
Andreas Schneider [Thu, 11 Sep 2025 10:39:49 +0000 (12:39 +0200)] 
third_party: Bump version for socket_wrapper

Commit be007c2cf41085a8648965fc904f37d25d35a453 forgot to do that.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep 11 17:05:00 UTC 2025 on atb-devel-224

(cherry picked from commit f4af0960a6e67319dba00da5e21c7ae95d719d64)

3 weeks agopytest: safe_tarfile: accept NotADirectoryError as bad path rejection
Douglas Bagnall [Fri, 22 Aug 2025 03:24:34 +0000 (15:24 +1200)] 
pytest: safe_tarfile: accept NotADirectoryError as bad path rejection

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

After recent upstream Python fixes for various path escape and symlink
CVEs in tarfile, in particular this commit:

  commit 3612d8f51741b11f36f8fb0494d79086bac9390a
  Author: Łukasz Langa <lukasz@langa.pl>
  Date:   Tue Jun 3 12:42:11 2025 +0200

  gh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_missing')` (#135037)

  Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

Signed-off-by: Łukasz Langa <lukasz@langa.pl>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
our ../../ test that looks for a tarfile.OutsideDestinationError now
meets a NotADirectoryError in recent Python versions (this from 3.13,
Fedora 42):

UNEXPECTED(error): samba.tests.safe_tarfile.samba.tests.safe_tarfile.SafeTarFileTestCase.test_dots(none)
REASON: Exception: Exception: Traceback (most recent call last):
  File "/tmp/samba-testbase/b1/samba-o3/bin/python/samba/tests/safe_tarfile.py", line 48, in test_dots
    self.assertRaises(tarfile.OutsideDestinationError,
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      stf.extractall,
                      ^^^^^^^^^^^^^^^
                      tarname)
                      ^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 795, in assertRaises
    return context.handle('assertRaises', args, kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 238, in handle
    callable_obj(*args, **kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/tarfile.py", line 2343, in extractall
    tarinfo, unfiltered = self._get_extract_tarinfo(
                          ~~~~~~~~~~~~~~~~~~~~~~~~~^
        member, filter_function, path)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/tarfile.py", line 2432, in _get_extract_tarinfo
    self._handle_fatal_error(e)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/lib64/python3.13/tarfile.py", line 2430, in _get_extract_tarinfo
    filtered = filter_function(unfiltered, path)
  File "/usr/lib64/python3.13/tarfile.py", line 842, in tar_filter
    new_attrs = _get_filtered_attrs(member, dest_path, False)
  File "/usr/lib64/python3.13/tarfile.py", line 783, in _get_filtered_attrs
    target_path = os.path.realpath(os.path.join(dest_path, name),
                                   strict=os.path.ALLOW_MISSING)
  File "<frozen posixpath>", line 457, in realpath
NotADirectoryError: [Errno 20] Not a directory: '/tmp/samba-testbase/b1/samba-o3/bin/ab/tmp/tmpbn6e69ci/tar.tar'

In this commit, we say that a NotADirectoryError is OK.

When we started safe_tarfile we were acting in advance of upstream
Python, but now they are well ahead of us. If we trust their work in
recent versions and accept the error conditions they choose, we can
more easily get rid of our safe_tarfile when the time is right.

For the moment we still support as far back as Python 3.6 for some old
enterprise distros, and it is for those that we continue to maintain
safe_tarfile. In versions before 3.11 we will see
tarfile.ExtractError, and the test for that is unaffected by this
change.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 7a5b22e4221ea2a0960a26cf79339168f0899d0c)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Thu Sep 11 10:18:00 UTC 2025 on atb-devel-224

3 weeks agoselftest: Do not use wrappers for samba.tests.docs
Andreas Schneider [Wed, 10 Sep 2025 11:31:11 +0000 (13:31 +0200)] 
selftest: Do not use wrappers for samba.tests.docs

We will run into issues with Python 3.14 passing sockets for
concurrently running tasks.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Sep 10 19:21:55 UTC 2025 on atb-devel-224

(cherry picked from commit 6cf1bf540e7f433e05a0a4119cff4bdaa608359e)

3 weeks agoprinting: Fix an uninitialized read
Volker Lendecke [Mon, 8 Sep 2025 16:19:01 +0000 (18:19 +0200)] 
printing: Fix an uninitialized read

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Tue Sep  9 11:06:34 UTC 2025 on atb-devel-224

(cherry picked from commit a6dcf78483d7ae492e695d30c5c783df8e7879d8)

3 weeks agos4:torture: Fix stack buffer overflow in test_dirlease_oplocks()
Andreas Schneider [Tue, 9 Sep 2025 07:24:47 +0000 (09:24 +0200)] 
s4:torture: Fix stack buffer overflow in test_dirlease_oplocks()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep  9 09:27:33 UTC 2025 on atb-devel-224

(cherry picked from commit c5c238a879182a2dfe528ae49f97da75e242afe7)

3 weeks agos3:net: Pass down the server from cmdline to sync_pw2keytabs()
Andreas Schneider [Mon, 28 Jul 2025 08:43:36 +0000 (10:43 +0200)] 
s3:net: Pass down the server from cmdline to sync_pw2keytabs()

This makes sure that during 'net ads join' the keytab create code
- sync_pw2keytabs() talks to the same DC at what the machine account
was created.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Pair-Programmed-With: Pavel Filipenský <pfilipensky@samba.org>

Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Fri Sep  5 13:38:33 UTC 2025 on atb-devel-224

(cherry picked from commit 5d1d3a8b568b5a07ed1ed537d20aa93820cecc14)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Tue Sep  9 12:46:31 UTC 2025 on atb-devel-224

3 weeks agotests: Add test for 'net ads join' to a preferred DC
Pavel Filipenský [Mon, 4 Aug 2025 09:20:54 +0000 (11:20 +0200)] 
tests: Add test for 'net ads join' to a preferred DC

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 36f6ac547c09f492d1dcab11570e8bcbd377cf26)

3 weeks agoselftest: Add the short name for localvampiredc to hosts file
Pavel Filipenský [Tue, 29 Jul 2025 09:19:07 +0000 (11:19 +0200)] 
selftest: Add the short name for localvampiredc to hosts file

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

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 5d2f60ae5aa96751b74901ae5384291ef338b152)

3 weeks agoctdb: fix build against PCP 7.0.0
Alexander Bokovoy [Wed, 3 Sep 2025 12:42:46 +0000 (15:42 +0300)] 
ctdb: fix build against PCP 7.0.0

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Sep  8 04:47:37 UTC 2025 on atb-devel-224

(cherry picked from commit 83ff87f3dab0d6b22031614e9481b880f1dd99e8)

4 weeks agoVERSION: Bump version up to Samba 4.23.0rc5...
Jule Anger [Fri, 5 Sep 2025 11:05:35 +0000 (13:05 +0200)] 
VERSION: Bump version up to Samba 4.23.0rc5...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
4 weeks agoVERSION: Disable GIT_SNAPSHOT for the 4.23.0rc4 release. samba-4.23.0rc4
Jule Anger [Fri, 5 Sep 2025 11:05:19 +0000 (13:05 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.23.0rc4 release.

Signed-off-by: Jule Anger <janger@samba.org>
4 weeks agoWHATSNEW: Add release notes for Samba 4.23.0rc4.
Jule Anger [Fri, 5 Sep 2025 11:03:05 +0000 (13:03 +0200)] 
WHATSNEW: Add release notes for Samba 4.23.0rc4.

Signed-off-by: Jule Anger <janger@samba.org>
4 weeks agos3:net: fix "net ads group"
MikeLiu [Fri, 29 Aug 2025 09:31:36 +0000 (17:31 +0800)] 
s3:net: fix "net ads group"

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

Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep  4 09:33:27 UTC 2025 on atb-devel-224

(cherry picked from commit 8738fa1cc42d913e3ab2b54fe1e75ca4da37073f)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Fri Sep  5 09:20:08 UTC 2025 on atb-devel-224

4 weeks agokrb5: handle GSS-Proxy credentials lifetime
Alexander Bokovoy [Tue, 2 Sep 2025 07:36:11 +0000 (10:36 +0300)] 
krb5: handle GSS-Proxy credentials lifetime

GSS-Proxy stores its credential in encrypted form in the Kerberos ccache
with a start and end time of 0 and a server principal in the realm named
'X-GSSPROXY:'. This credential is accessed through GSS-Proxy interposer
mechanism in MIT Kerberos and cannot be analysed with raw krb5 API.

As MIT Kerberos has no krb5_cc_get_lifetime() implementation, add check
for the GSS-Proxy credential to smb_krb5_cc_get_lifetime() wrapper to
return KRB5_PLUGIN_NO_HANDLE. The two places where
smb_krb5_cc_get_lifetime() is used then handle this return code to avoid
deciding on the 'expired' lifetime to cause a kinit.

This fixes FreeIPA use case where an IPA API endpoint uses Samba Python
bindings with a GSS-Proxy-controlled credential cache.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Sep  3 10:15:50 UTC 2025 on atb-devel-224

(cherry picked from commit c00b98ad840706cda222bb610d0d4860b98c72d4)

5 weeks agoVERSION: Bump version up to Samba 4.23.0rc4...
Jule Anger [Fri, 29 Aug 2025 12:09:05 +0000 (14:09 +0200)] 
VERSION: Bump version up to Samba 4.23.0rc4...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
5 weeks agoVERSION: Disable GIT_SNAPSHOT for the 4.23.0rc3 release. samba-4.23.0rc3
Jule Anger [Fri, 29 Aug 2025 12:08:48 +0000 (14:08 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.23.0rc3 release.

Signed-off-by: Jule Anger <janger@samba.org>
5 weeks agoWHATSNEW: Add release notes for Samba 4.23.0rc3.
Jule Anger [Fri, 29 Aug 2025 12:07:49 +0000 (14:07 +0200)] 
WHATSNEW: Add release notes for Samba 4.23.0rc3.

Signed-off-by: Jule Anger <janger@samba.org>
5 weeks agoWHATSNEW: unify format
Jule Anger [Thu, 28 Aug 2025 08:26:05 +0000 (10:26 +0200)] 
WHATSNEW: unify format

Signed-off-by: Jule Anger <janger@samba.org>
Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Thu Aug 28 10:39:47 UTC 2025 on atb-devel-224

5 weeks agoWHATSNEW: add Initial version of smb_prometheus_endpoint
Jule Anger [Thu, 28 Aug 2025 08:22:49 +0000 (10:22 +0200)] 
WHATSNEW: add Initial version of smb_prometheus_endpoint

Signed-off-by: Ralph Boehme <slow@samba.org>
5 weeks agoWHATSNEW: add Modern write time update logic
Jule Anger [Thu, 28 Aug 2025 08:21:49 +0000 (10:21 +0200)] 
WHATSNEW: add Modern write time update logic

Signed-off-by: Ralph Boehme <slow@samba.org>
5 weeks agoWHATSNEW: add SMB3 Unix Extensions
Jule Anger [Thu, 28 Aug 2025 08:20:32 +0000 (10:20 +0200)] 
WHATSNEW: add SMB3 Unix Extensions

Signed-off-by: Ralph Boehme <slow@samba.org>
5 weeks agoWHATSNEW: add support for SMB3 over QUIC
Jule Anger [Thu, 28 Aug 2025 08:18:01 +0000 (10:18 +0200)] 
WHATSNEW: add support for SMB3 over QUIC

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 weeks agos4:lib/tls: add additional dns hostnames as GNUTLS_SAN_DNSNAME for self-signed certif...
Stefan Metzmacher [Tue, 26 Aug 2025 13:22:10 +0000 (15:22 +0200)] 
s4:lib/tls: add additional dns hostnames as GNUTLS_SAN_DNSNAME for self-signed certificates

It's better to include X509v3 Subject Alternative Name with
DNS names also for additional dns hostnames.

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

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): Tue Aug 26 22:00:26 UTC 2025 on atb-devel-224

(cherry picked from commit 499656a05011a462b2e44faea7318a02c847de5e)

5 weeks agos4:lib/tls: set GNUTLS_SAN_DNSNAME for self-signed certificates
Stefan Metzmacher [Tue, 26 Aug 2025 09:55:40 +0000 (11:55 +0200)] 
s4:lib/tls: set GNUTLS_SAN_DNSNAME for self-signed certificates

It's better to include X509v3 Subject Alternative Name with
DNS names in the self-signed certificate...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 49e179963f56e749dac4e20284dc567e382ccdb2)

5 weeks agos4:lib/tls: let tstream_tls_params_server_lpcfg() use lpcfg_dns_hostname() internally
Stefan Metzmacher [Tue, 26 Aug 2025 09:22:43 +0000 (11:22 +0200)] 
s4:lib/tls: let tstream_tls_params_server_lpcfg() use lpcfg_dns_hostname() internally

This is simpler and the next step will also make use of
lpcfg_additional_dns_hostnames() too...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 6116bc64961fb2330df5ff4256b4ef75dca08cf0)

5 weeks agoauth:creds: Update the documentation for set_principal and set_realm
Andreas Schneider [Wed, 6 Aug 2025 05:54:52 +0000 (07:54 +0200)] 
auth:creds: Update the documentation for set_principal and set_realm

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Mon Aug 25 12:08:22 UTC 2025 on atb-devel-224

(cherry picked from commit 7a19fde92605a3a3699998fb226e3e787de0b5ca)

5 weeks agoauth:creds: Make sure to uppercase the realm of a principal
Andreas Schneider [Wed, 6 Aug 2025 14:33:21 +0000 (16:33 +0200)] 
auth:creds: Make sure to uppercase the realm of a principal

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 5879410caf9303a378f3d90365e60928a735e65a)

5 weeks agoauth:creds: Validate realm names in set_realm and set_principal
Andreas Schneider [Tue, 5 Aug 2025 13:25:54 +0000 (15:25 +0200)] 
auth:creds: Validate realm names in set_realm and set_principal

See also
https://web.mit.edu/kerberos/krb5-latest/doc/admin/realm_config.html#realm-name

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit e848671f34f969634d55eb7b846d70e6334034ae)

5 weeks agos3:utils: Keep password secret in ntlm_auth get_password()
Andreas Schneider [Thu, 7 Aug 2025 11:48:26 +0000 (13:48 +0200)] 
s3:utils: Keep password secret in ntlm_auth get_password()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit f86739e3abd63ba0b7ba632d796968fec9fa2f8f)

5 weeks agoauth:creds: Keep password secret in cmdline_get_userpassword()
Andreas Schneider [Thu, 7 Aug 2025 11:48:04 +0000 (13:48 +0200)] 
auth:creds: Keep password secret in cmdline_get_userpassword()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 34482f4ad014a09c84b484097a8d03dfec4f6512)

5 weeks agoauth:creds: Keep the password secret
Andreas Schneider [Thu, 7 Aug 2025 11:45:48 +0000 (13:45 +0200)] 
auth:creds: Keep the password secret

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 705db6c8b295f65f40b7dcd0d5dc0f6db901c8d7)

5 weeks agoauth:creds: Allow to reset the principal by passing NULL to set_principal
Andreas Schneider [Wed, 6 Aug 2025 12:42:51 +0000 (14:42 +0200)] 
auth:creds: Allow to reset the principal by passing NULL to set_principal

We do that e.g. in cli_credentials_set_anonymous()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 67c2feba290764c62ab01602d5bc9d4d122c2c12)

5 weeks agoauth:creds: Also uppercase realm set via a callback
Andreas Schneider [Thu, 7 Aug 2025 11:32:47 +0000 (13:32 +0200)] 
auth:creds: Also uppercase realm set via a callback

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 4f8ff3a567d6318c71b0960345592224721c9594)

5 weeks agoauth:creds: Allow to reset the realm by passing NULL
Andreas Schneider [Wed, 6 Aug 2025 12:40:34 +0000 (14:40 +0200)] 
auth:creds: Allow to reset the realm by passing NULL

This is e.g. done by cli_credentials_set_anonymous().

We can't call TALLOC_FREE(cred->realm), as this would break
cli_credentials_shallow_copy().

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit e5608cdb2e5a7ef2641ec0e7b0ce0b4640a02ce1)

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

(cherry picked from commit 0be53d7ac0a39d6a48c6c5e2144f342c0d406781)

5 weeks 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>
(cherry picked from commit 43ee86c0c757e95712ed52bd336d2085485498ba)

5 weeks 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>
(cherry picked from commit 5f7b31927733b0ff3e1207be242f1ddb2cb699bd)

5 weeks 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>
(cherry picked from commit 698a0195f72a091e9ed6b0448160c79e37761840)

5 weeks 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>
(cherry picked from commit 2e88ba4b4de146327c19682d59bbe34d68158bf7)

5 weeks 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>
(cherry picked from commit 2cb2991ccdd5d4f63e4c5b3ccc4454a6b39d6afe)

6 weeks agoVERSION: Bump version up to Samba 4.23.0rc3...
Jule Anger [Fri, 22 Aug 2025 15:31:25 +0000 (17:31 +0200)] 
VERSION: Bump version up to Samba 4.23.0rc3...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
6 weeks agoVERSION: Disable GIT_SNAPSHOT for the 4.23.0rc2 release. samba-4.23.0rc2
Jule Anger [Fri, 22 Aug 2025 15:30:46 +0000 (17:30 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.23.0rc2 release.

Signed-off-by: Jule Anger <janger@samba.org>
6 weeks agoWHATSNEW: Add release notes for Samba 4.23.0rc2.
Jule Anger [Fri, 22 Aug 2025 15:30:02 +0000 (17:30 +0200)] 
WHATSNEW: Add release notes for Samba 4.23.0rc2.

Signed-off-by: Jule Anger <janger@samba.org>
6 weeks agoWHATSNEW: samba-tool domain backup --no-secrets changes
Douglas Bagnall [Wed, 20 Aug 2025 00:18:53 +0000 (12:18 +1200)] 
WHATSNEW: samba-tool domain backup --no-secrets changes

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 weeks agothird_party:quic_ko_wrapper Fix compilation with clang-20
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.

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

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

(cherry picked from commit 26065e1f1ee111f5ddfb64782638492af65aeb95)

Autobuild-User(v4-23-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-23-test): Fri Aug 22 13:11:45 UTC 2025 on atb-devel-224

6 weeks 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);
      |                                          ^~~

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit de7932ea8d12348208f50f7b050b826d236ea597)

6 weeks 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>
(cherry picked from commit 149933854f39b4628b14abc5dcd57e73e2a0a637)

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

(cherry picked from commit 85dd55a5fef0049660126bdcd48abfa1c48da259)

6 weeks 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>
(cherry picked from commit 6643d1fb3375903e2857e5bff33b39a4562c5a4d)

6 weeks 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>
(cherry picked from commit 4d69ec473b7be763399c9787eda8e659a1582184)

6 weeks 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>
(cherry picked from commit 4e79fe13325385ef4fe37baeec8656c9b332de19)

6 weeks 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>
(cherry picked from commit 9ad2e59a464bb472da2071c61a254547b6497625)

6 weeks 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>
(cherry picked from commit 23f100f67c0586a940e91e9e1e6f42b804401322)

7 weeks agoWHATSNEW: add Per-share profiling stats
Jule Anger [Wed, 13 Aug 2025 09:01:00 +0000 (11:01 +0200)] 
WHATSNEW: add Per-share profiling stats

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
7 weeks agoWHATSNEW: add CTDB changes
Jule Anger [Mon, 11 Aug 2025 06:52:10 +0000 (08:52 +0200)] 
WHATSNEW: add CTDB changes

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
8 weeks agoVERSION: Bump version up to Samba 4.23.0rc2...
Jule Anger [Thu, 7 Aug 2025 15:03:47 +0000 (17:03 +0200)] 
VERSION: Bump version up to Samba 4.23.0rc2...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 weeks agoVERSION: Disable GIT_SNAPSHOT for the Samba 4.23.0rc1 release. samba-4.23.0rc1
Jule Anger [Thu, 7 Aug 2025 11:33:08 +0000 (13:33 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the Samba 4.23.0rc1 release.

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 weeks agoWHATSNEW: Up to Samba 4.23.0rc1.
Jule Anger [Thu, 7 Aug 2025 11:32:00 +0000 (13:32 +0200)] 
WHATSNEW: Up to Samba 4.23.0rc1.

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 weeks agoWHATSNEW: add smb.conf changes and titles for new features
Jule Anger [Thu, 7 Aug 2025 12:25:15 +0000 (14:25 +0200)] 
WHATSNEW: add smb.conf changes and titles for new features

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 weeks agotevent: version 0.17.1 tevent-0.17.1
Jule Anger [Thu, 7 Aug 2025 10:01:59 +0000 (12:01 +0200)] 
tevent: version 0.17.1

* Coverity checks:
    Fix 1649525 Use of 32-bit time_t
    Fix Coverity ID 1649524 Dereference before null check
    Fix Coverity ID 1649526 Dereference before null check

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 weeks agotdb: version 1.4.14 tdb-1.4.14
Jule Anger [Thu, 7 Aug 2025 10:01:48 +0000 (12:01 +0200)] 
tdb: version 1.4.14

* let tdbtool return error on failure (BUG 15890)

Signed-off-by: Jule Anger <janger@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 weeks agos3:passdb: Fix CIDs 1596750,1596751 uninitialized pointer read
Michael Adam [Wed, 6 Aug 2025 09:27:48 +0000 (11:27 +0200)] 
s3:passdb: Fix CIDs 1596750,1596751 uninitialized pointer read

This fixes two coverity issues of type

CID 1596750 - uninitialized pointer read
CID 1596751 - uninitialized pointer read

 It fixes one occurrence in each of
pdb_samba_dsdb_create_user and pdb_samba_dsdb_create_alias

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Aug  7 11:20:25 UTC 2025 on atb-devel-224

8 weeks agolibcli/security: use talloc_free at the end of sub-tests
Rabinarayan Panigrahi [Sun, 3 Aug 2025 14:44:17 +0000 (20:14 +0530)] 
libcli/security: use talloc_free at the end of sub-tests

Memory should be free by talloc_free() if it is allocated using talloc_new()

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Aug  7 09:02:29 UTC 2025 on atb-devel-224

8 weeks agoctdb: Fix a stuck cluster lock holder after a delayed leader bcast
Volker Lendecke [Wed, 6 Aug 2025 13:28:29 +0000 (15:28 +0200)] 
ctdb: Fix a stuck cluster lock holder after a delayed leader bcast

If a delayed broadcast by a previous cluster lock holder arrives, the
new legitimate leader will accept this without questioning in
leader_handler(). Without this patch rec->leader will never be
overwritten, and because rec->pnn != rec->leader we'll also never send
out fresh leader broadcasts. And because we hold the cluster lock,
nobody else can step up.

Fix this in the next round of leader broadcast timeout.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15892
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Aug  7 02:59:20 UTC 2025 on atb-devel-224

8 weeks agolibrpc:ndr:keycredlink don't require that kmi be a talloc_context
Gary Lockyer [Wed, 6 Aug 2025 01:03:30 +0000 (13:03 +1200)] 
librpc:ndr:keycredlink don't require that kmi be a talloc_context

This prevents fuzzing of ndr_pull_KeyMaterialInternal which we want. So instead
allocate against the ndr talloc context, then the callers can talloc_steal,
memcpy the data as appropriate.

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

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

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  6 05:10:43 UTC 2025 on atb-devel-224

2 months agos4:kdc:db-glue talloc steal pub_key data
Gary Lockyer [Wed, 6 Aug 2025 01:00:32 +0000 (13:00 +1200)] 
s4:kdc:db-glue talloc steal pub_key data

talloc_steal the data pointers of pub_key, modulus and exponent onto pub_key.
To allow fuzz testing of ndr_pull_KeyMaterialInternal the KeyMaterialInternal
struct may not be a talloc_context.  So the data portions will be allocated on
the ndr context.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agolibrpc:ndr:keycredlink clean up includes
Gary Lockyer [Wed, 6 Aug 2025 00:58:45 +0000 (12:58 +1200)] 
librpc:ndr:keycredlink clean up includes

Remove redundant and unused includes from librpc/ndr/ndr_keycredlink.c

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agodocs: document serverid command
Ralph Boehme [Fri, 11 Jul 2025 12:29:38 +0000 (14:29 +0200)] 
docs: document serverid command

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug  5 16:03:56 UTC 2025 on atb-devel-224

2 months agonet: add `net tdb smbXsrv wipedbs` alias for `net serverid wipedbs`
Ralph Boehme [Sun, 29 Jun 2025 16:04:41 +0000 (18:04 +0200)] 
net: add `net tdb smbXsrv wipedbs` alias for `net serverid wipedbs`

`net serverid` is imho not the right place for the wipedbs functionality. Add
it as an alias to `net tdb`. It works pretty opaque and unless you run

 # net tdb smbXsrv wipedbs --help
 Usage:
 net serverid wipedbs [--test] [--verbose]
 Example:
 net serverid wipedbs -v

the use won't notice it is an alias.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agonet: handle replay records in `net serverid wipedbs`
Ralph Boehme [Sat, 26 Jul 2025 13:27:41 +0000 (15:27 +0200)] 
net: handle replay records in `net serverid wipedbs`

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: return replay-cache records in smbXsrv_open_global_traverse()
Ralph Boehme [Fri, 11 Jul 2025 04:30:15 +0000 (06:30 +0200)] 
smbd: return replay-cache records in smbXsrv_open_global_traverse()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: reformat smbXsrv_open_global_traverse() function pointer args
Ralph Boehme [Tue, 17 Jun 2025 14:13:52 +0000 (16:13 +0200)] 
smbd: reformat smbXsrv_open_global_traverse() function pointer args

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: also delete replay cache record in smbXsrv_open_cleanup()
Ralph Boehme [Tue, 17 Jun 2025 14:59:07 +0000 (16:59 +0200)] 
smbd: also delete replay cache record in smbXsrv_open_cleanup()

Add and use smbXsrv_replay_cleanup() to delete replay cache records. Another
external caller comes later, hence adding this as a public function.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: make create-replay cache disk backed
Ralph Boehme [Sat, 26 Jul 2025 13:05:45 +0000 (15:05 +0200)] 
smbd: make create-replay cache disk backed

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agolibndr: add support for unions to ndr_pull_struct_blob_noalloc() and ndr_push_struct_...
Ralph Boehme [Fri, 11 Jul 2025 04:02:13 +0000 (06:02 +0200)] 
libndr: add support for unions to ndr_pull_struct_blob_noalloc() and ndr_push_struct_into_fixed_blob()

The union switch value is stored by ndr_token_store() which uses talloc to
manage ndr.switch_list. Preallocate a ndr_token array and ndr_token_list on the
stack of size ndr_token_list.fixed_alloc_count and optionally use that in
ndr_token_store().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: implement session check from MS-SMB2 3.3.5.9 Receiving an SMB2 CREATE Request
Ralph Boehme [Thu, 10 Jul 2025 14:48:22 +0000 (16:48 +0200)] 
smbd: implement session check from MS-SMB2 3.3.5.9 Receiving an SMB2 CREATE Request

If the server implements the SMB 3.x dialect family and all of the following conditions are TRUE, the
server MUST look up an Open in GlobalOpenTable where Open.IsReplayEligible is TRUE and
Open.CreateGuid matches the CreateGuid in the SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2
create context and Open.ClientGuid matches the ClientGuid of the connection that received this
request:

...

If an Open is found, the server MUST perform the following:

...

If Open.Session.SessionId is not equal to the current Session.SessionId, the server MUST fail
the request with STATUS_DUPLICATE_OBJECTID.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: Add session_global_id and tcon_global_id to smbXsrv_open_global0
Ralph Boehme [Thu, 10 Jul 2025 11:10:42 +0000 (13:10 +0200)] 
smbd: Add session_global_id and tcon_global_id to smbXsrv_open_global0

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: add smbXsrv_tcon to smbXsrv_open
Ralph Boehme [Fri, 11 Jul 2025 04:49:54 +0000 (06:49 +0200)] 
smbd: add smbXsrv_tcon to smbXsrv_open

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: add smbXsrv_session to smbXsrv_open
Ralph Boehme [Sat, 28 Jun 2025 06:55:25 +0000 (08:55 +0200)] 
smbd: add smbXsrv_session to smbXsrv_open

From "MS-SMB2 3.3.1.10 Per Open":

  Open.Session: A reference to the authenticated session, as specified in section
  3.3.1.8, over which this open was performed. If the open is not attached to a
  session at this time, this value MUST be NULL.

Needed to implement:

  3.3.5.9 Receiving an SMB2 CREATE Request

  If the server implements the SMB 3.x dialect family and all of the following
  conditions are TRUE, the server MUST look up an Open in GlobalOpenTable where
  Open.IsReplayEligible is TRUE and Open.CreateGuid matches the CreateGuid in
  the SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 create context and Open.ClientGuid
  matches the ClientGuid of the connection that received this request:

  ...

  If an Open is found, the server MUST perform the following:

  ..

  If Open.Session.SessionId is not equal to the current Session.SessionId, the
  server MUST fail the request with STATUS_DUPLICATE_OBJECTID.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: add and use smbXsrv_open_replay_cache_key_buf
Ralph Boehme [Sat, 26 Jul 2025 12:49:10 +0000 (14:49 +0200)] 
smbd: add and use smbXsrv_open_replay_cache_key_buf

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: make the replay cache record an index on the global open table
Ralph Boehme [Thu, 10 Jul 2025 14:31:16 +0000 (16:31 +0200)] 
smbd: make the replay cache record an index on the global open table

Store only the open_global record key as is in the replay-cache record, making
it an index into the global open table. Then in the replay code, use the new
function smbXsrv_open_global_lookup() to get at the open records.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: invert logic when handling pending create in smb2srv_open_lookup_replay_cache()
Ralph Boehme [Sat, 12 Jul 2025 06:27:38 +0000 (08:27 +0200)] 
smbd: invert logic when handling pending create in smb2srv_open_lookup_replay_cache()

No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: move create_action to smbXsrv_open_global0
Ralph Boehme [Thu, 10 Jul 2025 13:51:12 +0000 (15:51 +0200)] 
smbd: move create_action to smbXsrv_open_global0

In preperation for making create replay disk backed.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: simplify create-replay
Ralph Boehme [Thu, 10 Jul 2025 13:33:48 +0000 (15:33 +0200)] 
smbd: simplify create-replay

Just check state->open_was_deferred and skip calling
smb2srv_open_lookup_replay_cache() if it is set.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 months agosmbd: move DH2Q context processing to its own function
Ralph Boehme [Thu, 10 Jul 2025 12:38:53 +0000 (14:38 +0200)] 
smbd: move DH2Q context processing to its own function

The DH2Q processing code is getting a bit bloated, move it to it's own
function. This also simplifies a coming change where I'll add an early out.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>