summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2002-10-14 12:09:13 +0000
committerVolker Lendecke <vlendec@samba.org>2002-10-14 12:09:13 +0000
commit4d0a35c55e41648cef0213bea6ae4795feca0787 (patch)
treeb351c0a4bc9e2fc39c4c0e2a0992934640729fd8
parent4ac9ccfde4d36e3b6065c65c92dd02dddb78b4f2 (diff)
downloadsamba-4d0a35c55e41648cef0213bea6ae4795feca0787.tar.gz
samba-4d0a35c55e41648cef0213bea6ae4795feca0787.tar.bz2
samba-4d0a35c55e41648cef0213bea6ae4795feca0787.zip
In my test, sync_context simply has to be incremented. Can
somebody with a large domain do a net rpc samdump to verify this? Without this change, I don't get everything from a NT4 SP1 and SP6 PDC. Volker (This used to be commit f6a9180a5ff62932de0d4f890092b0d8281e9d6e)
-rw-r--r--source3/utils/net_rpc_samsync.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index af778fcc0a..4b0163bcf5 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -111,7 +111,7 @@ static void display_sam_entry(SAM_DELTA_HDR *hdr_delta, SAM_DELTA_CTR *delta)
static void dump_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds)
{
- unsigned last_rid = -1;
+ unsigned sync_context = 0;
NTSTATUS result;
int i;
TALLOC_CTX *mem_ctx;
@@ -126,15 +126,15 @@ static void dump_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret
d_printf("Dumping database %u\n", db_type);
do {
- result = cli_netlogon_sam_sync(cli, mem_ctx, ret_creds, db_type, last_rid+1,
+ result = cli_netlogon_sam_sync(cli, mem_ctx, ret_creds, db_type,
+ sync_context,
&num_deltas, &hdr_deltas, &deltas);
clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), ret_creds);
- last_rid = 0;
for (i = 0; i < num_deltas; i++) {
display_sam_entry(&hdr_deltas[i], &deltas[i]);
- last_rid = hdr_deltas[i].target_rid;
}
- } while (last_rid && NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
+ sync_context += 1;
+ } while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
talloc_destroy(mem_ctx);
}
@@ -620,7 +620,7 @@ static void
fetch_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds,
DOM_SID dom_sid)
{
- unsigned last_rid = -1;
+ unsigned sync_context = 0;
NTSTATUS result;
int i;
TALLOC_CTX *mem_ctx;
@@ -636,17 +636,16 @@ fetch_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds,
do {
result = cli_netlogon_sam_sync(cli, mem_ctx, ret_creds,
- db_type, last_rid+1,
+ db_type, sync_context,
&num_deltas,
&hdr_deltas, &deltas);
clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred),
ret_creds);
- last_rid = 0;
for (i = 0; i < num_deltas; i++) {
fetch_sam_entry(&hdr_deltas[i], &deltas[i], dom_sid);
- last_rid = hdr_deltas[i].target_rid;
}
- } while (last_rid && NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
+ sync_context += 1;
+ } while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
talloc_destroy(mem_ctx);
}