]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
17 months agopython:tests: Rename ‘keytab_as_set’ variable to be distinct from keytab_as_set(...
Jo Sutton [Wed, 24 Apr 2024 00:45:27 +0000 (12:45 +1200)] 
python:tests: Rename ‘keytab_as_set’ variable to be distinct from keytab_as_set() method

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agothird_party/heimdal: Import lorikeet-heimdal-202405220400 (commit 8276d6311146b8ab5d5...
Jo Sutton [Wed, 22 May 2024 04:07:17 +0000 (16:07 +1200)] 
third_party/heimdal: Import lorikeet-heimdal-202405220400 (commit 8276d6311146b8ab5d57d092bc5d5fa28282a900)

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoWHATSNEW: Add 'dns hostname'
Andreas Schneider [Wed, 6 Mar 2024 15:02:02 +0000 (16:02 +0100)] 
WHATSNEW: Add 'dns hostname'

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoauth:ntlmssp: Use lpcfg_dns_hostname()
Andreas Schneider [Fri, 12 Apr 2024 05:41:06 +0000 (07:41 +0200)] 
auth:ntlmssp: Use lpcfg_dns_hostname()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoauth:ntlmssp: Remove trailing spaces
Andreas Schneider [Fri, 12 Apr 2024 06:17:04 +0000 (08:17 +0200)] 
auth:ntlmssp: Remove trailing spaces

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dnsdomain() in dnsdb.c
Andreas Schneider [Fri, 12 Apr 2024 06:16:33 +0000 (08:16 +0200)] 
s4:rpc_server: Use lpcfg_dnsdomain() in dnsdb.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dns_hostname() in dnsdb.c
Andreas Schneider [Fri, 12 Apr 2024 06:13:04 +0000 (08:13 +0200)] 
s4:rpc_server: Use lpcfg_dns_hostname() in dnsdb.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dns_hostname() in dnsutils.c
Andreas Schneider [Fri, 12 Apr 2024 05:37:09 +0000 (07:37 +0200)] 
s4:rpc_server: Use lpcfg_dns_hostname() in dnsutils.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:rpc_server: Use lpcfg_dns_hostname() in dns_server.c
Andreas Schneider [Fri, 12 Apr 2024 05:34:54 +0000 (07:34 +0200)] 
s4:rpc_server: Use lpcfg_dns_hostname() in dns_server.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dns_server: Use lpcfg_dns_hostname() in dlz_bind9.c
Andreas Schneider [Thu, 4 Apr 2024 09:28:39 +0000 (11:28 +0200)] 
s4:dns_server: Use lpcfg_dns_hostname() in dlz_bind9.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dfs_server: Use lpcfg_dns_hostname() in dfs_server_ad.c
Andreas Schneider [Thu, 4 Apr 2024 09:31:06 +0000 (11:31 +0200)] 
s4:dfs_server: Use lpcfg_dns_hostname() in dfs_server_ad.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:rpc_server: Use lpcfg_dns_hostname() in srv_witness_nt.c
Andreas Schneider [Fri, 12 Apr 2024 06:19:25 +0000 (08:19 +0200)] 
s3:rpc_server: Use lpcfg_dns_hostname() in srv_witness_nt.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Ignore case for group_name comparison
Andreas Schneider [Fri, 12 Apr 2024 17:15:36 +0000 (19:15 +0200)] 
python:tests: Ignore case for group_name comparison

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:utils: Use lp_dnsdomain() in net_ads.c
Andreas Schneider [Fri, 12 Apr 2024 06:23:23 +0000 (08:23 +0200)] 
s3:utils: Use lp_dnsdomain() in net_ads.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: Convert myalias to lower case
Andreas Schneider [Fri, 12 Apr 2024 06:33:06 +0000 (08:33 +0200)] 
s3:libnet: Convert myalias to lower case

This will be more consistent as it is a dnsname.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: Use lp_dns_hostname() in libnet_join.c
Andreas Schneider [Thu, 4 Apr 2024 09:24:13 +0000 (11:24 +0200)] 
s3:libnet: Use lp_dns_hostname() in libnet_join.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:lib: Remove obsolete name_to_fqdn()
Andreas Schneider [Wed, 6 Mar 2024 15:00:47 +0000 (16:00 +0100)] 
s3:lib: Remove obsolete name_to_fqdn()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:librpc: Use lp_dns_hostname() for creating the fqdn
Andreas Schneider [Wed, 6 Mar 2024 14:59:14 +0000 (15:59 +0100)] 
s3:librpc: Use lp_dns_hostname() for creating the fqdn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:utils: Use lp_dns_hostname() for 'net' dns updates
Andreas Schneider [Wed, 6 Mar 2024 14:53:17 +0000 (15:53 +0100)] 
s3:utils: Use lp_dns_hostname() for 'net' dns updates

name_to_fqdn() requires /etc/hosts to be set up in a special way to find
out the fqdn for dns updates. They are not set up by default and the
DNS update fails. Normally the fqdn is just <lp_netbios_name>.<realm>
and we should just use that. However if it is different, you can set
it to the special value in the smb.conf now.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agodocs-xml: Add smb.conf option 'dns hostname'
Andreas Schneider [Tue, 9 Jan 2024 14:47:48 +0000 (15:47 +0100)] 
docs-xml: Add smb.conf option 'dns hostname'

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agoselftest/Samba4: make use of get_cmd_env_vars() to setup all relevant env variables
Stefan Metzmacher [Tue, 14 May 2024 14:55:58 +0000 (16:55 +0200)] 
selftest/Samba4: make use of get_cmd_env_vars() to setup all relevant env variables

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): Wed May 22 05:26:48 UTC 2024 on atb-devel-224

17 months agos4:dsdb/repl: let drepl_out_helpers.c always go via dreplsrv_out_drsuapi_send()
Stefan Metzmacher [Tue, 6 Feb 2024 20:09:58 +0000 (21:09 +0100)] 
s4:dsdb/repl: let drepl_out_helpers.c always go via dreplsrv_out_drsuapi_send()

I have customer backtraces showing that 'drsuapi' is NULL in
dreplsrv_op_pull_source_get_changes_trigger() called from the
WERR_DS_DRA_SCHEMA_MISMATCH retry case of
dreplsrv_op_pull_source_apply_changes_trigger(), while 'drsuapi' was
a valid pointer there.

From reading the code I don't understand how this can happen,
but it does very often on RODCs. And this fix prevents the problem.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:smbcacls: fix ace_compare
Douglas Bagnall [Tue, 21 May 2024 08:20:36 +0000 (20:20 +1200)] 
s3:smbcacls: fix ace_compare

We got this wrong in commit 31101a9fa1503be9d8137e42466f57d85136a156.

In fact, we should probably not reorder the inherited ACLs, but that
is for another patch series.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib/fuzzing: fuzz_stable_sort_r_unstable tries to catch overrun
Douglas Bagnall [Tue, 14 May 2024 02:58:51 +0000 (14:58 +1200)] 
lib/fuzzing: fuzz_stable_sort_r_unstable tries to catch overrun

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agospelling: comments: synthax -> syntax
Douglas Bagnall [Wed, 10 Apr 2024 09:25:12 +0000 (21:25 +1200)] 
spelling: comments: synthax -> syntax

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agospelling: fix spelling of privilege.ldb in comments
Douglas Bagnall [Wed, 10 Apr 2024 09:22:57 +0000 (21:22 +1200)] 
spelling: fix spelling of privilege.ldb in comments

'privileges' is a word, but the ldb referred to is privilege.ldb

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Remove file_info->[ug]id
Volker Lendecke [Tue, 21 May 2024 09:21:03 +0000 (11:21 +0200)] 
libsmb: Remove file_info->[ug]id

These fields were never assigned

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Simplify request_timed_out
Volker Lendecke [Tue, 21 May 2024 06:38:19 +0000 (08:38 +0200)] 
smbd: Simplify request_timed_out

timeval_expired does what we need here

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib: Use struct initialization
Volker Lendecke [Tue, 21 May 2024 06:31:45 +0000 (08:31 +0200)] 
lib: Use struct initialization

Make sure everything is initialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Remove a talloc_strdup()
Volker Lendecke [Mon, 20 May 2024 13:19:06 +0000 (15:19 +0200)] 
libsmb: Remove a talloc_strdup()

We're directly overwriting state->mask without actually using it for
anything real.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Remove an unneeded NULL check
Volker Lendecke [Mon, 20 May 2024 08:38:47 +0000 (10:38 +0200)] 
libsmb: Remove an unneeded NULL check

We have dereferenced p_last_name_raw before in the call to
data_blob_free, our only caller does give us a pointer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Remove unused cli_list_trans()
Volker Lendecke [Mon, 20 May 2024 08:06:46 +0000 (10:06 +0200)] 
libsmb: Remove unused cli_list_trans()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Use SMB2_0_INFO_ constants instead of magic numbers
Volker Lendecke [Fri, 17 May 2024 10:32:20 +0000 (12:32 +0200)] 
libsmb: Use SMB2_0_INFO_ constants instead of magic numbers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Execute a "TODO", remove IVAL2_TO_SMB_BIG_UINT
Volker Lendecke [Fri, 17 May 2024 14:05:19 +0000 (16:05 +0200)] 
libsmb: Execute a "TODO", remove IVAL2_TO_SMB_BIG_UINT

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib: Fix a typo
Volker Lendecke [Fri, 17 May 2024 14:07:44 +0000 (16:07 +0200)] 
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Avoid pointless intermediate variables
Volker Lendecke [Fri, 17 May 2024 10:28:53 +0000 (12:28 +0200)] 
libsmb: Avoid pointless intermediate variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolibsmb: Use the direct FSCC_ infolevels
Volker Lendecke [Fri, 17 May 2024 10:23:19 +0000 (12:23 +0200)] 
libsmb: Use the direct FSCC_ infolevels

Could have done this as part of 1776918c5bf already.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Remove an unused function parameter
Volker Lendecke [Thu, 16 May 2024 10:59:28 +0000 (12:59 +0200)] 
smbd: Remove an unused function parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Remove an unnecessary else
Volker Lendecke [Thu, 16 May 2024 10:49:17 +0000 (12:49 +0200)] 
smbd: Remove an unnecessary else

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Remove a no-op call to init_strict_lock_struct
Volker Lendecke [Thu, 16 May 2024 10:05:38 +0000 (12:05 +0200)] 
smbd: Remove a no-op call to init_strict_lock_struct

"lock" is a variable on the stack, and initializing it is all that
init_strict_lock_struct does. We've done the corresponding checks
already in smbd_smb2_read_send

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Remove an unnecessary else branch
Volker Lendecke [Thu, 16 May 2024 10:04:23 +0000 (12:04 +0200)] 
smbd: Remove an unnecessary else branch

We return in the if branch, review with "git show -w"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Return correct error for fallback sendfile
Volker Lendecke [Tue, 21 May 2024 08:12:22 +0000 (10:12 +0200)] 
smbd: Return correct error for fallback sendfile

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Use direct struct initialization
Volker Lendecke [Thu, 16 May 2024 10:03:46 +0000 (12:03 +0200)] 
smbd: Use direct struct initialization

Make sure all fields in the target struct are initialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Remove the ZERO_ZERO define
Volker Lendecke [Wed, 15 May 2024 15:26:27 +0000 (17:26 +0200)] 
smbd: Remove the ZERO_ZERO define

This code went in with e8e98c9ea06 in 2001 without any mention in the
commit message.

I don't remember all details, but there was some discussion around the
offset=0,length=0 lock being somehow special. These days [MS-FSA]
defines the required behaviour (don't conflict) and we implement that
behaviour.

If someone still remembers why this code is in and thinks it's
worthwhile, that's what version control is for.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Fix whitespace
Volker Lendecke [Wed, 15 May 2024 15:14:55 +0000 (17:14 +0200)] 
smbd: Fix whitespace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Move a DBG_DEBUG up
Volker Lendecke [Thu, 16 May 2024 13:27:05 +0000 (15:27 +0200)] 
smbd: Move a DBG_DEBUG up

Make it line up with the other branches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosmbd: Modernize a few DEBUGs
Volker Lendecke [Wed, 15 May 2024 15:10:24 +0000 (17:10 +0200)] 
smbd: Modernize a few DEBUGs

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotest_kinit_export_keytab: reset pw of the test account and test --only-current-keys
Stefan Metzmacher [Wed, 17 Apr 2024 14:15:17 +0000 (16:15 +0200)] 
test_kinit_export_keytab: reset pw of the test account and test --only-current-keys

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): Wed May 22 04:07:02 UTC 2024 on atb-devel-224

17 months agosamba-tool: let 'samba-tool domain exportkeytab' take an --only-current-keys option
Stefan Metzmacher [Fri, 15 Mar 2024 15:14:18 +0000 (16:14 +0100)] 
samba-tool: let 'samba-tool domain exportkeytab' take an --only-current-keys option

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agosamba.tests.dckeytab: add test_export_keytab_change3_update_only_current_keep()
Stefan Metzmacher [Fri, 15 Mar 2024 15:31:22 +0000 (16:31 +0100)] 
samba.tests.dckeytab: add test_export_keytab_change3_update_only_current_keep()

This tests that only_current_keys=True works.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libnet_export_keytab: add only_current_keys option
Stefan Metzmacher [Fri, 15 Mar 2024 15:11:10 +0000 (16:11 +0100)] 
s4:libnet_export_keytab: add only_current_keys option

By default we also export on the old and older passwords...

In order to do a kinit with a keytab it might we useful to
include only the current keys.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: also provide cross-realm keys via samba_kdc_seq()
Stefan Metzmacher [Thu, 3 Feb 2022 13:14:06 +0000 (14:14 +0100)] 
s4:kdc: also provide cross-realm keys via samba_kdc_seq()

This means that 'samba-tool domain exportkeytab' is able to
export them.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: let samba_kdc_trust_message2entry() return all keys with SDB_F_ADMIN_DATA
Stefan Metzmacher [Fri, 15 Mar 2024 18:23:46 +0000 (19:23 +0100)] 
s4:kdc: let samba_kdc_trust_message2entry() return all keys with SDB_F_ADMIN_DATA

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: split out samba_kdc_fill_trust_keys() helper
Stefan Metzmacher [Fri, 15 Mar 2024 18:19:20 +0000 (19:19 +0100)] 
s4:kdc: split out samba_kdc_fill_trust_keys() helper

This simplifies the logic in samba_kdc_trust_message2entry(),
is very similar to our samba_kdc_fill_user_keys() helper
and will make it trivial to provide the previous keys
in entry->old_keys in the next commit.

Review with: git show -p --patience

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: add available_enctypes to supported_session_etypes in samba_kdc_trust_message...
Stefan Metzmacher [Fri, 15 Mar 2024 18:19:20 +0000 (19:19 +0100)] 
s4:kdc: add available_enctypes to supported_session_etypes in samba_kdc_trust_message2entry()

This aligns the logic of samba_kdc_trust_message2entry() with
samba_kdc_message2entry_keys().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: add a returned_kvno helper variable in samba_kdc_trust_message2entry()
Stefan Metzmacher [Fri, 15 Mar 2024 18:19:20 +0000 (19:19 +0100)] 
s4:kdc: add a returned_kvno helper variable in samba_kdc_trust_message2entry()

This will simplifiy further changes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: let samba_kdc_trust_message2entry() ignore KRB5_PROG_ETYPE_NOSUPP
Stefan Metzmacher [Fri, 15 Mar 2024 18:19:20 +0000 (19:19 +0100)] 
s4:kdc: let samba_kdc_trust_message2entry() ignore KRB5_PROG_ETYPE_NOSUPP

We already handle it in samba_kdc_fill_user_keys() mostly for DES keys,
but other encryption types might be from kerberos libraries in future.
And things like FIPS mode may also alter the runtime behaviour.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: split out samba_kdc_fill_trust_keys() helper
Stefan Metzmacher [Fri, 15 Mar 2024 18:19:20 +0000 (19:19 +0100)] 
s4:kdc: split out samba_kdc_fill_trust_keys() helper

Let samba_kdc_trust_message2entry() also fill in the salt used
by the key. This is not strictly needed, but it's better to
be consistent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: add a debug message to libnet_keytab_add_to_keytab_entries()
Stefan Metzmacher [Thu, 3 Feb 2022 17:27:19 +0000 (18:27 +0100)] 
s3:libnet: add a debug message to libnet_keytab_add_to_keytab_entries()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: add support for trusted domains in libnet_dssync_keytab.c
Stefan Metzmacher [Thu, 3 Feb 2022 17:27:19 +0000 (18:27 +0100)] 
s3:libnet: add support for trusted domains in libnet_dssync_keytab.c

It means that keytabs generated via 'net rpc vampire keytab' are
able to decrypt cross-realm tickets in wireshark.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: split out store_or_fetch_attribute() from parse_user() in libnet_dssync_ke...
Stefan Metzmacher [Thu, 3 Feb 2022 13:48:03 +0000 (14:48 +0100)] 
s3:libnet: split out store_or_fetch_attribute() from parse_user() in libnet_dssync_keytab.c

This way we can easily re-use the logic in the next commits...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: split out parse_user() in libnet_dssync_keytab.c
Stefan Metzmacher [Thu, 3 Feb 2022 13:48:03 +0000 (14:48 +0100)] 
s3:libnet: split out parse_user() in libnet_dssync_keytab.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos3:libnet: let parse_user() in libnet_dssync_keytab.c work without nt hash
Stefan Metzmacher [Thu, 3 Feb 2022 13:48:03 +0000 (14:48 +0100)] 
s3:libnet: let parse_user() in libnet_dssync_keytab.c work without nt hash

It happens in setups with 'nt hash store = never'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: Implement KDC plugin hardware authentication policy
Jo Sutton [Sun, 12 May 2024 22:58:51 +0000 (10:58 +1200)] 
s4:kdc: Implement KDC plugin hardware authentication policy

NOTE: This commit finally works again!

Signed-off-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): Thu May 16 03:14:47 UTC 2024 on atb-devel-224

17 months agos4:kdc: Remove trailing whitespace
Jo Sutton [Wed, 15 May 2024 04:28:12 +0000 (16:28 +1200)] 
s4:kdc: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agothird_party/heimdal: Import lorikeet-heimdal-202405090452 (commit 49c8e97b7221db53355...
Jo Sutton [Thu, 9 May 2024 04:57:14 +0000 (16:57 +1200)] 
third_party/heimdal: Import lorikeet-heimdal-202405090452 (commit 49c8e97b7221db53355258059ef385c856e1385f)

NOTE: THIS COMMIT WON’T COMPILE/WORK ON ITS OWN!

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Adjust tests to pass against newer Windows versions that include ticket...
Jo Sutton [Tue, 14 May 2024 01:05:31 +0000 (13:05 +1200)] 
tests/krb5: Adjust tests to pass against newer Windows versions that include ticket checksums in response to AS‐REQs

A lot of these tests are going to start failing, so skip them until
we’ve implemented the corresponding behaviour for the KDC.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: Initialize local variable just in case (CID 1596759)
Jo Sutton [Mon, 6 May 2024 00:20:44 +0000 (12:20 +1200)] 
s4:kdc: Initialize local variable just in case (CID 1596759)

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: Free target principal string to avoid memory leak (CID 1596760)
Jo Sutton [Mon, 6 May 2024 00:19:18 +0000 (12:19 +1200)] 
s4:kdc: Free target principal string to avoid memory leak (CID 1596760)

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:kdc: Initialize pointer variable just in case (CID 1596762)
Jo Sutton [Mon, 6 May 2024 00:17:20 +0000 (12:17 +1200)] 
s4:kdc: Initialize pointer variable just in case (CID 1596762)

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Make map containing default attribute values static
Jo Sutton [Tue, 30 Apr 2024 05:51:18 +0000 (17:51 +1200)] 
s4:dsdb: Make map containing default attribute values static

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Do not set lockoutTime for trust accounts
Jo Sutton [Mon, 29 Apr 2024 05:04:11 +0000 (17:04 +1200)] 
s4:dsdb: Do not set lockoutTime for trust accounts

This matches the behaviour of Windows.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Make use of userAccountControl helper function
Jo Sutton [Thu, 9 May 2024 01:53:00 +0000 (13:53 +1200)] 
s4:dsdb: Make use of userAccountControl helper function

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Add userAccountControl helper function
Jo Sutton [Wed, 1 May 2024 00:38:04 +0000 (12:38 +1200)] 
s4:dsdb: Add userAccountControl helper function

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Remove redundant user flags macro
Jo Sutton [Thu, 9 May 2024 01:19:35 +0000 (13:19 +1200)] 
s4:dsdb: Remove redundant user flags macro

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:auth: Accept previous gMSA password for NTLM authentication five minutes after...
Jo Sutton [Wed, 24 Apr 2024 03:49:27 +0000 (15:49 +1200)] 
s4:auth: Accept previous gMSA password for NTLM authentication five minutes after a password change

gMSA password changes are usually triggered when the DC needs to fetch
the account’s keys and notices they are out of date.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib:crypto: Add constant denoting maximum GKDI clock skew in minutes
Jo Sutton [Tue, 16 Apr 2024 04:05:55 +0000 (16:05 +1200)] 
lib:crypto: Add constant denoting maximum GKDI clock skew in minutes

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libnet: Remove unnecessary declarations
Jo Sutton [Wed, 24 Apr 2024 00:32:52 +0000 (12:32 +1200)] 
s4:libnet: Remove unnecessary declarations

This declaration is a hold‐over from the Python 2 module initialization
pattern.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libnet: Remove trailing whitespace
Jo Sutton [Wed, 24 Apr 2024 00:34:36 +0000 (12:34 +1200)] 
s4:libnet: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Add more tests for gMSAs
Jo Sutton [Tue, 30 Apr 2024 04:34:53 +0000 (16:34 +1200)] 
tests/krb5: Add more tests for gMSAs

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Test viewing gMSA passwords after performing simple binds
Jo Sutton [Fri, 26 Apr 2024 02:53:03 +0000 (14:53 +1200)] 
tests/krb5: Test viewing gMSA passwords after performing simple binds

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Test that computers (and, by extension, gMSAs) cannot perform interactive...
Jo Sutton [Fri, 26 Apr 2024 00:50:51 +0000 (12:50 +1200)] 
tests/krb5: Test that computers (and, by extension, gMSAs) cannot perform interactive logons

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Don’t pass gMSA as ‘domain_joined_mach_creds’ parameter
Jo Sutton [Tue, 30 Apr 2024 04:28:44 +0000 (16:28 +1200)] 
tests/krb5: Don’t pass gMSA as ‘domain_joined_mach_creds’ parameter

We just want to test whether a gMSA can use netlogon.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Test performing NTLMSSP logons at different times
Jo Sutton [Fri, 26 Apr 2024 01:20:54 +0000 (13:20 +1200)] 
tests/krb5: Test performing NTLMSSP logons at different times

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:auth: Let dsdb gMSA time influence NTLM previous password allowed period
Jo Sutton [Wed, 1 May 2024 02:58:31 +0000 (14:58 +1200)] 
s4:auth: Let dsdb gMSA time influence NTLM previous password allowed period

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Let dsdb gMSA time influence pwdLastSet
Jo Sutton [Wed, 1 May 2024 03:00:19 +0000 (15:00 +1200)] 
s4:dsdb: Let dsdb gMSA time influence pwdLastSet

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Test that gMSA passwords cannot be viewed over an unsealed connection
Jo Sutton [Fri, 26 Apr 2024 01:08:23 +0000 (13:08 +1200)] 
tests/krb5: Test that gMSA passwords cannot be viewed over an unsealed connection

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Add ‘expect_success’ parameter to gensec_ntlmssp_logon()
Jo Sutton [Wed, 24 Apr 2024 05:22:45 +0000 (17:22 +1200)] 
tests/krb5: Add ‘expect_success’ parameter to gensec_ntlmssp_logon()

View with ‘git show -b’.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Make use of gmsa_series_for_account() method
Jo Sutton [Wed, 24 Apr 2024 05:20:14 +0000 (17:20 +1200)] 
tests/krb5: Make use of gmsa_series_for_account() method

This allows us to replace a call to
expected_current_gmsa_password_blob() with one to
expected_gmsa_password_blob(), a method which allows us to specify the
exact key we expect.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Add quantized_time() method
Jo Sutton [Wed, 24 Apr 2024 05:18:09 +0000 (17:18 +1200)] 
tests/krb5: Add quantized_time() method

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agotests/krb5: Read current time from correct SamDB
Jo Sutton [Wed, 24 Apr 2024 05:16:55 +0000 (17:16 +1200)] 
tests/krb5: Read current time from correct SamDB

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Pass ServerPasswordSet2() parameters in correct order
Jo Sutton [Tue, 30 Apr 2024 02:36:07 +0000 (14:36 +1200)] 
python:tests: Pass ServerPasswordSet2() parameters in correct order

‘account_name’ and ‘server_name’ are passed in the wrong order. While
Samba ignores the account name parameter and doesn’t have a problem with
it missing its trailing dollar, Windows checks it and requires the
trailing dollar to be present.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Remove unnecessary ‘pass’ statement
Jo Sutton [Tue, 30 Apr 2024 02:35:13 +0000 (14:35 +1200)] 
python:tests: Remove unnecessary ‘pass’ statement

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agopython:tests: Remove unused netlogon connection parameter
Jo Sutton [Tue, 30 Apr 2024 02:34:44 +0000 (14:34 +1200)] 
python:tests: Remove unused netlogon connection parameter

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libcli: Add more controls to our list of known controls
Jo Sutton [Mon, 29 Apr 2024 05:03:39 +0000 (17:03 +1200)] 
s4:libcli: Add more controls to our list of known controls

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:libcli: Fix code spelling
Jo Sutton [Mon, 29 Apr 2024 05:48:01 +0000 (17:48 +1200)] 
s4:libcli: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:setup: Update name of dsdb password change control
Jo Sutton [Mon, 29 Apr 2024 05:02:39 +0000 (17:02 +1200)] 
s4:setup: Update name of dsdb password change control

Commit 0a907c2f45c34efcac784738c9d75303b9d04d2f renamed this control to
DSDB_CONTROL_PASSWORD_CHANGE_OLD_PW_CHECKED_OID.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Fix code spelling
Jo Sutton [Mon, 29 Apr 2024 05:02:06 +0000 (17:02 +1200)] 
s4:dsdb: Fix code spelling

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agos4:dsdb: Remove trailing whitespace
Jo Sutton [Mon, 29 Apr 2024 05:01:52 +0000 (17:01 +1200)] 
s4:dsdb: Remove trailing whitespace

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
17 months agolib:fuzzing: Fix undefined shift
Jo Sutton [Tue, 14 May 2024 04:42:31 +0000 (16:42 +1200)] 
lib:fuzzing: Fix undefined shift

../../lib/fuzzing/fuzz_stable_sort_r_unstable.c:47:22: runtime error: left shift of negative value -34

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>