1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

netlogon.idl: fix the marshalling of netr_trust_extension_container for NDR64

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2019-08-15 13:22:43 +02:00 committed by Günther Deschner
parent 0fea2707fb
commit 8f0751b8b7
3 changed files with 30 additions and 22 deletions

View File

@ -1386,21 +1386,27 @@ interface netlogon
} netr_WorkstationInfo;
typedef struct {
/* these first 3 values come from the fact windows
actually encodes this structure as a UNICODE_STRING
- see MS-NRPC section 2.2.1.3.9 */
[value(8)] uint32 length;
[value(0)] uint32 dummy;
[value(8)] uint32 size;
netr_TrustFlags flags;
uint32 parent_index;
lsa_TrustType trust_type;
lsa_TrustAttributes trust_attributes;
} netr_trust_extension_info;
typedef struct {
/* these first 3 values come from the fact windows
actually encodes this structure as a UNICODE_STRING
- see MS-NRPC section 2.2.1.3.9 */
[value(8)] uint3264 length;
[value(0)] uint3264 dummy;
[value(8)] uint3264 size;
[subcontext(0),subcontext_size(size*2)]
netr_trust_extension_info info;
} netr_trust_extension;
typedef struct {
uint16 length; /* value is 16 when info != NULL, otherwise 0 */
[value(length)] uint16 size; /* value is 16 when info != NULL, otherwise 0 */
/* value is 16 when info != NULL, otherwise 0 */
[value(info == NULL ? 0 : 16)] uint16 length;
[value(info == NULL ? 0 : 16)] uint16 size;
netr_trust_extension *info;
} netr_trust_extension_container;

View File

@ -2203,13 +2203,15 @@ static NTSTATUS fill_our_one_domain_info(TALLOC_CTX *mem_ctx,
ZERO_STRUCTP(info);
if (is_trust_list) {
struct netr_trust_extension *tei = NULL;
struct netr_trust_extension *te = NULL;
struct netr_trust_extension_info *tei = NULL;
/* w2k8 only fills this on trusted domains */
tei = talloc_zero(mem_ctx, struct netr_trust_extension);
if (tei == NULL) {
te = talloc_zero(mem_ctx, struct netr_trust_extension);
if (te == NULL) {
return NT_STATUS_NO_MEMORY;
}
tei = &te->info;
tei->flags |= NETR_TRUST_FLAG_PRIMARY;
/*
@ -2230,8 +2232,7 @@ static NTSTATUS fill_our_one_domain_info(TALLOC_CTX *mem_ctx,
*/
tei->trust_attributes = 0;
info->trust_extension.info = tei;
info->trust_extension.length = 16;
info->trust_extension.info = te;
}
if (is_trust_list) {
@ -2264,15 +2265,17 @@ static NTSTATUS fill_trust_one_domain_info(TALLOC_CTX *mem_ctx,
const struct lsa_TrustDomainInfoInfoEx *tdo,
struct netr_OneDomainInfo *info)
{
struct netr_trust_extension *tei = NULL;
struct netr_trust_extension *te = NULL;
struct netr_trust_extension_info *tei = NULL;
ZERO_STRUCTP(info);
/* w2k8 only fills this on trusted domains */
tei = talloc_zero(mem_ctx, struct netr_trust_extension);
if (tei == NULL) {
te = talloc_zero(mem_ctx, struct netr_trust_extension);
if (te == NULL) {
return NT_STATUS_NO_MEMORY;
}
tei = &te->info;
if (tdo->trust_direction & LSA_TRUST_DIRECTION_INBOUND) {
tei->flags |= NETR_TRUST_FLAG_INBOUND;
@ -2294,8 +2297,7 @@ static NTSTATUS fill_trust_one_domain_info(TALLOC_CTX *mem_ctx,
tei->trust_type = tdo->trust_type;
tei->trust_attributes = tdo->trust_attributes;
info->trust_extension.info = tei;
info->trust_extension.length = 16;
info->trust_extension.info = te;
info->domainname.string = tdo->netbios_name.string;
if (tdo->trust_type != LSA_TRUST_TYPE_DOWNLEVEL) {

View File

@ -4096,7 +4096,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
struct dcerpc_binding_handle *b = NULL;
struct netr_OneDomainInfo *odi1 = NULL;
struct netr_OneDomainInfo *odi2 = NULL;
struct netr_trust_extension *tex2 = NULL;
struct netr_trust_extension_info *tex2 = NULL;
torture_comment(tctx, "Testing netr_LogonGetDomainInfo\n");
@ -4481,13 +4481,13 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
for (i=0; i < info.domain_info->trusted_domain_count; i++) {
struct netr_OneDomainInfo *odiT =
&info.domain_info->trusted_domains[i];
struct netr_trust_extension *texT = NULL;
struct netr_trust_extension_info *texT = NULL;
torture_assert_int_equal(tctx, odiT->trust_extension.length, 16,
"trust_list should have extension");
torture_assert(tctx, odiT->trust_extension.info != NULL,
"trust_list should have extension");
texT = odiT->trust_extension.info;
texT = &odiT->trust_extension.info->info;
if (GUID_equal(&odiT->domain_guid, &odi1->domain_guid)) {
odi2 = odiT;
@ -4562,7 +4562,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
"trust_list should have extension");
torture_assert(tctx, odi2->trust_extension.info != NULL,
"trust_list should have extension");
tex2 = odi2->trust_extension.info;
tex2 = &odi2->trust_extension.info->info;
torture_assert_int_equal(tctx,
tex2->flags & NETR_TRUST_FLAG_PRIMARY,
NETR_TRUST_FLAG_PRIMARY,