From 9632db5a19f69500f42211fd53cc38bc18991b83 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Dec 2003 04:33:57 +0000 Subject: [PATCH] netr_DatabaseSync() now works fully for database 0 (This used to be commit 360d03bb56ec7d129ec0d62a701f4bf0ff3876af) --- source4/librpc/idl/lsa.idl | 4 ++-- source4/librpc/idl/netlogon.idl | 23 ++++++++----------- source4/torture/rpc/netlogon.c | 40 +++++++++++++++++++++------------ 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl index c90654d9416..d4829097bdc 100644 --- a/source4/librpc/idl/lsa.idl +++ b/source4/librpc/idl/lsa.idl @@ -55,7 +55,7 @@ /******************/ /* Function: 0x03 */ - typedef struct { + typedef [public] struct { uint32 size; [subcontext(4)] security_descriptor *sd; } sec_desc_buf; @@ -216,7 +216,7 @@ dom_sid2 *sid; } lsa_SidPtr; - typedef struct { + typedef [public] struct { uint32 num_sids; [size_is(num_sids)] lsa_SidPtr *sids; } lsa_SidArray; diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl index a7c61d852a5..7e15102043b 100644 --- a/source4/librpc/idl/netlogon.idl +++ b/source4/librpc/idl/netlogon.idl @@ -336,7 +336,7 @@ interface netlogon uint16 CodePage; USER_PRIVATE_INFO user_private_info; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -358,7 +358,7 @@ interface netlogon NTTIME domain_modify_time; NTTIME domain_create_time; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -374,7 +374,7 @@ interface netlogon netr_GroupMembership group_membership; netr_String comment; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -412,7 +412,7 @@ interface netlogon netr_String alias_name; uint32 rid; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -424,12 +424,7 @@ interface netlogon } DELTA_ALIAS; typedef struct { - uint32 count; - [size_is(count)] dom_sid2 *sids; - } netr_SidArray; - - typedef struct { - netr_SidArray sids; + lsa_SidArray sids; uint32 unknown1; uint32 unknown2; uint32 unknown3; @@ -457,7 +452,7 @@ interface netlogon NTTIME db_modify_time; NTTIME db_create_time; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -473,7 +468,7 @@ interface netlogon uint32 num_controllers; [size_is(num_controllers)] netr_String *controller_names; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -491,7 +486,7 @@ interface netlogon [size_is(privilege_entries)] netr_String *privilege_name; QUOTA_LIMITS quotalimits; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; @@ -514,7 +509,7 @@ interface netlogon CIPHER_VALUE old_cipher; NTTIME old_cipher_set_time; uint32 SecurityInformation; - security_descriptor sec_desc; + sec_desc_buf sdbuf; netr_String unknown1; netr_String unknown2; netr_String unknown3; diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index a99ee642f53..d8bacac87ce 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -248,33 +248,45 @@ static BOOL test_DatabaseSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) NTSTATUS status; struct netr_DatabaseSync r; struct netr_CredentialState creds; + const uint32 database_ids[] = {0, 1, 2}; + int i; + BOOL ret = True; if (!test_SetupCredentials(p, mem_ctx, &creds)) { return False; } - creds_client_authenticator(&creds, &r.in.credential); - ZERO_STRUCT(r.in.return_authenticator); - r.in.logonserver = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); r.in.computername = lp_netbios_name(); - r.in.database_id = 1; r.in.sync_context = 0; r.in.preferredmaximumlength = (uint32)-1; + ZERO_STRUCT(r.in.return_authenticator); - printf("Testing DatabaseSync\n"); + for (i=0;i