]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/lsarpc: add trust_forest_info_lsa_2to2()
authorStefan Metzmacher <metze@samba.org>
Thu, 13 Feb 2025 14:05:02 +0000 (15:05 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 22 Feb 2025 16:00:36 +0000 (16:00 +0000)
This normalizes LSA_FOREST_TRUST_BINARY_DATA in
LSA_FOREST_TRUST_SCANNER_INFO.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/lsarpc/util_lsarpc.c
libcli/lsarpc/util_lsarpc.h

index ab5406004dd055ff815b7662eeb6931d067e203a..a9c6cbd982319298c7677db5c698a35a4b669d5a 100644 (file)
@@ -1106,6 +1106,34 @@ NTSTATUS trust_forest_info_lsa_2to1(TALLOC_CTX *mem_ctx,
        return NT_STATUS_OK;
 }
 
+NTSTATUS trust_forest_info_lsa_2to2(TALLOC_CTX *mem_ctx,
+                               const struct lsa_ForestTrustInformation2 *in,
+                               struct lsa_ForestTrustInformation2 **_out)
+{
+       TALLOC_CTX *frame = talloc_stackframe();
+       struct ForestTrustInfo *fti = NULL;
+       struct lsa_ForestTrustInformation2 *out = NULL;
+       NTSTATUS status;
+
+       status = trust_forest_info_from_lsa2(frame, in, &fti);
+       if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(frame);
+               return status;
+       }
+
+       status = trust_forest_info_to_lsa2(mem_ctx,
+                                          fti,
+                                          &out);
+       if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(frame);
+               return status;
+       }
+
+       *_out = out;
+       TALLOC_FREE(frame);
+       return NT_STATUS_OK;
+}
+
 static int trust_forest_info_tln_match_internal(
                const struct lsa_ForestTrustInformation2 *info,
                enum lsa_ForestTrustRecordType type,
index 152fa52e389734f4562e49f4710ec6d770429764..8b075f04f246294b7bc3ddb70376f77e511bde94 100644 (file)
@@ -58,6 +58,9 @@ NTSTATUS trust_forest_info_lsa_1to2(TALLOC_CTX *mem_ctx,
 NTSTATUS trust_forest_info_lsa_2to1(TALLOC_CTX *mem_ctx,
                                const struct lsa_ForestTrustInformation2 *lfti2,
                                struct lsa_ForestTrustInformation **_lfti);
+NTSTATUS trust_forest_info_lsa_2to2(TALLOC_CTX *mem_ctx,
+                               const struct lsa_ForestTrustInformation2 *in,
+                               struct lsa_ForestTrustInformation2 **_out);
 
 bool trust_forest_info_tln_match(
                const struct lsa_ForestTrustInformation2 *info,