diff options
Diffstat (limited to 'source3/auth/auth_domain.c')
-rw-r--r-- | source3/auth/auth_domain.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index bedd318c3c..8ad6329da9 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -50,6 +50,8 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, NTSTATUS result; struct rpc_pipe_client *netlogon_pipe = NULL; + *cli = NULL; + *pipe_ret = NULL; /* TODO: Send a SAMLOGON request to determine whether this is a valid @@ -81,6 +83,11 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, result = NT_STATUS_NO_LOGON_SERVERS; } + if (*cli) { + cli_shutdown(*cli); + *cli = NULL; + } + release_server_mutex(); return result; } @@ -111,6 +118,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return result; } @@ -126,6 +134,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); "trust account password for domain '%s'\n", domain)); cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } @@ -141,6 +150,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); if (!NT_STATUS_IS_OK(result)) { cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return result; } @@ -150,6 +160,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result))); DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \ machine %s. Error was : %s.\n", dc_name, cli_errstr(*cli))); cli_shutdown(*cli); + *cli = NULL; release_server_mutex(); return NT_STATUS_NO_LOGON_SERVERS; } |