summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2014-12-22 15:19:47 -0800
committerKarolin Seeger <kseeger@samba.org>2015-01-11 14:03:09 +0100
commitc6ede38e1d1e2fdbe80bd0cbf14062574729172c (patch)
treed5cddc88c5c66c069f6500d02ccfb204da845db2
parent45238fe24d85d877b9dff98667cb0dee95e8c444 (diff)
downloadsamba-c6ede38e1d1e2fdbe80bd0cbf14062574729172c.tar.gz
winbind: Retry LogonControl RPC in ping-dc after session expiration
When the underlying session expires, the LogonControl RPC call used in ping-dc returns NT_STATUS_IO_DEVICE_ERROR. Retry once in this case, instead of returning the error to the caller. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Dec 23 02:46:34 CET 2014 on sn-devel-104 (cherry picked from commit 2fdc55160309cec89aeb88243cb18d058c67e918) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11034
-rw-r--r--source3/winbindd/winbindd_dual_srv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index b8736555791..31ed2cf651b 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -687,12 +687,14 @@ NTSTATUS _wbint_PingDc(struct pipes_struct *p, struct wbint_PingDc *r)
WERROR werr;
fstring logon_server;
struct dcerpc_binding_handle *b;
+ bool retry = false;
domain = wb_child_domain();
if (domain == NULL) {
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
+reconnect:
status = cm_connect_netlogon(domain, &netlogon_pipe);
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
@@ -720,6 +722,14 @@ NTSTATUS _wbint_PingDc(struct pipes_struct *p, struct wbint_PingDc *r)
logon_server, NETLOGON_CONTROL_QUERY,
2, &info, &werr);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_IO_DEVICE_ERROR) && !retry) {
+ DEBUG(10, ("Session might have expired. "
+ "Reconnect and retry once.\n"));
+ invalidate_cm_connection(&domain->conn);
+ retry = true;
+ goto reconnect;
+ }
+
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(2, ("dcerpc_netr_LogonControl failed: %s\n",