From de32d669c6b7eb0053b843726e9520b1e20c85f6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Dec 2003 12:01:10 +0000 Subject: added netr_DatabaseSync2() (This used to be commit 0f6af0c4bde0eb3758192b74dab797b558c944a1) --- source4/librpc/idl/netlogon.idl | 20 +++++++-------- source4/torture/rpc/netlogon.c | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 10 deletions(-) diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl index 548209e0f4..b4506c6db7 100644 --- a/source4/librpc/idl/netlogon.idl +++ b/source4/librpc/idl/netlogon.idl @@ -750,23 +750,23 @@ interface netlogon [in,out,ref] uint32 *negotiate_flags ); -#if 0 /*****************/ /* Function 0x10 */ NTSTATUS netr_DatabaseSync2( - [in][string][ref] wchar_t *logon_server, # REF!!! - [in][string][ref] wchar_t *computername, - [in][ref] AUTHENTICATOR credential, - [in][out][ref] AUTHENTICATOR return_authenticator, - [in] uint32 database_id, - [in] uint16 restart_state, - [in][out][ref] uint32 *sync_context, - [in] uint32 preferredmaximumlength, - [out] netr_DELTA_ENUM_ARRAY *delta_enum_array + [in] unistr logon_server, + [in] unistr computername, + [in] netr_Authenticator credential, + [in,out] netr_Authenticator return_authenticator, + [in] uint32 database_id, + [in] uint16 restart_state, + [in,out] uint32 sync_context, + [in] uint32 preferredmaximumlength, + [out] netr_DELTA_ENUM_ARRAY *delta_enum_array ); +#if 0 /*****************/ /* Function 0x11 */ diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index b5a981c531..e7d77b35d1 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -646,6 +646,57 @@ static BOOL test_LogonControl2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } +/* + try a netlogon DatabaseSync2 +*/ +static BOOL test_DatabaseSync2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct netr_DatabaseSync2 r; + struct netr_CredentialState creds; + const uint32 database_ids[] = {0, 1, 2}; + int i; + BOOL ret = True; + + if (!test_SetupCredentials2(p, mem_ctx, &creds)) { + return False; + } + + r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); + r.in.computername = lp_netbios_name(); + r.in.preferredmaximumlength = (uint32)-1; + ZERO_STRUCT(r.in.return_authenticator); + + for (i=0;i