The branch, v4-2-test has been updated
       via  d196b54 winbind: Retry after SESSION_EXPIRED error in ping-dc
       via  ec07387 winbind: Retry LogonControl RPC in ping-dc after session 
expiration
      from  4701d74 tdb_wrap: Make mutexes easier to use

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test


- Log -----------------------------------------------------------------
commit d196b54b941fdef76660c5683d4619b7a51ff779
Author: Christof Schmitt <c...@samba.org>
Date:   Fri Dec 19 12:24:53 2014 -0700

    winbind: Retry after SESSION_EXPIRED error in ping-dc
    
    Trying to establish a netlogon connection when the service ticket
    expires might fail with NT_STATUS_NETWORK_SESSION_EXPIRED. The
    underlying client code already marks the session as invalid, so retry
    the netlogon connect in this case.
    
    Signed-off-by: Christof Schmit <c...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Tue Jan  6 02:58:57 CET 2015 on sn-devel-104
    (cherry picked from commit a2670f15dea27c10e3827216adf572f9c3894f85)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11034
    
    Autobuild-User(v4-2-test): Karolin Seeger <ksee...@samba.org>
    Autobuild-Date(v4-2-test): Tue Jan 13 23:17:05 CET 2015 on sn-devel-104

commit ec07387d242b851b16821725edc858ed114e5461
Author: Christof Schmitt <c...@samba.org>
Date:   Mon Dec 22 15:19:47 2014 -0800

    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 <c...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@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

-----------------------------------------------------------------------

Summary of changes:
 source3/winbindd/winbindd_dual_srv.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_dual_srv.c 
b/source3/winbindd/winbindd_dual_srv.c
index 5e33787..c19179d 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -668,13 +668,23 @@ 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);
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_SESSION_EXPIRED)) {
+               /*
+                * Retry to open new connection with new kerberos ticket.
+                */
+               invalidate_cm_connection(&domain->conn);
+               status = cm_connect_netlogon(domain, &netlogon_pipe);
+       }
+
        reset_cm_connection_on_error(domain, status);
         if (!NT_STATUS_IS_OK(status)) {
                DEBUG(3, ("could not open handle to NETLOGON pipe: %s\n",
@@ -701,6 +711,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",


-- 
Samba Shared Repository

Reply via email to