winbindd: Retry on expired session in cm_connect_netlogon
authorChristof Schmitt <cs@samba.org>
Tue, 5 Jan 2016 22:10:45 +0000 (15:10 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 12 Jan 2016 23:26:16 +0000 (00:26 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/winbindd_cm.c

index c0891ce83036a88382e984666f658718cbd63347..f593d24619b7d999aeb44ddbdec11181fad6a459 100644 (file)
@@ -3406,6 +3406,14 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
        }
 
        status = cm_connect_netlogon_transport(domain, NCACN_NP, cli);
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_SESSION_EXPIRED)) {
+               /*
+                * SMB2 session expired, needs reauthentication. Drop
+                * connection and retry.
+                */
+               invalidate_cm_connection(domain);
+               status = cm_connect_netlogon_transport(domain, NCACN_NP, cli);
+       }
 
        return status;
 }