From: Ralph Boehme Date: Mon, 12 Mar 2018 12:39:59 +0000 (+0100) Subject: winbindd: force netlogon reauth for certain errors in reset_cm_connection_on_error() X-Git-Tag: talloc-2.1.12~176 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d1f00cc3ad77bed4e810dc910979e6cdf582216;p=thirdparty%2Fsamba.git winbindd: force netlogon reauth for certain errors in reset_cm_connection_on_error() NT_STATUS_RPC_SEC_PKG_ERROR is returned by the server if the server doesn't know the server-side netlogon credentials anymore, eg after a reboot. If this happens we must force a full netlogon reauth. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13332 Signed-off-by: Volker Lendecke Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c index 861451c0fc9..10345fb81d2 100644 --- a/source3/winbindd/winbindd_dual_srv.c +++ b/source3/winbindd/winbindd_dual_srv.c @@ -44,6 +44,14 @@ void _wbint_Ping(struct pipes_struct *p, struct wbint_Ping *r) bool reset_cm_connection_on_error(struct winbindd_domain *domain, NTSTATUS status) { + 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); + domain->conn.netlogon_force_reauth = true; + return true; + } + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) || NT_STATUS_EQUAL(status, NT_STATUS_IO_DEVICE_ERROR)) {