summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-28 00:38:44 +0100
committerGünther Deschner <gd@samba.org>2008-10-29 08:57:28 +0100
commit6f2179b0884cb3f2e4a38516d050707384c8e5ff (patch)
treee9aa25b453a484eacfeafc1a891927c1e5495ad3 /source4
parent4f6264b66c0e9f8d863ee547cc5902d35a0826de (diff)
downloadsamba-6f2179b0884cb3f2e4a38516d050707384c8e5ff.tar.gz
samba-6f2179b0884cb3f2e4a38516d050707384c8e5ff.tar.bz2
samba-6f2179b0884cb3f2e4a38516d050707384c8e5ff.zip
s4-netlogon: merge netr_DatabaseDeltas from s3 idl.
Guenther
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/netlogon.idl10
-rw-r--r--source4/torture/rpc/netlogon.c19
-rw-r--r--source4/torture/rpc/samsync.c29
3 files changed, 37 insertions, 21 deletions
diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl
index 7cb83b3d69..87ddd4704c 100644
--- a/source4/librpc/idl/netlogon.idl
+++ b/source4/librpc/idl/netlogon.idl
@@ -724,12 +724,12 @@ interface netlogon
NTSTATUS netr_DatabaseDeltas(
[in] [string,charset(UTF16)] uint16 logon_server[],
[in] [string,charset(UTF16)] uint16 computername[],
- [in] netr_Authenticator credential,
- [in,out] netr_Authenticator return_authenticator,
+ [in,ref] netr_Authenticator *credential,
+ [in,out,ref] netr_Authenticator *return_authenticator,
[in] netr_SamDatabaseID database_id,
- [in,out] udlong sequence_num,
- [in] uint32 preferredmaximumlength,
- [out,unique] netr_DELTA_ENUM_ARRAY *delta_enum_array
+ [in,out,ref] udlong *sequence_num,
+ [out,ref] netr_DELTA_ENUM_ARRAY **delta_enum_array,
+ [in] uint32 preferredmaximumlength
);
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 232d10323c..6580761aec 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -750,6 +750,9 @@ static bool test_DatabaseDeltas(struct torture_context *tctx,
NTSTATUS status;
struct netr_DatabaseDeltas r;
struct creds_CredentialState *creds;
+ struct netr_Authenticator credential;
+ struct netr_Authenticator return_authenticator;
+ struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL;
const uint32_t database_ids[] = {0, 1, 2};
int i;
@@ -761,20 +764,22 @@ static bool test_DatabaseDeltas(struct torture_context *tctx,
r.in.computername = TEST_MACHINE_NAME;
r.in.preferredmaximumlength = (uint32_t)-1;
ZERO_STRUCT(r.in.return_authenticator);
+ r.out.return_authenticator = &return_authenticator;
+ r.out.delta_enum_array = &delta_enum_array;
for (i=0;i<ARRAY_SIZE(database_ids);i++) {
r.in.database_id = database_ids[i];
- r.in.sequence_num = sequence_nums[r.in.database_id];
+ r.in.sequence_num = &sequence_nums[r.in.database_id];
- if (r.in.sequence_num == 0) continue;
+ if (*r.in.sequence_num == 0) continue;
- r.in.sequence_num -= 1;
+ *r.in.sequence_num -= 1;
torture_comment(tctx, "Testing DatabaseDeltas of id %d at %llu\n",
- r.in.database_id, (unsigned long long)r.in.sequence_num);
+ r.in.database_id, (unsigned long long)*r.in.sequence_num);
do {
- creds_client_authenticator(creds, &r.in.credential);
+ creds_client_authenticator(creds, &credential);
status = dcerpc_netr_DatabaseDeltas(p, tctx, &r);
if (NT_STATUS_EQUAL(status,
@@ -788,11 +793,11 @@ static bool test_DatabaseDeltas(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "DatabaseDeltas");
- if (!creds_client_check(creds, &r.out.return_authenticator.cred)) {
+ if (!creds_client_check(creds, &return_authenticator.cred)) {
torture_comment(tctx, "Credential chaining failed\n");
}
- r.in.sequence_num++;
+ (*r.in.sequence_num)++;
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
}
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index fdd86da28c..88101912e6 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -1313,34 +1313,45 @@ static bool test_DatabaseDeltas(struct samsync_state *samsync_state, TALLOC_CTX
NTSTATUS status;
TALLOC_CTX *loop_ctx;
struct netr_DatabaseDeltas r;
+ struct netr_Authenticator credential;
+ struct netr_Authenticator return_authenticator;
+ struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL;
const uint32_t database_ids[] = {0, 1, 2};
int i;
bool ret = true;
+ ZERO_STRUCT(return_authenticator);
+
r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(samsync_state->p));
r.in.computername = TEST_MACHINE_NAME;
+ r.in.credential = &credential;
r.in.preferredmaximumlength = (uint32_t)-1;
- ZERO_STRUCT(r.in.return_authenticator);
+ r.in.return_authenticator = &return_authenticator;
+ r.out.return_authenticator = &return_authenticator;
+ r.out.delta_enum_array = &delta_enum_array;
for (i=0;i<ARRAY_SIZE(database_ids);i++) {
+
+ uint64_t seq_num = samsync_state->seq_num[i];
+
r.in.database_id = database_ids[i];
- r.in.sequence_num = samsync_state->seq_num[i];
+ r.in.sequence_num = &seq_num;
+ r.out.sequence_num = &seq_num;
- if (r.in.sequence_num == 0) continue;
+ if (seq_num == 0) continue;
/* this shows that the bdc doesn't need to do a single call for
* each seqnumber, and the pdc doesn't need to know about old values
* -- metze
*/
- r.in.sequence_num -= 10;
-
+ seq_num -= 10;
printf("Testing DatabaseDeltas of id %d at %llu\n",
- r.in.database_id, (long long)r.in.sequence_num);
+ r.in.database_id, (long long)seq_num);
do {
loop_ctx = talloc_named(mem_ctx, 0, "test_DatabaseDeltas loop context");
- creds_client_authenticator(samsync_state->creds, &r.in.credential);
+ creds_client_authenticator(samsync_state->creds, &credential);
status = dcerpc_netr_DatabaseDeltas(samsync_state->p, loop_ctx, &r);
if (!NT_STATUS_IS_OK(status) &&
@@ -1350,11 +1361,11 @@ static bool test_DatabaseDeltas(struct samsync_state *samsync_state, TALLOC_CTX
ret = false;
}
- if (!creds_client_check(samsync_state->creds, &r.out.return_authenticator.cred)) {
+ if (!creds_client_check(samsync_state->creds, &return_authenticator.cred)) {
printf("Credential chaining failed\n");
}
- r.in.sequence_num++;
+ seq_num++;
talloc_free(loop_ctx);
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
}