summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-02-08 04:03:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:09:57 -0500
commitf351b9c6eb05fc051d639ee47e3dd56a4de7ec16 (patch)
tree2ddc91c890d1851684ffe4fcf360a7fb5f89773e
parent845e49bdab36fc9e16b0e8440cfa0a427c240a21 (diff)
downloadsamba-f351b9c6eb05fc051d639ee47e3dd56a4de7ec16.tar.gz
samba-f351b9c6eb05fc051d639ee47e3dd56a4de7ec16.tar.bz2
samba-f351b9c6eb05fc051d639ee47e3dd56a4de7ec16.zip
r13382: added server affinity cache stores for 'net rpc join' and trusted domain code
(This used to be commit 9eb743584d32cdb67e0512ac915c34565bce1c01)
-rw-r--r--source3/auth/auth_domain.c4
-rw-r--r--source3/utils/net.c5
-rw-r--r--source3/utils/net_rpc.c4
3 files changed, 13 insertions, 0 deletions
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)