summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-02 04:33:57 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-02 04:33:57 +0000
commit9632db5a19f69500f42211fd53cc38bc18991b83 (patch)
tree07bf9624e5edf9752284ec70a5c10567f56f9eef /source4/torture
parentf9419900d3804c62d17bfd6faf933ecc38197995 (diff)
downloadsamba-9632db5a19f69500f42211fd53cc38bc18991b83.tar.gz
samba-9632db5a19f69500f42211fd53cc38bc18991b83.tar.bz2
samba-9632db5a19f69500f42211fd53cc38bc18991b83.zip
netr_DatabaseSync() now works fully for database 0
(This used to be commit 360d03bb56ec7d129ec0d62a701f4bf0ff3876af)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/netlogon.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index a99ee642f5..d8bacac87c 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<ARRAY_SIZE(database_ids);i++) {
+ r.in.database_id = database_ids[i];
- status = dcerpc_netr_DatabaseSync(p, mem_ctx, &r);
- if (!NT_STATUS_IS_OK(status)) {
- printf("DatabaseSync - %s\n", nt_errstr(status));
- return False;
- }
+ printf("Testing DatabaseSync of id %d\n", r.in.database_id);
- if (!creds_client_check(&creds, &r.out.return_authenticator.cred)) {
- printf("Credential chaining failed\n");
+ do {
+ creds_client_authenticator(&creds, &r.in.credential);
+
+ status = dcerpc_netr_DatabaseSync(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status) &&
+ !NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
+ printf("DatabaseSync - %s\n", nt_errstr(status));
+ ret = False;
+ break;
+ }
+
+ if (!creds_client_check(&creds, &r.out.return_authenticator.cred)) {
+ printf("Credential chaining failed\n");
+ }
+
+ r.in.sync_context = r.out.sync_context;
+ } while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
}
- return True;
+ return ret;
}