summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-09-23 10:35:21 -0700
committerAndrew Bartlett <abartlet@samba.org>2014-10-08 01:09:50 +0200
commit91d6f603b196d1f10500dff312d614d8d46cb846 (patch)
treee552fc7760b54d5176642d3f693218e24fc8b364
parent3783f49abd77887f32bc2d95be50468ac1f5f81b (diff)
downloadsamba-91d6f603b196d1f10500dff312d614d8d46cb846.tar.gz
samba-91d6f603b196d1f10500dff312d614d8d46cb846.tar.xz
samba-91d6f603b196d1f10500dff312d614d8d46cb846.zip
s3-winbindd: Pass the whole winbindd_domain to invalidate_cm_connection()
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source3/winbindd/winbindd_cache.c2
-rw-r--r--source3/winbindd/winbindd_cm.c19
-rw-r--r--source3/winbindd/winbindd_dual.c2
-rw-r--r--source3/winbindd/winbindd_dual_srv.c4
-rw-r--r--source3/winbindd/winbindd_msrpc.c4
-rw-r--r--source3/winbindd/winbindd_pam.c8
-rw-r--r--source3/winbindd/winbindd_proto.h2
7 files changed, 21 insertions, 20 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 06b29de5df..b303ae904c 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -1521,7 +1521,7 @@ do_query:
if (NT_STATUS_EQUAL(status, NT_STATUS_UNSUCCESSFUL)) {
DEBUG(3, ("query_user_list: flushing "
"connection cache\n"));
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
}
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
NT_STATUS_EQUAL(status, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND)) {
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index fd414b8827..ef7c17ab5e 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1836,9 +1836,10 @@ static NTSTATUS cm_open_connection(struct winbindd_domain *domain,
/* Close down all open pipes on a connection. */
-void invalidate_cm_connection(struct winbindd_cm_conn *conn)
+void invalidate_cm_connection(struct winbindd_domain *domain)
{
NTSTATUS result;
+ struct winbindd_cm_conn *conn = &domain->conn;
/* We're closing down a possibly dead
connection. Don't have impossibly long (10s) timeouts. */
@@ -1924,7 +1925,7 @@ void close_conns_after_fork(void)
smbXcli_conn_disconnect(domain->conn.cli->conn, NT_STATUS_OK);
}
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
}
for (cli_state = winbindd_client_list();
@@ -1980,7 +1981,7 @@ static NTSTATUS init_dc_connection_network(struct winbindd_domain *domain, bool
return NT_STATUS_OK;
}
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
if (!domain->primary && !domain->initialized) {
/*
@@ -2715,7 +2716,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
ZERO_STRUCT(conn->sam_domain_handle);
return status;
} else if (!NT_STATUS_IS_OK(status)) {
- invalidate_cm_connection(conn);
+ invalidate_cm_connection(domain);
return status;
}
@@ -2908,7 +2909,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
&conn->lsa_policy);
done:
if (!NT_STATUS_IS_OK(result)) {
- invalidate_cm_connection(conn);
+ invalidate_cm_connection(domain);
return result;
}
@@ -2933,7 +2934,7 @@ NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) ||
NT_STATUS_EQUAL(status, NT_STATUS_RPC_SEC_PKG_ERROR) ||
NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
status = cm_connect_lsa_tcp(domain, mem_ctx, cli);
}
if (NT_STATUS_IS_OK(status)) {
@@ -3060,14 +3061,14 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
"must set 'winbind sealed pipes = false' and "
"'require strong key = false' to proceed: %s\n",
domain->name, nt_errstr(result)));
- invalidate_cm_connection(conn);
+ invalidate_cm_connection(domain);
return result;
}
result = cli_rpc_pipe_open_noauth(conn->cli,
&ndr_table_netlogon,
&conn->netlogon_pipe);
if (!NT_STATUS_IS_OK(result)) {
- invalidate_cm_connection(conn);
+ invalidate_cm_connection(domain);
return result;
}
@@ -3089,7 +3090,7 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
DEBUG(3, ("Could not open schannel'ed NETLOGON pipe. Error "
"was %s\n", nt_errstr(result)));
- invalidate_cm_connection(conn);
+ invalidate_cm_connection(domain);
return result;
}
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index ed081d07b3..f71d111c7d 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1072,7 +1072,7 @@ static void machine_password_change_handler(struct tevent_context *ctx,
"password was changed and we didn't know it. "
"Killing connections to domain %s\n",
child->domain->name));
- invalidate_cm_connection(&child->domain->conn);
+ invalidate_cm_connection(child->domain);
}
if (!calculate_next_machine_pwd_change(child->domain->name,
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index 5e33787bd3..108b201065 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -40,7 +40,7 @@ static bool reset_cm_connection_on_error(struct winbindd_domain *domain,
NTSTATUS status)
{
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
/* We invalidated the connection. */
return true;
}
@@ -580,7 +580,7 @@ NTSTATUS _wbint_CheckMachineAccount(struct pipes_struct *p,
}
again:
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
domain->conn.netlogon_force_reauth = true;
{
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c
index 99021aef16..8454f93c03 100644
--- a/source3/winbindd/winbindd_msrpc.c
+++ b/source3/winbindd/winbindd_msrpc.c
@@ -1138,7 +1138,7 @@ NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
* all connections to the dc and reestablish
* a netlogon connection first.
*/
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
domain->can_do_ncacn_ip_tcp = domain->active_directory;
if (!retried) {
retried = true;
@@ -1218,7 +1218,7 @@ static NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
* all connections to the dc and reestablish
* a netlogon connection first.
*/
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
if (!retried) {
retried = true;
goto connect;
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 51dc2ea4f6..53519375c7 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1326,7 +1326,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
DEBUG(3, ("This is again a problem for this "
"particular call, forcing the close "
"of this connection\n"));
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
}
/* After the second retry failover to the next DC */
@@ -1411,7 +1411,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
"password was changed and we didn't know it. "
"Killing connections to domain %s\n",
domainname));
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
retry = true;
}
@@ -1434,7 +1434,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
* In order to recover from this situation, we need to
* drop the connection.
*/
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
result = NT_STATUS_LOGON_FAILURE;
break;
}
@@ -1446,7 +1446,7 @@ static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain,
"returned NT_STATUS_IO_TIMEOUT after the retry."
"Killing connections to domain %s\n",
domainname));
- invalidate_cm_connection(&domain->conn);
+ invalidate_cm_connection(domain);
}
return result;
}
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 9ba379ead4..77e1dbefc4 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -167,7 +167,7 @@ struct ndr_interface_table;
NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
const struct ndr_interface_table *table,
struct rpc_pipe_client **ret_pipe);
-void invalidate_cm_connection(struct winbindd_cm_conn *conn);
+void invalidate_cm_connection(struct winbindd_domain *domain);
void close_conns_after_fork(void);
NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,