]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb/common: let dsdb_trust_merge_forest_info() handle SCANNER and BINARY records
authorStefan Metzmacher <metze@samba.org>
Wed, 12 Feb 2025 15:52:34 +0000 (16:52 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 22 Feb 2025 16:00:36 +0000 (16:00 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dsdb/common/util_trusts.c

index 9ed1ebe21256349a2b3dd7e91a29899f439791ba..a184ba6b934a26c28e1b8bf84fa848ca7d54130a 100644 (file)
@@ -2189,6 +2189,56 @@ NTSTATUS dsdb_trust_merge_forest_info(TALLOC_CTX *mem_ctx,
                }
        }
 
+       /*
+        * Finally we readd scanner info records
+        */
+       for (oi = 0; oi < ofti->count; oi++) {
+               const struct lsa_ForestTrustRecord2 *oftr =
+                       ofti->entries[oi];
+
+               if (oftr == NULL) {
+                       /*
+                        * broken record => ignore...
+                        */
+                       continue;
+               }
+
+               if (oftr->type != LSA_FOREST_TRUST_SCANNER_INFO) {
+                       continue;
+               }
+
+               status = dsdb_trust_forest_info_add_record(mfti, oftr);
+               if (!NT_STATUS_IS_OK(status)) {
+                       TALLOC_FREE(frame);
+                       return status;
+               }
+       }
+
+       /*
+        * Finally we readd binary info records
+        */
+       for (oi = 0; oi < ofti->count; oi++) {
+               const struct lsa_ForestTrustRecord2 *oftr =
+                       ofti->entries[oi];
+
+               if (oftr == NULL) {
+                       /*
+                        * broken record => ignore...
+                        */
+                       continue;
+               }
+
+               if (oftr->type != LSA_FOREST_TRUST_BINARY_DATA) {
+                       continue;
+               }
+
+               status = dsdb_trust_forest_info_add_record(mfti, oftr);
+               if (!NT_STATUS_IS_OK(status)) {
+                       TALLOC_FREE(frame);
+                       return status;
+               }
+       }
+
        *_mfti = talloc_move(mem_ctx, &mfti);
        TALLOC_FREE(frame);
        return NT_STATUS_OK;