diff options
author | Tim Potter <tpot@samba.org> | 2003-05-12 07:18:36 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-05-12 07:18:36 +0000 |
commit | 1a38fcb22a98420aa185fb9a807c6b162eda708b (patch) | |
tree | 202f80a04548001d3ad21956be17ce8b82d8b3a8 /source3 | |
parent | 5b776f179aa7ac7af731e317e51ec6d560e1d463 (diff) | |
download | samba-1a38fcb22a98420aa185fb9a807c6b162eda708b.tar.gz samba-1a38fcb22a98420aa185fb9a807c6b162eda708b.tar.bz2 samba-1a38fcb22a98420aa185fb9a807c6b162eda708b.zip |
Re-enable secure channel for net rpc vampire.
Jump out of sam entry processing loop if the return value from
cli_netlogon_sam_sync() isn't OK or STATUS_MORE_ENTRIES.
(This used to be commit 47d8ee3679292ece5d86df11bc56c9b4d71f3d11)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index fd00fa6bc3..ae6f52ebc4 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -935,11 +935,17 @@ fetch_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds, db_type, sync_context, &num_deltas, &hdr_deltas, &deltas); - clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), - ret_creds); - for (i = 0; i < num_deltas; i++) { - fetch_sam_entry(&hdr_deltas[i], &deltas[i], dom_sid); - } + + if (NT_STATUS_IS_OK(result) || + NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) { + + clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), + ret_creds); + + for (i = 0; i < num_deltas; i++) { + fetch_sam_entry(&hdr_deltas[i], &deltas[i], dom_sid); + } + } sync_context += 1; } while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)); @@ -953,7 +959,6 @@ int rpc_vampire(int argc, const char **argv) struct cli_state *cli = NULL; uchar trust_password[16]; DOM_CRED ret_creds; - uint32 neg_flags = 0x000001ff; DOM_SID dom_sid; uint32 sec_channel; @@ -977,8 +982,8 @@ int rpc_vampire(int argc, const char **argv) goto fail; } - result = cli_nt_setup_creds(cli, sec_channel, trust_password, - &neg_flags, 2); + result = cli_nt_establish_netlogon(cli, sec_channel, trust_password); + if (!NT_STATUS_IS_OK(result)) { d_printf("Failed to setup BDC creds\n"); goto fail; |