]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbindd: let update_trusted_domains_dc() also call pdb_filter_hints()
authorStefan Metzmacher <metze@samba.org>
Sat, 22 Mar 2025 00:03:26 +0000 (01:03 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 3 Apr 2025 10:35:10 +0000 (10:35 +0000)
On an AD DC we need to update sam_domain->fti, so that
find_routing_from_namespace_noinit() uses the correct
uPNSuffixes and msDS-SPNSuffixes values for the local forest.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Apr  3 10:35:10 UTC 2025 on atb-devel-224

source3/winbindd/winbindd_util.c

index 2ccffe0e2804d3a8975ffe1f54306fb72e72d973..054661776003686f12531bb31a89ca646a6a0a90 100644 (file)
@@ -1388,6 +1388,26 @@ bool update_trusted_domains_dc(void)
                return false;
        }
 
+       if (IS_AD_DC) {
+               struct winbindd_domain *sam_domain = find_local_sam_domain();
+               NTSTATUS status;
+
+               SMB_ASSERT(sam_domain);
+
+               TALLOC_FREE(sam_domain->fti);
+
+               status = pdb_filter_hints(sam_domain,
+                                         NULL,  /* p_local_tdo */
+                                         &sam_domain->fti,
+                                         NULL); /* p_local_functional_level */
+               if (!NT_STATUS_IS_OK(status)) {
+                       DBG_ERR("pdb_filter_hints(%s) - %s\n",
+                               sam_domain->name,
+                               nt_errstr(status));
+                       return false;
+               }
+       }
+
        ok = add_trusted_domains_dc();
        if (!ok) {
                return false;