]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
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

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

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

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

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>
13 months agogitlab-ci: Update image to Fedora 40
Andreas Schneider [Tue, 30 Apr 2024 09:30:48 +0000 (11:30 +0200)] 
gitlab-ci: Update image to Fedora 40

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 13:29:48 UTC 2024 on atb-devel-224

13 months agogitlab-ci: Add CentOS 9 Stream
Andreas Schneider [Fri, 7 Jun 2024 12:16:28 +0000 (14:16 +0200)] 
gitlab-ci: Add CentOS 9 Stream

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agogitlab-ci: Remove CentOS7 which is EOL
Andreas Schneider [Fri, 7 Jun 2024 12:09:43 +0000 (14:09 +0200)] 
gitlab-ci: Remove CentOS7 which is EOL

See
https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agoselftest: Set NSS_WRAPPER_HOSTS for smbclient
Andreas Schneider [Thu, 6 Jun 2024 09:51:53 +0000 (11:51 +0200)] 
selftest: Set NSS_WRAPPER_HOSTS for smbclient

This is calling getaddrinfo()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agoselftest: Create the cmd outside of the loop
Andreas Schneider [Thu, 6 Jun 2024 09:51:24 +0000 (11:51 +0200)] 
selftest: Create the cmd outside of the loop

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agos4:torture: Add missing NULL checks in spoolss.c
Andreas Schneider [Tue, 30 Apr 2024 15:31:00 +0000 (17:31 +0200)] 
s4:torture: Add missing NULL checks in spoolss.c

source4/torture/rpc/spoolss.c: In function
  ‘check_printer_driver_file.isra’:
source4/torture/rpc/spoolss.c:10850:58: error: ‘%s’ directive argument
  is null [-Werror=format-overflow=]
10850 |         const char *remote_name = talloc_asprintf(tctx, "%s\\%d\\%s",
      |                                                          ^~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agolib:util: Fix size of tmp array
Andreas Schneider [Tue, 30 Apr 2024 11:01:20 +0000 (13:01 +0200)] 
lib:util: Fix size of tmp array

lib/util/util.c: In function ‘dump_data_block16’:
lib/util/util.c:503:40: error: ‘%04zX’ directive output may be truncated
writing between 4 and 16 bytes into a region of size 15
[-Werror=format-truncation=]
  503 |         snprintf(tmp, sizeof(tmp), "%s[%04zX]", prefix, idx);
      |                                        ^~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 months agolib:util: Remove tailing spaces in util.c
Andreas Schneider [Tue, 30 Apr 2024 10:54:48 +0000 (12:54 +0200)] 
lib:util: Remove tailing spaces in util.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 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

13 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>
13 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>
13 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>
13 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>
13 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>
13 months agopython/samba/tests/krb5: Add tests for password expiry with krb5 ENC-TS
Andrew Bartlett [Tue, 11 Jun 2024 22:24:18 +0000 (10:24 +1200)] 
python/samba/tests/krb5: Add tests for password expiry with krb5 ENC-TS

This augments the PKINIT based tests to show this is correctly handled
for the fare more usual case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun 13 00:45:36 UTC 2024 on atb-devel-224

13 months agopython/samba/tests/krb5: Add check to confirm UF_SMARCARD_REQUIRED password is expire...
Andrew Bartlett [Tue, 11 Jun 2024 20:51:54 +0000 (08:51 +1200)] 
python/samba/tests/krb5: Add check to confirm UF_SMARCARD_REQUIRED password is expired on NTLM

8944a10b145e99eb6372cace8225e4c5e9d6160e broke password expiry
checking on NTLM, but that is fixed after CID 1603594 triggered
815d696d4471f1b3a4267eb774eb80b07576031b.  In the past we could
not have password expiry times small enough to test expiry
(unlike "must change now"), but having no test was not good.

As we are already doing the sleep() here, add a test to the
password rotation test.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
13 months agopython: remove string_to_byte_array()
Douglas Bagnall [Wed, 12 Jun 2024 00:16:46 +0000 (12:16 +1200)] 
python: remove string_to_byte_array()

This was a useful function during the Python 2 -> 3 migration, but it
is not used any more. In all the cases it was used, we knew we already
had a bytes object, and this was just an inefficient way of confirming
that.

In cases where we actually want to cast a string into a mutable list
of byte-sized ints, the builtin bytearray() function will do a better
job than this, because it will encode high unicode characters as utf-8
bytes, rather than adding them as out-of-range values in the list.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 12 09:16:39 UTC 2024 on atb-devel-224

13 months agosamba-tool ldapcmp: remove a dodgy unused method
Douglas Bagnall [Tue, 11 Jun 2024 23:42:27 +0000 (11:42 +1200)] 
samba-tool ldapcmp: remove a dodgy unused method

We have bindings for stringifying GUIDs, so I intended to replace this
rather complicated code with that, but it turns out that this method
has been unused since 5d42260eecfd4f26cc82637ce1bc989083c9eb9d in 2013.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopytest: simplify and fix HEXDUMP_FILTER used in hexdumps
Douglas Bagnall [Tue, 11 Jun 2024 23:34:36 +0000 (11:34 +1200)] 
pytest: simplify and fix HEXDUMP_FILTER used in hexdumps

The old test

   x if ((len(repr(chr(x))) == 3) and (x < 127)) else ord('.')

went through some contortions to see if the character was printable, and
it got it slightly wrong. The idea was that `repr(chr(97)` is "'a'",
while `repr(chr(167)` is "'\xa7'", which we can distinguish using the
length. But that miscategorised the backslash character, which is
represented as "'\\'", a string of length 4, so it was show as '.'
instead.

Instead we notice that the characters we want to print in a hexdump
are exactly those between 32 and 126, inclusive.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agosamba-tool domain trust: avoid useless use of string_to_byte_array
Douglas Bagnall [Tue, 11 Jun 2024 23:21:59 +0000 (11:21 +1200)] 
samba-tool domain trust: avoid useless use of string_to_byte_array

`pw.encode('utf-16-le')` is always bytes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopython:lsa_utils: avoid useless use of py2-compat string_to_byte_array
Douglas Bagnall [Tue, 11 Jun 2024 23:21:09 +0000 (11:21 +1200)] 
python:lsa_utils: avoid useless use of py2-compat string_to_byte_array

`pw.encode('utf-16-le')` is always bytes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopython:join: avoid useless use of py2-compat string_to_byte_array
Douglas Bagnall [Tue, 11 Jun 2024 23:19:55 +0000 (11:19 +1200)] 
python:join: avoid useless use of py2-compat string_to_byte_array

This was a workaround for the migration to Python 3, but is now just
extra work for the computer and cognitive load for us.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopy:emulate: remove py2 str/bytes workaround in traffic_packets
Douglas Bagnall [Tue, 11 Jun 2024 23:17:22 +0000 (11:17 +1200)] 
py:emulate: remove py2 str/bytes workaround in traffic_packets

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopy:emulate: remove py2 str/bytes workaround in traffic
Douglas Bagnall [Tue, 11 Jun 2024 23:16:48 +0000 (11:16 +1200)] 
py:emulate: remove py2 str/bytes workaround in traffic

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopytest: remove py2 str/bytes workaround in auth_log_samlogon
Douglas Bagnall [Tue, 11 Jun 2024 23:15:50 +0000 (11:15 +1200)] 
pytest: remove py2 str/bytes workaround in auth_log_samlogon

It is likely not necessary to cast to list() in most cases.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopytest: remove py2 str/bytes workaround in samr_change_password
Douglas Bagnall [Tue, 11 Jun 2024 23:15:23 +0000 (11:15 +1200)] 
pytest: remove py2 str/bytes workaround in samr_change_password

It is likely not necessary to cast to list().

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopytest: remove py2 str/bytes workaround in lsa_utils
Douglas Bagnall [Tue, 11 Jun 2024 23:14:42 +0000 (11:14 +1200)] 
pytest: remove py2 str/bytes workaround in lsa_utils

It is likely not necessary to cast to list() in most cases.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopytest: remove py2 str/bytes workaround in dns_base
Douglas Bagnall [Tue, 11 Jun 2024 23:14:07 +0000 (11:14 +1200)] 
pytest: remove py2 str/bytes workaround in dns_base

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agopytest: remove py2 str/bytes workaround in py_credentials
Douglas Bagnall [Tue, 11 Jun 2024 23:13:24 +0000 (11:13 +1200)] 
pytest: remove py2 str/bytes workaround in py_credentials

It is likely not necessary to cast to list() in most cases.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
13 months agos4/pytest: remove py2 str/bytes workaround in getnc_exop
Douglas Bagnall [Tue, 11 Jun 2024 23:11:27 +0000 (11:11 +1200)] 
s4/pytest: remove py2 str/bytes workaround in getnc_exop

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 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

14 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

14 months agos3: vfs_widelinks: Allow case insensitivity to work on DFS widelinks shares.
Jeremy Allison [Tue, 11 Jun 2024 00:25:32 +0000 (17:25 -0700)] 
s3: vfs_widelinks: Allow case insensitivity to work on DFS widelinks shares.

Remove knownfail.

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

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

14 months agos3/torture: Add test for widelink case insensitivity on a MSDFS share.
Jeremy Allison [Mon, 10 Jun 2024 22:14:19 +0000 (15:14 -0700)] 
s3/torture: Add test for widelink case insensitivity on a MSDFS share.

Add knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
14 months agosamba-tool user readpasswords: avoid `assert` for validation
Douglas Bagnall [Fri, 2 Feb 2024 02:01:21 +0000 (15:01 +1300)] 
samba-tool user readpasswords: avoid `assert` for validation

`assert` can be optimised away if python is run with `-O`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jun 11 05:32:28 UTC 2024 on atb-devel-224

14 months agos4:auth: Handle expired accounts in authsam_account_ok() (CID 1603594)
Jo Sutton [Tue, 11 Jun 2024 02:58:11 +0000 (14:58 +1200)] 
s4:auth: Handle expired accounts in authsam_account_ok() (CID 1603594)

We check the ACB_PW_EXPIRED bit to determine whether the account is
expired. Since ACB_PW_EXPIRED can’t be represented in a 16‐bit integer,
we must increase the width of acct_flags so as not to lose that bit.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos4:dsdb: Remove trailing whitespace
Jo Sutton [Fri, 24 May 2024 01:05:58 +0000 (13:05 +1200)] 
s4:dsdb: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos4:auth: Add temporary memory context to authsam_reread_user_logon_data()
Jo Sutton [Mon, 29 Apr 2024 05:07:43 +0000 (17:07 +1200)] 
s4:auth: Add temporary memory context to authsam_reread_user_logon_data()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos4:auth: Add common out path to authsam_reread_user_logon_data()
Jo Sutton [Mon, 29 Apr 2024 05:09:12 +0000 (17:09 +1200)] 
s4:auth: Add common out path to authsam_reread_user_logon_data()

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agoldb: Attach appropriate ldb context to returned result
Jo Sutton [Wed, 1 May 2024 04:54:01 +0000 (16:54 +1200)] 
ldb: Attach appropriate ldb context to returned result

This is done by adding a new API that avoids the problems of
ldb_dn_copy() and makes it clear that a struct ldb_context *
pointer will be stored in the new copy.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos4/torture: Remove already existing test_dir
Anoop C S [Wed, 29 May 2024 13:22:10 +0000 (18:52 +0530)] 
s4/torture: Remove already existing test_dir

In configurations where vfs_acl_xattr is used with 'ignore system acls'
option we encounter NT_STATUS_ACCESS_DENIED while trying to open an
already existing test_dir in smb2.delete-on-close-perms.READONLY. Due
to missing SEC_STD_DELETE permission from the list of allowed ACEs it
couldn't be removed via previous call to smb2_deltree(). Thus as seen
with other tests we now call set_dir_delete_perms() so that subsequent
attempt to remove it can succeed.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jun 10 13:17:58 UTC 2024 on atb-devel-224

14 months agos4/torture: Create test_dir with SEC_RIGHTS_DIR_ALL
Anoop C S [Wed, 29 May 2024 13:11:32 +0000 (18:41 +0530)] 
s4/torture: Create test_dir with SEC_RIGHTS_DIR_ALL

In shares where acl_xattr vfs module is loaded with 'ignore system acls'
set, smb2.delete-on-close-perms.FIND_and_set_DOC fails to open test_dir
due to NT_STATUS_ACCESS_DENIED as it lacks few permissions for owner
when created using create_dir(). Test case aims to set delete-on-close
for which delete permission is necessary in first place. Therefore we
now perform the creation and subsequent opening of directory using
torture_smb2_testdir() so that the open handle comes with SEC_STD_DELETE
permission.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agopython/samba/tests/krb5: Allow PkInitTests.test_pkinit_ntlm_from_pac_must_change_now...
Andrew Bartlett [Tue, 4 Jun 2024 01:26:18 +0000 (13:26 +1200)] 
python/samba/tests/krb5: Allow PkInitTests.test_pkinit_ntlm_from_pac_must_change_now to pass on Samba/Heimdal

This flexiblity in the tests avoids requiring Samba/Heimdal to omit an NTSTATUS error
return and just be consistent between the different authentication paths.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun 10 05:32:54 UTC 2024 on atb-devel-224

14 months agopython/samba/tests/krb5: Expand test without UF_SMARTCARD_REQUIRED to show rotation...
Andrew Bartlett [Mon, 3 Jun 2024 23:36:53 +0000 (11:36 +1200)] 
python/samba/tests/krb5: Expand test without UF_SMARTCARD_REQUIRED to show rotation is not done

This makes sense as otherwise the user would suddenly not know their password
for use when they do not use their smartcard.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agoWHATSNEW: Mention msDS-ExpirePasswordsOnSmartCardOnlyAccounts behaviour
Andrew Bartlett [Sun, 26 May 2024 23:51:59 +0000 (11:51 +1200)] 
WHATSNEW: Mention msDS-ExpirePasswordsOnSmartCardOnlyAccounts behaviour

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agoprovision: Match Windows 2022 and set msDS-ExpirePasswordsOnSmartCardOnlyAccounts...
Andrew Bartlett [Sun, 26 May 2024 23:30:29 +0000 (11:30 +1200)] 
provision: Match Windows 2022 and set msDS-ExpirePasswordsOnSmartCardOnlyAccounts by default

We do this by telling the Domain Functional Level upgrade code that
this is a new install.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agoselftest: Add test that msDS-ExpirePasswordsOnSmartCardOnlyAccounts=TRUE is set
Andrew Bartlett [Sun, 26 May 2024 23:53:15 +0000 (11:53 +1200)] 
selftest: Add test that msDS-ExpirePasswordsOnSmartCardOnlyAccounts=TRUE is set

This assures us that the new provision sets the value by default.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agokdc: Rotate smart-card only underlying password in 2nd half of lifetime
Andrew Bartlett [Fri, 17 May 2024 05:34:36 +0000 (17:34 +1200)] 
kdc: Rotate smart-card only underlying password in 2nd half of lifetime

This is a measure to avoid multiple servers rotating the password
but means that the maximum password age really must be set to
twice the TGT lifetime, eg a default of 20 hours.  The internet
suggestions of 1 day for this feature should work fine.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agokdc: Track the pwdLastSet of expired UF_SMARTCARD_REQUIRED accounts
Andrew Bartlett [Thu, 9 May 2024 04:24:31 +0000 (16:24 +1200)] 
kdc: Track the pwdLastSet of expired UF_SMARTCARD_REQUIRED accounts

This is to gracefully deal with races and to avoid additional password
rollover in situations where the TGT lifetime is longer than the
maximum password lifetime.  This is not a sensible combination, so
we just avoid the extra DB write, and update it only once per AS-REQ
in this case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agokdc: Detect (about to) expire UF_SMARTCARD_REQUIRED accounts and rotate passwords
Andrew Bartlett [Mon, 20 May 2024 23:14:50 +0000 (11:14 +1200)] 
kdc: Detect (about to) expire UF_SMARTCARD_REQUIRED accounts and rotate passwords

This ensures that before the KDC starts to process the entry
we check if it is expired and rotate it.  As an account with
UF_SMARTCARD_REQUIRED simply can not expire unless
msDS-ExpirePasswordsOnSmartCardOnlyAccounts is set and
the Domain Functional Level is >= 2016 we do not need
to do configuration checks here.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Pair-programmed-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agos4-auth: Use consistant externally-supplied time in auth stack
Andrew Bartlett [Wed, 29 May 2024 02:51:01 +0000 (14:51 +1200)] 
s4-auth: Use consistant externally-supplied time in auth stack

This makes the time during authentication stay consistent in the KDC
and follows the fake time when we are testing gMSA accounts.  By having
the account expiry follow exactly the same clock as the password expiry
we can hope for less supprises.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agokdc: Use a consistent, stable time throughout the Heimdal KDC
Andrew Bartlett [Tue, 28 May 2024 00:53:19 +0000 (12:53 +1200)] 
kdc: Use a consistent, stable time throughout the Heimdal KDC

The MIT KDC has a fallback to a consistent time per fetch call, and
both implementations then follow the time in each 'struct
samba_kdc_entry'.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agokdc: Mark KDC sam.ldb as not to use ldb_wrap cache
Andrew Bartlett [Wed, 29 May 2024 23:43:04 +0000 (11:43 +1200)] 
kdc: Mark KDC sam.ldb as not to use ldb_wrap cache

This will ensure that the time which will be is passed in an opaque is
not used by other parts of Samba

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agoldb_wrap: Provide a way to avoid Samba using ldb_wrap()
Andrew Bartlett [Wed, 29 May 2024 23:23:01 +0000 (11:23 +1200)] 
ldb_wrap: Provide a way to avoid Samba using ldb_wrap()

ldb_wrap is a caching mechansim, and it should probably be removed
but for now provide a way to avoid it in specific cases where we
know it is harmful.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agokdc: Remove confusing duplicate open of sam.ldb to find RODC status
Andrew Bartlett [Wed, 29 May 2024 23:40:16 +0000 (11:40 +1200)] 
kdc: Remove confusing duplicate open of sam.ldb to find RODC status

Instead, make this query after we open the DB in common with the MIT code.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agodsdb: Prepare to handle smartcard password rollover
Andrew Bartlett [Mon, 20 May 2024 01:51:23 +0000 (13:51 +1200)] 
dsdb: Prepare to handle smartcard password rollover

We do this by allowing the password change control to indicate
that the password is to be randomised, bypassing the quality
checks (as true random passwords often fail these) and
re-randomising with the same code as is used for the KDC.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agodsdb: Use dsdb_gmsa_current_time() in construct_msds_user_account_control_computed
Andrew Bartlett [Fri, 17 May 2024 03:10:18 +0000 (15:10 +1200)] 
dsdb: Use dsdb_gmsa_current_time() in construct_msds_user_account_control_computed

This both allows the time to be overriden in some future unit tests
(which is incredibly helpful in testing) and gets a full NTTIME
rather than just a time_t based time, so we do not need to wait
an extra second for the NTTIME to change.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agodsdb: UF_SMARTCARD_REQUIRED can have a password expiry, if configured!
Andrew Bartlett [Tue, 2 Apr 2024 22:54:00 +0000 (11:54 +1300)] 
dsdb: UF_SMARTCARD_REQUIRED can have a password expiry, if configured!

While the passwords are random and rolled on the server, we can tell
about the expiry by setting pwdLastSet to 0.

Samba now honours the password expiry.

This is only enabled for domain functional level 2016 and when
msDS-ExpirePasswordsOnSmartCardOnlyAccounts is set to TRUE.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 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>
14 months agodsdb: Change the magic smartcard_reset to set AES keys like the krbtgt mode
Andrew Bartlett [Mon, 20 May 2024 05:13:53 +0000 (17:13 +1200)] 
dsdb: Change the magic smartcard_reset to set AES keys like the krbtgt mode

This is because the smartcard reset now generates all the keys
on Windows, so we want to match Windows 2022 as at April 2024
behaviour.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/samba/tests/krb5: PKINIT tests of passwords that are naturally expired
Andrew Bartlett [Fri, 10 May 2024 04:51:27 +0000 (16:51 +1200)] 
python/samba/tests/krb5: PKINIT tests of passwords that are naturally expired

The tests of passwords that will expire in the TGT lifetime fail against
windows, we do not see the rotation in that case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/test/krb5: Use assertAlmostEqual in check_ticket_times()
Andrew Bartlett [Fri, 17 May 2024 00:17:40 +0000 (12:17 +1200)] 
python/test/krb5: Use assertAlmostEqual in check_ticket_times()

This allows Windows behaviour with clock skew to be allowed for.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/tests/krb5: Move check_ticket_times() to kdc_base_test.py
Andrew Bartlett [Fri, 17 May 2024 00:25:17 +0000 (12:25 +1200)] 
python/tests/krb5: Move check_ticket_times() to kdc_base_test.py

This will allow other parts of the testsuite to use this helpful function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/samba/krb5: Add test for password rotation on UF_SMARCARD_REQUIRED accounts
Andrew Bartlett [Tue, 2 Apr 2024 21:53:11 +0000 (10:53 +1300)] 
python/samba/krb5: Add test for password rotation on UF_SMARCARD_REQUIRED accounts

This demonstrates behaviour against a server presumed to be in FL 2016
what the impact of the msDS-ExpirePasswordsOnSmartCardOnlyAccounts
attribute is.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/tests/krb5: Remove unused utf16pw variable
Andrew Bartlett [Tue, 2 Apr 2024 19:26:04 +0000 (08:26 +1300)] 
python/tests/krb5: Remove unused utf16pw variable

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/tests/krb5: Expect AES keys for UF_SMARTCARD_REQUIRED
Andrew Bartlett [Thu, 2 May 2024 04:02:58 +0000 (16:02 +1200)] 
python/tests/krb5: Expect AES keys for UF_SMARTCARD_REQUIRED

Windows 2022 at April 2024 has change and now includes the
AES keys for accounts with UF_SMARTCARD_REQUIRED, so revert
part of the change in b2fe1ea1c6aba116b31a1c803b4e0d36ac1a32ee.

(This is an improvement to Windows security).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/samba/tests/krb5: Extend PKINIT tests to show kpasswd still works
Andrew Bartlett [Mon, 27 May 2024 06:53:42 +0000 (18:53 +1200)] 
python/samba/tests/krb5: Extend PKINIT tests to show kpasswd still works

We have had confirmed from MS that this behaviour is both deliberate
and required.  Possession of the credential is (by the returned PAC
containing the NT hash) possession of the password, and it must be
possible to change the password to a known value otherwise DPAPI
(local keychain) secured by this value can fail on the client.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agopython/samba/tests/krb5: Move get_kpasswd_sname() into raw_testcase() to allow broade...
Andrew Bartlett [Mon, 27 May 2024 06:46:49 +0000 (18:46 +1200)] 
python/samba/tests/krb5: Move get_kpasswd_sname() into raw_testcase() to allow broader use

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agos4-auth: Use msDS-User-Account-Control-Computed for PW expiry check
Andrew Bartlett [Mon, 20 May 2024 02:07:46 +0000 (14:07 +1200)] 
s4-auth: Use msDS-User-Account-Control-Computed for PW expiry check

This centralises the check rather than checking the time in
multiple spots.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agos4-auth: Update comment to mention 60mins in the NTLM grace period
Andrew Bartlett [Tue, 2 Apr 2024 22:52:28 +0000 (11:52 +1300)] 
s4-auth: Update comment to mention 60mins in the NTLM grace period

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agodsdb: Make argument order of dsdb_update_gmsa_{entry_,}keys() consistant with other...
Andrew Bartlett [Tue, 23 Apr 2024 04:17:04 +0000 (16:17 +1200)] 
dsdb: Make argument order of dsdb_update_gmsa_{entry_,}keys() consistant with other uses

Other functions in this file are TALLOC_CTX, struct ldb_context *, not
the other way around.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
14 months agosmbd: Ensure we grant owner sid in check_parent_access_fsp()
MikeLiu [Fri, 31 May 2024 07:31:46 +0000 (15:31 +0800)] 
smbd: Ensure we grant owner sid in check_parent_access_fsp()

Grant owner sid to check for owner rights.

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

Signed-off-by: MikeLiu <mikeliu@qnap.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  7 18:30:34 UTC 2024 on atb-devel-224

14 months agos3:utils: Use talloc instead of malloc functions
Andreas Schneider [Thu, 6 Jun 2024 15:37:32 +0000 (17:37 +0200)] 
s3:utils: Use talloc instead of malloc functions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun  6 21:32:53 UTC 2024 on atb-devel-224

14 months agos3:util: Use a talloc stackframe in rpc_trustdom_establish()
Andreas Schneider [Tue, 30 Apr 2024 07:55:15 +0000 (09:55 +0200)] 
s3:util: Use a talloc stackframe in rpc_trustdom_establish()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:utils: Use a destructor in rpc_trustdom_establish()
Andreas Schneider [Thu, 6 Jun 2024 15:31:10 +0000 (17:31 +0200)] 
s3:utils: Use a destructor in rpc_trustdom_establish()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:utils: Remove overwrite of opt_workgroup in rpc_trustdom_establish()
Andreas Schneider [Tue, 30 Apr 2024 07:46:33 +0000 (09:46 +0200)] 
s3:utils: Remove overwrite of opt_workgroup in  rpc_trustdom_establish()

This is not used anywhere in that functions or the functions we are
calling. It was replaced by command line cli credentials stored in
c->creds. This fixes a memory leak.

Direct leak of 12 byte(s) in 1 object(s) allocated from:
    #0 0x7f17fdaf5830 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x7f17fc7e7339 in smb_xstrdup ../../lib/util/util.c:752
    #2 0x55f079bf0723 in rpc_trustdom_establish ../../source3/utils/net_rpc.c:6591
    #3 0x55f079c529af in net_run_function ../../source3/utils/net_util.c:464
    #4 0x55f079bdbecf in rpc_trustdom ../../source3/utils/net_rpc.c:7483
    #5 0x55f079c529af in net_run_function ../../source3/utils/net_util.c:464
    #6 0x55f079bfe7de in net_rpc ../../source3/utils/net_rpc.c:8413
    #7 0x55f079c529af in net_run_function ../../source3/utils/net_util.c:464
    #8 0x55f079baa0a8 in main ../../source3/utils/net.c:1436
    #9 0x7f17f8a2a1ef in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agopython: Add test for checking the SHA256SUM
Andreas Schneider [Thu, 6 Jun 2024 08:12:08 +0000 (10:12 +0200)] 
python: Add test for checking the SHA256SUM

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agopython:netcmd: Create a SHA256SUM file with checksums
Andreas Schneider [Wed, 15 Feb 2023 07:10:03 +0000 (08:10 +0100)] 
python:netcmd: Create a SHA256SUM file with checksums

This allows to verify the backup tarball contents with:

  sha256sum -c SHA256SUM

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agopython:netcmd: Only put regular files into the tarball
Andreas Schneider [Wed, 15 Feb 2023 07:05:42 +0000 (08:05 +0100)] 
python:netcmd: Only put regular files into the tarball

We also have ldapi, other sockets or pipes around, we don't want to
add. This will be relevant for adding checksums later.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:utils: DNS_UTIL depends on libads headers so we need to depend on 'ads'
Stefan Metzmacher [Thu, 6 Jun 2024 08:39:33 +0000 (10:39 +0200)] 
s3:utils: DNS_UTIL depends on libads headers so we need to depend on 'ads'

Otherwise we don't get the correct header include paths and krb5.h in
a non default location won't be found.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 months agos3:libsmb: we no longer need libads/kerberos_proto.h in namequery.c
Stefan Metzmacher [Thu, 6 Jun 2024 08:38:48 +0000 (10:38 +0200)] 
s3:libsmb: we no longer need libads/kerberos_proto.h in namequery.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
14 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

14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 months agos4:dns_server: only allow gss-tsig and gss.microsoft.com for TKEY
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 TKEY

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>
14 months agos4:dns_server: failed dns updates should result in REFUSED for ACCESS_DENIED
Stefan Metzmacher [Fri, 31 May 2024 06:36:40 +0000 (08:36 +0200)] 
s4:dns_server: failed dns updates should result in REFUSED for ACCESS_DENIED

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>
14 months agopython:tests/dns_tkey: add test_update_tsig_record_access_denied()
Stefan Metzmacher [Wed, 29 May 2024 09:40:51 +0000 (11:40 +0200)] 
python:tests/dns_tkey: add test_update_tsig_record_access_denied()

This demonstrates that access_denied is only generated if the client
really generates a change in the database.

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>
14 months agos4:selftest/tests: pass USERNAME_UNPRIV=$DOMAIN_USER to samba.tests.dns_tkey
Stefan Metzmacher [Wed, 29 May 2024 09:39:56 +0000 (11:39 +0200)] 
s4:selftest/tests: pass USERNAME_UNPRIV=$DOMAIN_USER to samba.tests.dns_tkey

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>
14 months agopython:tests/dns_base: add get_unpriv_creds() helper
Stefan Metzmacher [Wed, 29 May 2024 09:39:56 +0000 (11:39 +0200)] 
python:tests/dns_base: add get_unpriv_creds() helper

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>
14 months agopython:tests/dns_tkey: let test_update_tsig_windows() actually pass against windows...
Stefan Metzmacher [Wed, 29 May 2024 11:17:54 +0000 (13:17 +0200)] 
python:tests/dns_tkey: let test_update_tsig_windows() actually pass against windows 2022

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>
14 months agopython:tests/dns_base: let verify_packet() work against Windows
Stefan Metzmacher [Wed, 29 May 2024 11:17:54 +0000 (13:17 +0200)] 
python:tests/dns_base: let verify_packet() work against Windows

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>
14 months agopython:tests/dns_tkey: test bad and changing tsig algorithms
Stefan Metzmacher [Wed, 29 May 2024 15:26:39 +0000 (17:26 +0200)] 
python:tests/dns_tkey: test bad and changing tsig 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>