]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
9 months agoVERSION: Disable GIT_SNAPSHOT for the 4.19.9 release. v4-19-stable samba-4.19.9
Jule Anger [Thu, 17 Oct 2024 11:58:18 +0000 (13:58 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.19.9 release.

Signed-off-by: Jule Anger <janger@samba.org>
9 months agoWHATSNEW: Add release notes for Samba 4.19.9.
Jule Anger [Thu, 17 Oct 2024 11:57:47 +0000 (13:57 +0200)] 
WHATSNEW: Add release notes for Samba 4.19.9.

Signed-off-by: Jule Anger <janger@samba.org>
9 months agoBUG 15590 ldb: Release LDB 2.8.2 ldb-2.8.2
Jule Anger [Thu, 17 Oct 2024 11:26:54 +0000 (13:26 +0200)] 
BUG 15590 ldb: Release LDB 2.8.2

* BUG 15590: libldb: performance issue with indexes.

Signed-off-by: Jule Anger <janger@samba.org>
9 months agoldb:kv_index: help static analysers to not worry (CID 1615192)
Douglas Bagnall [Tue, 30 Jul 2024 21:20:50 +0000 (09:20 +1200)] 
ldb:kv_index: help static analysers to not worry (CID 1615192)

The point of this realloc is that we are not using this array, but
keeping it around to remain a node the talloc tree. We'd prefer to
reduce it to nothing.

Coverity rightly spotted that it was reallocing an array of `struct
ldb_val` to an array of `struct ldb_val *`, which has a different size
and all. But it doesn't matter in this case, because we will never use
it.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
(cherry picked from commit e2a74963fb89f5409c236a0fbe4cd070e1a75a43)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Mon Oct  7 15:22:36 UTC 2024 on atb-devel-224

9 months agoldb:kv_index: realloc away old dn list
Douglas Bagnall [Mon, 22 Jul 2024 10:22:15 +0000 (22:22 +1200)] 
ldb:kv_index: realloc away old dn list

We can't just free it, because has the GUID index list as a child, and
these are shared by the new dn list (from the subtransaction we are
committing). But if the dn list is long and the main transaction is
long-lived, we can save a lot of memory by turning this dn list into
an almost empty node in the talloc tree. This returns us to roughly
the situation we had prior to the last commit.

For example, with the repro.sh script on bug 15590 in indexes mode
with 10000 rules, The last 3 commits use this much memory at the end
of an unusually large transaction:

full talloc report on 'struct ldb_context' (total 4012222 bytes in 90058 blocks)
full talloc report on 'struct ldb_context' (total 2405482219 bytes in 90058 blocks)
full talloc report on 'struct ldb_context' (total 4282195 bytes in 90058 blocks)

That is, the last commit increased usage 500 fold, and this commit
brings it back to normal.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 1bf9ede94f0a6b41fb18e880e59a8e390f8c21d3)

9 months agoldb_kv_index: dn_list load sub transaction can re-use keys
Douglas Bagnall [Tue, 25 Jun 2024 23:05:49 +0000 (11:05 +1200)] 
ldb_kv_index: dn_list load sub transaction can re-use keys

We don't want to modify the original list, but we can reuse the keys
if we treat them as immutable and don't free them. That makes it a lot
quicker if there are many keys (i.e. where an index is useful) and may
sub-transactions. In particular, it avoids O(n²) talloc_memdups.

A removed comment that says "We have to free the top level index
memory otherwise we would leak", and this will be addressed in the
next commit.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 5f0198d69843c864f2b98a7c0c6305ad789a68a0)

10 months agos4:lib/messaging: fix interaction between imessaging_reinit and irpc_destructor
Stefan Metzmacher [Tue, 17 Sep 2024 06:29:42 +0000 (08:29 +0200)] 
s4:lib/messaging: fix interaction between imessaging_reinit and irpc_destructor

This was missing in commit 0d096931196524a2d1bf59470bc629dc9231131e.

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

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): Wed Sep 18 19:45:56 UTC 2024 on atb-devel-224

(cherry picked from commit a14320461e3abb56f5dacc90ca73bc1143270394)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Wed Oct  2 15:37:43 UTC 2024 on atb-devel-224

10 months agosmbd: remove just created sharemode entry in the error codepaths
Ralph Boehme [Tue, 9 Apr 2024 12:53:32 +0000 (14:53 +0200)] 
smbd: remove just created sharemode entry in the error codepaths

Without this we leave stale sharemode entries around that can lead to all sorts
of havoc.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Sep 19 19:36:19 UTC 2024 on atb-devel-224

(cherry picked from commit 2ff3b9bc0d254a63a913ff9084de3d794fee27d0)

10 months agosmbd: consolidate DH reconnect failure code
Ralph Boehme [Tue, 9 Apr 2024 12:52:44 +0000 (14:52 +0200)] 
smbd: consolidate DH reconnect failure code

No change in behaviour, except that we now
also call fd_close() if vfs_default_durable_cookie()
failed.

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

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

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

10 months agos3:tests: let test_durable_handle_reconnect.sh run smb2.durable-v2-regressions.durabl...
Stefan Metzmacher [Mon, 26 Aug 2024 12:42:12 +0000 (14:42 +0200)] 
s3:tests: let test_durable_handle_reconnect.sh run smb2.durable-v2-regressions.durable_v2_reconnect_bug15624

This demonstrates the dead lock after a durable reconnect failed
because the stat info changed, the file can't be accessed anymore
as we leak the incomplete share mode entry in a still running
process.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 14875448ca06a3a28800343a3a326f1a66bccec0)

10 months agos4:torture/smb2: add smb2.durable-v2-regressions.durable_v2_reconnect_bug15624
Stefan Metzmacher [Mon, 26 Aug 2024 12:42:02 +0000 (14:42 +0200)] 
s4:torture/smb2: add smb2.durable-v2-regressions.durable_v2_reconnect_bug15624

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit ef4ef04e7f83b1029446ff8b5fc5fdf4ab33edbd)

10 months agovfs_error_inject: add 'error_inject:durable_reconnect = st_ex_nlink'
Stefan Metzmacher [Mon, 26 Aug 2024 12:11:02 +0000 (14:11 +0200)] 
vfs_error_inject: add 'error_inject:durable_reconnect = st_ex_nlink'

This allows to simulate durable reconnect failures because the stat
information of the file changed.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 692ed832dfff61ad1c9b646b5c8d6f85f25efb99)

10 months agosmbd: add option "smbd:debug events" for tevent handling duration threshold warnings
Ralph Boehme [Wed, 20 Mar 2024 13:28:43 +0000 (14:28 +0100)] 
smbd: add option "smbd:debug events" for tevent handling duration threshold warnings

Can be used to enable printing an error message if tevent event handlers ran
longer then three seconds. Also logs a message with a loglevel of 3 if there
were no events at hall.

Enabled by default with 'log level = 10' or
'smbd profiling level = on'...

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

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 90d776cb18395ed804f0ab4fd13ef571fc0ad827)

10 months agosmbd: move trace_state variable behind tv variable
Ralph Boehme [Wed, 20 Mar 2024 13:27:27 +0000 (14:27 +0100)] 
smbd: move trace_state variable behind tv variable

Next commit adds timestamp variables to trace_state that want to be initialized
with the current time, so moving behind tv we can then just reuse tv for that.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 679e12aee2f0c283a6f9b9c6008c549a6ca9633e)

10 months agosmbd: add option "smbd lease break:debug hung procs"
Ralph Boehme [Thu, 4 Apr 2024 17:18:19 +0000 (19:18 +0200)] 
smbd: add option "smbd lease break:debug hung procs"

By enabling this a process sending a lease break message to another process
holding a lease will start watching that process and if that process didn't
process the lease break within 10 seconds (cf server_id_watch_waited()), we log
a kernel stack backtrace of that process.

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

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

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

10 months agosmbd: log share_mode_watch_recv() errors as errors
Ralph Boehme [Fri, 5 Apr 2024 10:15:28 +0000 (12:15 +0200)] 
smbd: log share_mode_watch_recv() errors as errors

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

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

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

10 months agos3/lib: add option "serverid watch:debug script"
Ralph Boehme [Thu, 25 Apr 2024 13:17:08 +0000 (15:17 +0200)] 
s3/lib: add option "serverid watch:debug script"

This takes just PID and NODE:PID on a cluster.

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

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 7add7dbf1aee13b4d9ab70d1a5312c8ff30d9e00)

10 months agos3/lib: add option "serverid watch:debug = yes" to print kernel stack of hanging...
Ralph Boehme [Thu, 4 Apr 2024 10:31:05 +0000 (12:31 +0200)] 
s3/lib: add option "serverid watch:debug = yes" to print kernel stack of hanging process

We only do if sys_have_proc_fds() returns true, so it's most likely
linux...

Enabled by default with log level 10...

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

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 5c57e840527432c4b1a7ec94894939022a9e9622)

10 months agos3/lib: add next helper variable in server_id_watch_*
Ralph Boehme [Thu, 25 Apr 2024 13:24:57 +0000 (15:24 +0200)] 
s3/lib: add next helper variable in server_id_watch_*

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

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

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

11 months agosmb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses
David Disseldorp [Fri, 23 Aug 2024 12:55:58 +0000 (12:55 +0000)] 
smb2_ioctl: fix truncated FSCTL_QUERY_ALLOCATED_RANGES responses

As per MS-FSA 2.1.5.10.22 FSCTL_QUERY_ALLOCATED_RANGES, if response
range entries exceed in_max_output, then we should respond with
STATUS_BUFFER_OVERFLOW and a truncated output buffer.

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

Reported-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Aug 28 08:54:11 UTC 2024 on atb-devel-224

(cherry picked from commit 5e278a52646a48e3671270e5b57ec5b852f9fb4b)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Mon Sep  2 10:02:09 UTC 2024 on atb-devel-224

11 months agos4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation
David Disseldorp [Fri, 23 Aug 2024 13:01:24 +0000 (13:01 +0000)] 
s4:torture/smb2: test FSCTL_QUERY_ALLOCATED_RANGES truncation

FSCTL_QUERY_ALLOCATED_RANGES responses with more than one range should
be truncated to account for a ioctl.smb2.in.max_output_response limit.
Add a test for this.

Flag the new test knownfail; fix in subsequent commit.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
(cherry picked from commit 5cf57f1f539021f1490285516d8cfb2a2ab483e0)

11 months agos3:smbd: fix NULL dereference in case of readlink failure
Shachar Sharon [Thu, 22 Aug 2024 11:44:28 +0000 (14:44 +0300)] 
s3:smbd: fix NULL dereference in case of readlink failure

When VFS readlinkat hook returns with error the following sequence
yields NULL-pointer dereference (SIGSEGV):

  symlink_target_below_conn (source3/smbd/open.c)
    char *target = NULL;
    ...
    readlink_talloc (source3/smbd/files.c)
      SMB_VFS_READLINKAT
        smb_vfs_call_readlinkat (source3/smbd/vfs.c)
          handle->fns->readlinkat_fn --> returns error

  status = safe_symlink_target_path(.., target /* NULL */ ..)
    safe_symlink_target_path (source3/smbd/filename.c)
      if (target[0] == '/') { /* NULL pointer dereference */

A failure in VFS module's readlinkat hook may happen due to run-time
error (e.g., network failure which cases libcephfs to disconnect from
MDS).

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15700
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Aug 23 09:27:06 UTC 2024 on atb-devel-224

(cherry picked from commit 168966a053045476a84044aa73f66722eb702fe0)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Mon Aug 26 10:25:30 UTC 2024 on atb-devel-224

11 months agos3:smb2_server: return NT_STATUS_NETWORK_SESSION_EXPIRED for compound requests
Stefan Metzmacher [Tue, 13 Aug 2024 12:07:06 +0000 (14:07 +0200)] 
s3:smb2_server: return NT_STATUS_NETWORK_SESSION_EXPIRED for compound requests

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 13 22:29:28 UTC 2024 on atb-devel-224

(cherry picked from commit 4df1bfd07012dd3d2d2921281e6d6e309303b88d)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Tue Aug 20 13:02:43 UTC 2024 on atb-devel-224

11 months agos4:torture/smb2: let smb2.session.expire2* also check compound requests
Stefan Metzmacher [Tue, 13 Aug 2024 10:47:59 +0000 (12:47 +0200)] 
s4:torture/smb2: let smb2.session.expire2* also check compound requests

This shows that all compound related requests should get
NT_STATUS_NETWORK_SESSION_EXPIRED.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f6009aa73b9234df1e6ab689de322487ad1394ed)

11 months agoVERSION: Bump version up to Samba 4.19.9...
Jule Anger [Thu, 15 Aug 2024 11:30:34 +0000 (13:30 +0200)] 
VERSION: Bump version up to Samba 4.19.9...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Jule Anger <janger@samba.org>
11 months agoVERSION: Disable GIT_SNAPSHOT for the 4.19.8 release. samba-4.19.8
Jule Anger [Thu, 15 Aug 2024 11:30:18 +0000 (13:30 +0200)] 
VERSION: Disable GIT_SNAPSHOT for the 4.19.8 release.

Signed-off-by: Jule Anger <janger@samba.org>
11 months agoWHATSNEW: Add release notes for Samba 4.19.8.
Jule Anger [Thu, 15 Aug 2024 11:29:22 +0000 (13:29 +0200)] 
WHATSNEW: Add release notes for Samba 4.19.8.

Signed-off-by: Jule Anger <janger@samba.org>
11 months agos3:ntlm_auth: make logs more consistent with length check
Jones Syue [Fri, 5 Jul 2024 09:36:46 +0000 (17:36 +0800)] 
s3:ntlm_auth: make logs more consistent with length check

Run ntlm_auth with options --lm-response/--nt-response/--challenge, and pass
wrong length to these options, got error prompted logs about 'only got xxx
bytes', which are not consistent with length check. This patch revise logs
for length check to make it more consistent.

For example --lm-response requires exact 24 hex, let us input three kinds
of length 23 24 25, prompted logs said 'only got 25 bytes' seems confusing.

script:
for length in 23 24 25; \
do \
    ntlm_auth --username=${un} --password=${pw} \
    --lm-response="`openssl rand -hex ${length}`"; \
done;

output:
hex decode of 04db772593f5e6023d0ab4bc67a942c9179963477eb49d failed! (only got 23 bytes)
NT_STATUS_OK: The operation completed successfully. (0x0)
hex decode of 1e57749feb46bedcf969af6cbbe10e21d0232e35c27eb07294 failed! (only got 25 bytes)

After patch it shows 'got 25 bytes, expected 24' seems more consistent:

hex decode of e13e70c9cf2ac1e20015657c4bec53435b1b948febb63f failed! (got 23 bytes, expected 24)
NT_STATUS_OK: The operation completed successfully. (0x0)
hex decode of 64647005243092b036856f572faad262e0b69386d095d60f54 failed! (got 25 bytes, expected 24)

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

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jul  6 00:52:02 UTC 2024 on atb-devel-224

(cherry picked from commit 90c9d0d98d3c80c77764dbcaf9c24d7c4ea31b4a)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Thu Aug 15 07:56:59 UTC 2024 on atb-devel-224

11 months agowafsamba: Fix ABI symbol name generation
Andreas Schneider [Mon, 5 Aug 2024 12:51:01 +0000 (14:51 +0200)] 
wafsamba: Fix ABI symbol name generation

Commit 0bc5b6f29307ce758774c1b2f48ce62315fdc7f9 changed the script
for generating the ABI symbol version. It broke the ABI by changing all
dots to underscores.

This reverts the commit partially to preserve the dots in the version
part.

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

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Günther Deschner <gd@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Aug  6 00:42:56 UTC 2024 on atb-devel-224

(cherry picked from commit 46215ab1b34aa79c4c831ea1c12f73eacf1e8a12)

Autobuild-User(v4-19-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-19-test): Tue Aug  6 11:44:00 UTC 2024 on atb-devel-224

12 months agolibcli:security: allow spaces after BAD:
Douglas Bagnall [Wed, 24 Jul 2024 05:24:59 +0000 (17:24 +1200)] 
libcli:security: allow spaces after BAD:

In AD_DS_Classes_Windows_Server_v1903.ldf from
https://www.microsoft.com/en-us/download/details.aspx?id=23782, we see

  defaultSecurityDescriptor: O:BAG:BAD: (A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)(A;;RPLCLORC;;;AU)

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Jul 25 06:27:27 UTC 2024 on atb-devel-224

(cherry picked from commit 8903876f65d5721d30186875d391889d1ddcd52c)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Mon Jul 29 13:17:42 UTC 2024 on atb-devel-224

12 months agocmdline:burn: list commands to always burn; warn on unknown
Douglas Bagnall [Fri, 5 Jul 2024 02:31:58 +0000 (14:31 +1200)] 
cmdline:burn: list commands to always burn; warn on unknown

We burn arguments to all unknown options containing "pass" (e.g.
"--passionate=false") in case they are a password option, but is bad
in the case where the unknown option takes no argument but the next
option *is* a password (like "--overpass --password2 barney". In that
case "--password2" would be burnt and not "barney".

The burning behaviour doesn't change with this commit, but users will now
see an error message explaining that the option was unknown. This is not
so much aimed at end users -- for who an invalid option will hopefully
lead to --help like output -- but to developers who add a new "pass"
option.

This also slightly speeds up the processing of known password options,
which is a little bit important because we are in a race to replace the
command line in /proc before an attacker sees it.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul 10 06:28:08 UTC 2024 on atb-devel-224

(cherry picked from commit 86843685419921e28c37f3c1b33011f14940e02f)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Tue Jul 23 08:43:59 UTC 2024 on atb-devel-224

12 months agocmdline: samba-tool test for bad option warning
Douglas Bagnall [Fri, 5 Jul 2024 04:13:04 +0000 (16:13 +1200)] 
cmdline: samba-tool test for bad option warning

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15674
(cherry picked from commit d2b119e34b4e523a3bc6699e4d8a370bf8403d0b)

12 months agocmdline:burn: add a note about short option combinations
Douglas Bagnall [Tue, 2 Jul 2024 23:50:43 +0000 (11:50 +1200)] 
cmdline:burn: add a note about short option combinations

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 97be45f9ea3410392cd37eab5cfafd3ad00cfe57)

12 months agocmdline:burn: explicitly burn --username
Douglas Bagnall [Tue, 2 Jul 2024 23:23:36 +0000 (11:23 +1200)] 
cmdline:burn: explicitly burn --username

This is the long form of -U in samba-tool.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15674
(cherry picked from commit 63a83fb7bb312731047f361f89766e0be492f83e)

12 months agocmdline:burn: use allowlist to ensure more passwords burn
Douglas Bagnall [Sat, 29 Jun 2024 01:44:46 +0000 (13:44 +1200)] 
cmdline:burn: use allowlist to ensure more passwords burn

We treat any option containing 'pass' with suspicion, unless we know it
is OK.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit f1fbba6dc609590854c0d7c5e72b58fabc356695)

12 months agocmdline: test_cmdline tests more burning
Douglas Bagnall [Sat, 29 Jun 2024 01:43:03 +0000 (13:43 +1200)] 
cmdline: test_cmdline tests more burning

We have more secret arguments, like --client-password, --adminpass,
so we are going to use an allowlist for options containing 'pass', but
we don't want to burn the likes of --group=passionfruit.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit c4df89e9640c1306aa390cdacaa974c870c3f5bb)

12 months agocmdline:burn: do not burn options starting --user-*, --password-*
Douglas Bagnall [Fri, 28 Jun 2024 23:30:19 +0000 (11:30 +1200)] 
cmdline:burn: do not burn options starting --user-*, --password-*

We have options that start with --user or --password that we don't
want to burn. Some grepping says:

      2 --user1
      1 --user2
     10 --user-allowed-to-authenticate-from
      6 --user-allowed-to-authenticate-to
      2 --user-allow-ntlm-auth
     25 --user-authentication-policy
      1 --user-config
      4 --user-domgroups
      5 --user-ext-name
      2 --user-groups
      6 --user-info
     27 --username
      1 --username2
      2 --userou
      1 --users
      2 --user-sidinfo
      6 --user-sids
     14 --user-tgt-lifetime-mins
      2 --password2
    118 --password-file
      2 --password-from-stdin
      # from here, grepping for strings around POPT_ constants
      5 "user"
      2 "user1"
      2 "user2"
      1 "userd"
      1 "user-domgroups"
      1 "user-groups"
      1 "user-info"
      2 "username"
      1 "user-sidinfo"
      1 "user-sids"
      1 passwordd
      4 "password"

Not all of these use lib/cmdline, but I think most do, via Python
which defers to cmdline_burn().

Note that there are options we should burn that aren't on this list,
like --adminpass. That's another matter.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 6effed31899a1be8194a851e5a4023276b8a5f38)

12 months agocmdline:burn: localise some variables
Douglas Bagnall [Thu, 27 Jun 2024 04:33:16 +0000 (16:33 +1200)] 
cmdline:burn: localise some variables

As this function increases in complexity, it helps to keep things close.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit f5233ddf974f9649d8a12b151b6843412eab489c)

12 months agocmdline:burn: always return true if burnt
Douglas Bagnall [Thu, 27 Jun 2024 04:03:30 +0000 (16:03 +1200)] 
cmdline:burn: always return true if burnt

Before we have been trying to cram three cases into a boolean return
value:

 * cmdline had secrets, we burnt them       ->  true
 * cmdline had no secrets, all good         ->  false
 * cmdline has NULL string, WTF! emergency! ->  false

This return value is only used by Python which wants to know whether to
go to the trouble of replacing the command line. If samba_cmdline_burn()
returns false, no action is taken.

If samba_cmdline_burn() burns a password and then hits a NULL, it would
be better not to do nothing. It would be better to crash. And that is
what Python will end up doing, by some talloc returning NULL triggering
a MemoryError.

What about the case like {"--foo", NULL, "-Ua%b"} where the secret comes
after the NULL? That will still be ignored by Python, as it is by all C
tools, but we are hoping that can't happen anyway.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit d3d8dffc0212662456a6251baee5afd432160fa2)

12 months agocmdline:burn: handle arguments separated from their --options
Douglas Bagnall [Thu, 27 Jun 2024 03:40:16 +0000 (15:40 +1200)] 
cmdline:burn: handle arguments separated from their --options

We weren't treating "--password secret" the same as "--password=secret",
which sometimes led to secrets not being redacted.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 53a1184525279741e116350a9b53da15cb2f41d0)

12 months agocmdline:burn: do not retain false memories
Douglas Bagnall [Thu, 27 Jun 2024 03:20:27 +0000 (15:20 +1200)] 
cmdline:burn: do not retain false memories

If argv contains a secret option without an '=' (or in the case of
"-U", the username is separated by space), we will get to the
`if (strlen(p) == ulen) { continue; }` without resetting the found
and is_user variables. This *sometimes* has the right effect, because
the next string in argv ought to contain the secret.

But in a case like {"--password", "1234567890"}, where the secret
string is the same length as the option, we *again* take that branch
and the password is not redacted, though the argument after it will be
unless it is also of the same length.

If we always set the flags at the start we avoid this. This makes
things worse in the short term for secrets that are not the same
length as their options, but we'll get to that in another commit soon.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 2f6020cf3dadf484251701040e09a10fba2f644e)

12 months agocmdline:tests: extend cmdline_burn tests
Douglas Bagnall [Thu, 27 Jun 2024 03:05:03 +0000 (15:05 +1200)] 
cmdline:tests: extend cmdline_burn tests

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 05128a1f5f17c55a8d8da42c6c52c4235adf36d4)

12 months agoselftest: run the cmdline tests that we already have
Douglas Bagnall [Thu, 27 Jun 2024 05:04:47 +0000 (17:04 +1200)] 
selftest: run the cmdline tests that we already have

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit f17a2b1b25f2ffa5e3caeb8f81101e66b843cc29)

[jsutton@samba.org Fixed conflict in selftest/tests.py]

12 months agocmdline:burn: '-U' does not imply secrets without '%'
Douglas Bagnall [Thu, 20 Jun 2024 21:21:43 +0000 (09:21 +1200)] 
cmdline:burn: '-U' does not imply secrets without '%'

We return true from this function when a secret has been erased,
and were accidentally treating  as if it had secrets.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit f3b240da5c209a51fa43de23e8ecfea2f32bbfd5)

12 months agodocs-xml:manpages: allow for longer version strings
Douglas Bagnall [Thu, 20 Jun 2024 23:29:36 +0000 (11:29 +1200)] 
docs-xml:manpages: allow for longer version strings

The default value (30) truncates "Samba 4.21.0pre1-DEVELOPERBUILD" to
"Samba 4.21.0pre1-DEVELOPE" in the bottom left corner of the man page.
("Samba 4.21.0pre1-DEVELOPE" is only 25 bytes long, not 30, but let's
not worry about that).

On narrow terminals (< ~75 columns) this makes it more likely that
the version string will run into the date string.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 7fb38aee129789cce28ddf54bd7234f8c5f57d97)

12 months ago.gitlab-ci-main.yml: Add safe.directory '*'
Pavel Filipenský [Thu, 4 Jul 2024 09:08:03 +0000 (11:08 +0200)] 
.gitlab-ci-main.yml: Add safe.directory '*'

This is to fix the error when pushing to personal gitlab repo:

2024-07-04 08:16:05,460 Running: 'git clone --recursive --shared /builds/pfilipen/samba /builds/samba-testbase/master' in '/builds/pfilipen/samba'
Cloning into '/builds/samba-testbase/master'...
fatal: detected dubious ownership in repository at '/builds/pfilipen/samba/.git'
To add an exception for this directory, call:
git config --global --add safe.directory /builds/pfilipen/samba/.git
fatal: Could not read from remote repository.

Instead of adding more and more explicit repositories
we should just allow any, we're in an isolated environment...

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul 10 10:35:00 UTC 2024 on atb-devel-224

(cherry picked from commit 3a21b7d9a4e7e9814d0be8c0ebf72b9821a5dc36)

Autobuild-User(v4-19-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-19-test): Thu Jul 11 13:22:43 UTC 2024 on atb-devel-224

12 months agogitlab-ci: Also add the git directory for pipeline in the main mirror
Andreas Schneider [Wed, 3 Jul 2024 11:05:51 +0000 (13:05 +0200)] 
gitlab-ci: Also add the git directory for pipeline in the main mirror

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jul  4 08:08:49 UTC 2024 on atb-devel-224

(cherry picked from commit 93a3dd48d66786cb8765d3ce84ca9f3ad419ac88)

12 months agothird_party/heimdal: Import lorikeet-heimdal-202407041740 (commit 42ba2a6e5dd1bc14a8b...
Ralph Boehme [Thu, 4 Jul 2024 16:00:52 +0000 (18:00 +0200)] 
third_party/heimdal: Import lorikeet-heimdal-202407041740 (commit 42ba2a6e5dd1bc14a8b5ada8c9b8ace85956f6a0)

Fix clock skew error message and memory cache clock skew recovery

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jul  5 10:02:26 UTC 2024 on atb-devel-224

(cherry picked from commit e4d6a19e49260af22bffd2a417119489719ba364)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Wed Jul 10 13:29:02 UTC 2024 on atb-devel-224

12 months agothird_party: Update socket_wrapper to version 1.4.3
Andreas Schneider [Thu, 13 Jun 2024 05:47:26 +0000 (07:47 +0200)] 
third_party: Update socket_wrapper to version 1.4.3

This fixes issues with bind compiled with jemalloc.

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

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 Jun 13 08:41:39 UTC 2024 on atb-devel-224

(cherry picked from commit 8ae180e1678fc8565b8074d4886f7d3676a0f950)

Autobuild-User(v4-19-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-19-test): Tue Jul  9 14:24:35 UTC 2024 on atb-devel-224

12 months agothird_party: Update uid_wrapper to version 1.3.1
Andreas Schneider [Thu, 13 Jun 2024 05:41:41 +0000 (07:41 +0200)] 
third_party: Update uid_wrapper to version 1.3.1

This fixes issues with bind compiled with jemalloc.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit f88e60644e76c6310088934439f9c0da0f63905f)

12 months agogitlab-ci: Set git safe.directory for devel repo
Andreas Schneider [Fri, 7 Jun 2024 14:20:10 +0000 (16:20 +0200)] 
gitlab-ci: Set git safe.directory for devel repo

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 54fed589cca245c716492bcc78b574c30378b19c)

12 months agobootstrap: Fix building CentOS 8 Stream container images
Andreas Schneider [Mon, 10 Jun 2024 13:28:30 +0000 (15:28 +0200)] 
bootstrap: Fix building CentOS 8 Stream container images

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit f3af6e860800d0f837cdf6c2d16d1cd12feb08df)

12 months agobootstrap: Set git safe.directory
Andreas Schneider [Thu, 6 Jun 2024 14:10:14 +0000 (16:10 +0200)] 
bootstrap: Set git safe.directory

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit d00e9482a50b5a756f4847cde977c40c80e179c5)

12 months agobootstrap: Fix runner tags
Andreas Schneider [Thu, 6 Jun 2024 12:41:02 +0000 (14:41 +0200)] 
bootstrap: Fix runner tags

See https://docs.gitlab.com/ee/ci/runners/hosted_runners/linux.html

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 84fb5cc8451c0af354850f39ae6debf388849ebb)

12 months ago[v4-19-only] selftest: support for MIT krb5 1.21
Stefan Metzmacher [Wed, 3 Jul 2024 07:55:26 +0000 (09:55 +0200)] 
[v4-19-only] selftest: support for MIT krb5 1.21

This copes with the differences between MIT 1.20 and 1.21
during gitlab pipeline selftest.

We need this because Fedora 38 upgraded from 1.20.1 to 1.21.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
12 months agoselftest: Allow MIT Krb5 1.21 to still start to fl2000dc
Andrew Bartlett [Tue, 18 Jul 2023 02:50:55 +0000 (14:50 +1200)] 
selftest: Allow MIT Krb5 1.21 to still start to fl2000dc

This is the simplest way to keep this test environment alive.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
(cherry picked from commit 4ae3e9b208d4badee5765eddd832b258e84665b2)

12 months ago.gitlab-ci: Allow ext4 jobs to run on shared runners
Andrew Bartlett [Tue, 5 Sep 2023 21:37:19 +0000 (09:37 +1200)] 
.gitlab-ci: Allow ext4 jobs to run on shared runners

At the time of this commit, GitLab shared runners
tagged "gce" were 2x AMD EPYC 7B12 with 8GB ram.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 19fb9a97dff2c0222d89a19bc9b0cd27f0306408)

12 months ago.gitlab-ci: make it explicit that some tests require ext4/5.15 kernel
Stefan Metzmacher [Thu, 14 Sep 2023 08:42:55 +0000 (10:42 +0200)] 
.gitlab-ci: make it explicit that some tests require ext4/5.15 kernel

This is better then requiring private runners,
as we'll be able to use shared runners for ext4 soon.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit b1e83b6cede6ad50e417a6cff583a9ab25f8c980)

12 months agoFix starvation of pending writes in CTDB queues
Xavi Hernandez [Thu, 27 Jun 2024 13:41:19 +0000 (15:41 +0200)] 
Fix starvation of pending writes in CTDB queues

CTDB uses a queue to receive requests and send answers. It works
asynchronously using the tevent framework. However there was an issue
that gave priority to the receiving side so, when a request was
processed and the answer posted to the queue, if another incoming
request arrived, it was served before sending the previous answer.

This scenario could repeat for long periods of time if the frequency of
incoming requests was high enough.

Eventually, a small time gap between incoming request gave a chance to
process the pending output queue, sending many answers in a burst.

This patch makes sure that both queues (input and output) are processed
if the event contains the appropriate flag.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15678
RN: Fix unnecessary delays in CTDB while processing requests under high
load.

Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jul  1 09:17:43 UTC 2024 on atb-devel-224

(cherry picked from commit 60550fbe184a5cefa55a8f0bab508f70def7a684)

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Tue Jul  9 08:46:54 UTC 2024 on atb-devel-224

12 months agobuild: --vendor-suffix instead of --vendor-patch-revision --vendor-name
Douglas Bagnall [Thu, 20 Jun 2024 22:40:59 +0000 (10:40 +1200)] 
build: --vendor-suffix instead of --vendor-patch-revision --vendor-name

In practice there isn't a use for two options, and neither quite
matched what people thought they were doing.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 673c8e6ca5994973e4887641c3599707a66a608c)

12 months agobuildtools: sanitise strange characters in vendor strings
Douglas Bagnall [Thu, 20 Jun 2024 22:38:40 +0000 (10:38 +1200)] 
buildtools: sanitise strange characters in vendor strings

There is no reason to think '-' and '+' are the only characters that
might sneak into a vendor string; Debian habitually use '~'.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 0bc5b6f29307ce758774c1b2f48ce62315fdc7f9)

13 months agothird_party/heimdal: Import lorikeet-heimdal-202406240121 (commit 4315286377278234be2...
Jo Sutton [Wed, 12 Jun 2024 02:42:38 +0000 (14:42 +1200)] 
third_party/heimdal: Import lorikeet-heimdal-202406240121 (commit 4315286377278234be2f3b6d52225a17b6116d54)

This lets us match the Windows FAST reply when the password is expired.

Windows clients were upset by the NTSTATUS field in the edata,
apparently interpreting it to mean “insufficient resource”.

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

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(backported from commit fe90576871b5d644b9e888fd7a0b0351feaba750)

[jsutton@samba.org Fixed conflicts in knownfails and
 third_party/heimdal/kdc/fast.c]

Autobuild-User(v4-19-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-19-test): Wed Jul  3 09:56:13 UTC 2024 on atb-devel-224

13 months agotests/krb5: Add tests for errors produced when logging in with unusable accounts
Jo Sutton [Thu, 27 Jun 2024 00:29:52 +0000 (12:29 +1200)] 
tests/krb5: Add tests for errors produced when logging in with unusable accounts

Heimdal matches Windows in the no‐FAST case, but produces NTSTATUS codes
when it shouldn’t in the FAST case.

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

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(backported from commit c5ee0b60b20011aeaa60c2f549c2a78269c97c8f)

[jsutton@samba.org Fixed conflicts in selftest/knownfail_heimdal_kdc]

13 months agotests/krb5: Allow creation of disabled accounts for testing
Jo Sutton [Tue, 25 Jun 2024 00:51:48 +0000 (12:51 +1200)] 
tests/krb5: Allow creation of disabled accounts for testing

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

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(backported from commit 6dc6168719cf232ac2c1d747f10aad9b13300c02)

[jsutton@samba.org Fixed conflicting import statements in
 python/samba/tests/krb5/kdc_base_test.py]

[jsutton@samba.org Fixed conflicting import statements in
 python/samba/tests/krb5/kdc_base_test.py]

13 months agopython/tests/krb5: Prepare for PKINIT tests with UF_SMARTCARD_REQUIRED
Andrew Bartlett [Tue, 19 Mar 2024 01:37:24 +0000 (14:37 +1300)] 
python/tests/krb5: Prepare for PKINIT tests with UF_SMARTCARD_REQUIRED

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(backported from commit b2fe1ea1c6aba116b31a1c803b4e0d36ac1a32ee)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655

[jsutton@samba.org Fixed conflicting import statements in
 python/samba/tests/krb5/pkinit_tests.py]

[jsutton@samba.org Fixed conflicting import statements in
 python/samba/tests/krb5/kdc_base_test.py]

13 months agotests/krb5: Fix PK-INIT test framework to allow expired password keys
Jo Sutton [Thu, 21 Mar 2024 23:58:19 +0000 (12:58 +1300)] 
tests/krb5: Fix PK-INIT test framework to allow expired password keys

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7cc8f455191faacf32efc474c27e99d45ef2e024)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655

13 months agodsdb: Reduce minimum maxPwdAge from 1 day to nil
Andrew Bartlett [Fri, 17 May 2024 02:19:31 +0000 (14:19 +1200)] 
dsdb: Reduce minimum maxPwdAge from 1 day to nil

This allows us to have tests, which pass on Windows, that
use a very short maxPwdAge.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
(cherry picked from commit 3669479f22f2109a64250ffabd1f6453882d29f1)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655

13 months agotests/krb5: Use __slots__ to indicate which attributes are used by classes
Joseph Sutton [Mon, 30 Oct 2023 01:05:17 +0000 (14:05 +1300)] 
tests/krb5: Use __slots__ to indicate which attributes are used by classes

These should help to catch mistaken attempts to set invalid attributes.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2b69e1e7c316e634090aad1d97ecadf8cdf529f3)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655

13 months agotests/krb5: Add method to perform an armored AS‐REQ
Joseph Sutton [Fri, 29 Sep 2023 00:13:01 +0000 (13:13 +1300)] 
tests/krb5: Add method to perform an armored AS‐REQ

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 849ee959845832b206ae315ab5911c623ea61148)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655

13 months agoauth/credentials: don't ignore "client use kerberos" and --use-kerberos for machine...
Stefan Metzmacher [Tue, 18 Jun 2024 18:28:25 +0000 (20:28 +0200)] 
auth/credentials: don't ignore "client use kerberos" and --use-kerberos for machine accounts

We only turn desired into off in the NT4 domain member case.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jun 19 10:17:28 UTC 2024 on atb-devel-224

(cherry picked from commit 5b40cdf6e8885c9db6c5ffa972112f3516e4130a)

13 months agoauth/credentials: add tests for cli_credentials_get_kerberos_state[_obtained]()
Stefan Metzmacher [Tue, 18 Jun 2024 17:02:05 +0000 (19:02 +0200)] 
auth/credentials: add tests for cli_credentials_get_kerberos_state[_obtained]()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit eeb60574b6bf1a5209b85a8af843b93300550ba7)

13 months agoauth/credentials: add cli_credentials_get_kerberos_state_obtained() helper
Stefan Metzmacher [Tue, 18 Jun 2024 16:53:48 +0000 (18:53 +0200)] 
auth/credentials: add cli_credentials_get_kerberos_state_obtained() helper

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit c715ac5e496ddde119212d3b880ff0e68c2da67b)

13 months agotestprogs/blackbox: add test_ldap_token.sh to test "client use kerberos" and --use...
Stefan Metzmacher [Tue, 18 Jun 2024 17:34:30 +0000 (19:34 +0200)] 
testprogs/blackbox: add test_ldap_token.sh to test "client use kerberos" and --use-kerberos

This shows that they are ignored for machine accounts as domain member.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit db2c576f329675e8d66e19c336fe04ccba918b4a)

13 months agotestprogs/blackbox: let test_trust_token.sh check for S-1-18-1 with kerberos
Stefan Metzmacher [Tue, 18 Jun 2024 17:11:09 +0000 (19:11 +0200)] 
testprogs/blackbox: let test_trust_token.sh check for S-1-18-1 with kerberos

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit cda8beea45303a77080c64bb2391d22c59672deb)

13 months agoctdb/docs: Include ceph rados namespace support in man page
Günther Deschner [Fri, 7 Jun 2024 09:10:07 +0000 (14:40 +0530)] 
ctdb/docs: Include ceph rados namespace support in man page

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

Document the new optional argument to specify the namespace to be
associated with RADOS objects in a pool.

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 14 07:42:25 UTC 2024 on atb-devel-224

(cherry picked from commit 35f6c3f3d4a5521e6576fcc0dd7dd3bbcea041b2)

13 months agoctdb/ceph: Add optional namespace support for mutex helper
Günther Deschner [Fri, 7 Jun 2024 09:09:37 +0000 (14:39 +0530)] 
ctdb/ceph: Add optional namespace support for mutex helper

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

RADOS objects within a pool can be associated to a namespace for
logical separation. librados already provides an API to configure
such a namespace with respect to a context. Make use of it as an
optional argument to the helper binary.

Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit d8c52995f68fe088dd2174562faee69ed1c95edd)

13 months agovfs_default: also call vfs_offload_token_ctx_init in vfswrap_offload_write_send
Stefan Metzmacher [Mon, 17 Jun 2024 08:41:53 +0000 (10:41 +0200)] 
vfs_default: also call vfs_offload_token_ctx_init in vfswrap_offload_write_send

If a client for whatever reason calls FSCTL_SRV_COPYCHUNK[_WRITE] without
FSCTL_SRV_REQUEST_RESUME_KEY, we call vfswrap_offload_write_send
before vfswrap_offload_read_send.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jun 17 18:02:27 UTC 2024 on atb-devel-224

(cherry picked from commit 462b74da79c51f9ba6dbd24e603aa904485d5123)

13 months agos4:torture/smb2: add smb2.ioctl.copy_chunk_bug15644
Stefan Metzmacher [Mon, 17 Jun 2024 09:18:07 +0000 (11:18 +0200)] 
s4:torture/smb2: add smb2.ioctl.copy_chunk_bug15644

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
(cherry picked from commit 372476aeb003e9c608cd2c0a78a9c577b57ba8f4)

13 months agoscript/autobuild.py: Add test for --vendor-name and --vendor-patch-revision
Andrew Bartlett [Thu, 30 May 2024 09:13:01 +0000 (21:13 +1200)] 
script/autobuild.py: Add test for --vendor-name and --vendor-patch-revision

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
RN: We have added new options --vendor-name and --vendor-patch-revision arguments
to ./configure to allow distributions and packagers to put their name in the Samba
version string so that when debugging Samba the source of the binary is obvious.

[abartlet@samba.org adapted to 4.20 still having the seperate LDB build system
 from commit 72112d4814eb3872016c1168c477531be835a1f9]

13 months agobuild: Add --vendor-name --vendor-patch-revision options to ./configure
Andrew Bartlett [Wed, 29 May 2024 22:50:12 +0000 (10:50 +1200)] 
build: Add --vendor-name --vendor-patch-revision options to ./configure

These options are for packagers and vendors to set so that when
Samba developers are debugging an issue, we know exactly which
package is in use, and so have an idea if any patches have been
applied.

This is included in the string that a Samba backtrace gives,
as part of the PANIC message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15654
REF: https://lists.samba.org/archive/samba-technical/2024-May/138992.html

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 651fb94c374c7f84405d960a9e0a0fd7fcb285dd)

13 months agos4:nbt_server: simulate nmbd and provide unexpected handling
Stefan Metzmacher [Wed, 14 Feb 2024 11:34:48 +0000 (12:34 +0100)] 
s4:nbt_server: simulate nmbd and provide unexpected handling

This is needed in order to let nbt_getdc() work against
another AD DC and get back a modern response with
DNS based names. Instead of falling back to
the ugly name_status_find() that simulates just
an NETLOGON_SAM_LOGON_RESPONSE_NT40 response.

This way dsgetdcname() can work with just the netbios
domain name given and still return an active directory
response.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 796f33c05a0ca337b675b5d4d127f7c53b22528f)

13 months agos4:libcli/dgram: add nbt_dgram_send_raw() to send raw blobs
Stefan Metzmacher [Wed, 14 Feb 2024 12:49:21 +0000 (13:49 +0100)] 
s4:libcli/dgram: add nbt_dgram_send_raw() to send raw blobs

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit bfb10774b65af65f9c438a5d3e87529b1fcf46a1)

13 months agos4:libcli/dgram: make use of socket_address_copy()
Stefan Metzmacher [Thu, 15 Feb 2024 16:47:45 +0000 (17:47 +0100)] 
s4:libcli/dgram: make use of socket_address_copy()

This avoids talloc_reference...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 77f4f1c7dbaa2bb04d59d908923f6d11fd514da2)

13 months agos4:libcli/dgram: let the generic incoming handler also get unexpected mailslot messages
Stefan Metzmacher [Thu, 15 Feb 2024 15:42:16 +0000 (16:42 +0100)] 
s4:libcli/dgram: let the generic incoming handler also get unexpected mailslot messages

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 11861bcfc3054894bc445e631ae03befb4865db8)

13 months agolibcli/nbt: add nbt_name_send_raw()
Stefan Metzmacher [Thu, 15 Feb 2024 16:47:13 +0000 (17:47 +0100)] 
libcli/nbt: add nbt_name_send_raw()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit cca373b806e01fc57bd5316d3f8a17578b4b6531)

13 months agos3:libsmb/dsgetdcname: use NETLOGON_NT_VERSION_AVOID_NT4EMUL
Stefan Metzmacher [Thu, 15 Feb 2024 16:29:46 +0000 (17:29 +0100)] 
s3:libsmb/dsgetdcname: use NETLOGON_NT_VERSION_AVOID_NT4EMUL

In 2024 we always want an active directory response...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2b66663c75cdb3bc1b6bc5b1736dd9d35b094b42)

13 months agos3:libsmb/unexpected: pass nmbd_socket_dir from the callers of nb_packet_{server_crea...
Stefan Metzmacher [Wed, 14 Feb 2024 10:38:19 +0000 (11:38 +0100)] 
s3:libsmb/unexpected: pass nmbd_socket_dir from the callers of nb_packet_{server_create,reader_send}()

This will allow source4/nbt_server to make use of
nb_packet_server_create().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 696505a1efbcc9803a287d8c267fed9d04bf8885)

13 months agos3:libsmb/unexpected: don't use talloc_tos() in async code
Stefan Metzmacher [Wed, 14 Feb 2024 12:49:43 +0000 (13:49 +0100)] 
s3:libsmb/unexpected: don't use talloc_tos() in async code

It's not needed and it requires the caller to setup a
stackframe...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f90cf0822d6e66426d72f92bd585119066e2a9c3)

13 months agos3:wscript: LIBNMB requires lp_ functions
Stefan Metzmacher [Thu, 15 Feb 2024 15:37:34 +0000 (16:37 +0100)] 
s3:wscript: LIBNMB requires lp_ functions

We need to make this explicit in order to let LIBNMB be used
in source4 code.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 011f68ae5ddc3fae8b453744aeb95766d885915e)

13 months agos3:include: split out fstring.h
Stefan Metzmacher [Thu, 15 Feb 2024 15:53:29 +0000 (16:53 +0100)] 
s3:include: split out fstring.h

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 105247c90007474947e2314b63be72fb21f09811)

13 months agos3:include: let nameserv.h be useable on its own
Stefan Metzmacher [Wed, 14 Feb 2024 13:15:47 +0000 (14:15 +0100)] 
s3:include: let nameserv.h be useable on its own

A lot of stuff is private to nmbd and can
be moved from nameserv.h.

This allows move required types from smb.h to
nameserv.h, so that this can be standalone.
Including it from smb.h is not a huge problem
as nmbd internals are gone from nameserv.h.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7f96c21029e3b94d38bd871c79cabf872ad77fae)

13 months agos3/smbd: fix nested chdir into msdfs links on (widelinks = yes) share
Noel Power [Fri, 7 Jun 2024 18:35:47 +0000 (19:35 +0100)] 
s3/smbd: fix nested chdir into msdfs links on (widelinks = yes) share

This patch also removes known fail for existing test

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 11 19:31:40 UTC 2024 on atb-devel-224

(cherry picked from commit 788ef8f07c75d5e6eca5b8f18d93d96f31574267)
[noel.power@suse.com backported to Samba 4.19 changed test of errno
    after return from widelink_openat to ENOENT because ELOOP isn't set
    for msdfs links in 4.19, ENOENT is set instead. Also minor change
    to use 4.19 create_open_symlink_err fn instead of read_symlink_reparse]

13 months agoselftest: Add a python blackbox test for some misc (widelink) DFS tests
Noel Power [Tue, 11 Jun 2024 10:19:50 +0000 (11:19 +0100)] 
selftest: Add a python blackbox test for some misc (widelink) DFS tests

On master attempting to chdir into a nested dfs link

e.g. cd dfslink (works)
     cd dfslink/another_dfslink (fails)

[1] Add a test for this scenario (nested chdir)
[2] Add test for enumerating a dfs link in root of dfs share
[3] Add a test to check case insensitive chdir into dfs link on widelink
  enabled share

Add knownfails for tests 1 and 3

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15435
(cherry picked from commit 7f1de90f72d6e8287aec6ab1d9f7776b7df624e5)

[noel.power@suse.com backported to Samba 4.19 changed knownfails because
  test_ci_chdir doen't fail in 4.19 but test_enumerate_dfs_link does]

13 months agos4:dns_server: no-op dns updates with ACCESS_DENIED should be ignored
Stefan Metzmacher [Thu, 30 May 2024 12:52:22 +0000 (14:52 +0200)] 
s4:dns_server: no-op dns updates with ACCESS_DENIED should be ignored

If the client does not have permissions to update the record,
but the record already has the data the update tries to apply,
it's a no-op that should result in success instead of failing.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun  6 03:18:16 UTC 2024 on atb-devel-224

(cherry picked from commit ed61c57e02309b738e73fb12877a0a565b627724)

13 months agos4:dns_server: correctly sign dns update responses with gss-tsig like Windows
Stefan Metzmacher [Thu, 30 May 2024 12:39:28 +0000 (14:39 +0200)] 
s4:dns_server: correctly sign dns update responses with gss-tsig like Windows

This means we no longer generate strange errors/warnings
in the Windows event log nor in the nsupdate -g output.

Note: this is a only difference between gss-tsig and
the legacy gss.microsoft.com algorithms.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 76fec2668e73b9d15447abee551d5c04148aaf27)

13 months agos4:dns_server: dns_verify_tsig should return REFUSED on error
Stefan Metzmacher [Thu, 30 May 2024 12:42:53 +0000 (14:42 +0200)] 
s4:dns_server: dns_verify_tsig should return REFUSED on error

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit db350bc573b378fb0615bdd8592cc9c62f6db146)

13 months agos4:dns_server: also search DNS_QTYPE_TKEY in the answers section if it's the last...
Stefan Metzmacher [Thu, 30 May 2024 12:41:21 +0000 (14:41 +0200)] 
s4:dns_server: also search DNS_QTYPE_TKEY in the answers section if it's the last section

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5906ed94f2c5c68e83c63e7c201534eeb323cfe7)

13 months agos4:dns_server: use tkey->algorithm if available in dns_sign_tsig()
Stefan Metzmacher [Fri, 31 May 2024 06:38:24 +0000 (08:38 +0200)] 
s4:dns_server: use tkey->algorithm if available in dns_sign_tsig()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ae7538af04435658d2ba6dcab109beecb6c5f13e)

13 months agos4:dns_server: use the client provided algorithm for the fake TSIG structure
Stefan Metzmacher [Fri, 31 May 2024 06:38:24 +0000 (08:38 +0200)] 
s4:dns_server: use the client provided algorithm for the fake TSIG structure

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit bd0235cd515d5602ed9501bfc810a2487364ea10)

13 months agos4:dns_server: only allow gss-tsig and gss.microsoft.com for TSIG
Stefan Metzmacher [Fri, 31 May 2024 06:38:24 +0000 (08:38 +0200)] 
s4:dns_server: only allow gss-tsig and gss.microsoft.com for TSIG

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3467d1491490830d61d16cb6278051daf48466fc)