From: Gerald Carter Date: Wed, 8 Feb 2006 04:03:47 +0000 (+0000) Subject: r13382: added server affinity cache stores for 'net rpc join' and trusted domain... X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~3754 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=9eb743584d32cdb67e0512ac915c34565bce1c01 r13382: added server affinity cache stores for 'net rpc join' and trusted domain code --- diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c index 81ae7c13400..c91cbf7af11 100644 --- a/source/auth/auth_domain.c +++ b/source/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/source/utils/net.c b/source/utils/net.c index 069047c9ec8..032c65bc592 100644 --- a/source/utils/net.c +++ b/source/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/source/utils/net_rpc.c b/source/utils/net_rpc.c index a9dc3a1fc65..85b09f9e07c 100644 --- a/source/utils/net_rpc.c +++ b/source/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)