From f351b9c6eb05fc051d639ee47e3dd56a4de7ec16 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Feb 2006 04:03:47 +0000 Subject: r13382: added server affinity cache stores for 'net rpc join' and trusted domain code (This used to be commit 9eb743584d32cdb67e0512ac915c34565bce1c01) --- source3/auth/auth_domain.c | 4 ++++ source3/utils/net.c | 5 +++++ source3/utils/net_rpc.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index 81ae7c1340..c91cbf7af1 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -210,6 +210,10 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx, return nt_status; } + /* store a successful connection */ + + saf_store( domain, cli->desthost ); + ZERO_STRUCT(info3); /* diff --git a/source3/utils/net.c b/source3/utils/net.c index 069047c9ec..032c65bc59 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -395,6 +395,11 @@ struct cli_state *net_make_ipc_connection(unsigned flags) nt_status = connect_to_ipc(&cli, &server_ip, server_name); } + /* store the server in the affinity cache if it was a PDC */ + + if ( flags & NET_FLAGS_PDC ) + saf_store( cli->server_domain, cli->desthost ); + SAFE_FREE(server_name); if (NT_STATUS_IS_OK(nt_status)) { return cli; diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index a9dc3a1fc6..85b09f9e07 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -5541,6 +5541,10 @@ static int rpc_trustdom_establish(int argc, const char **argv) nt_errstr(nt_status))); return -1; } + + /* store who we connected to */ + + saf_store( domain_name, cli->desthost ); /* * Connect to \\server\ipc$ again (this time anonymously) -- cgit