r13382: added server affinity cache stores for 'net rpc join' and trusted domain...
authorGerald Carter <jerry@samba.org>
Wed, 8 Feb 2006 04:03:47 +0000 (04:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:09:57 +0000 (11:09 -0500)
source/auth/auth_domain.c
source/utils/net.c
source/utils/net_rpc.c

index 81ae7c134004f93964d1eacec83565e4550fbded..c91cbf7af110a36ca881041062475a1be4ad3a44 100644 (file)
@@ -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);
 
         /*
index 069047c9ec82c4d554232963fe9bab5a23f05b4f..032c65bc59296e79179b4c172f480d237d2366b5 100644 (file)
@@ -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;
index a9dc3a1fc65f13f82d83f82826849c236109c744..85b09f9e07c11b72b4d86c02b5efaf925f30458b 100644 (file)
@@ -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)