/* And restore our original timeout. */
rpccli_set_timeout(cli, orig_timeout);
+ if (NT_STATUS_V(status) == DCERPC_FAULT_ACCESS_DENIED ||
+ NT_STATUS_V(status) == DCERPC_FAULT_SEC_PKG_ERROR) {
+ /*
+ * This can happen if the schannel key is not
+ * valid anymore, we need to invalidate the
+ * all connections to the dc and reestablish
+ * a netlogon connection first.
+ */
+ invalidate_cm_connection(&domain->conn);
+ status = NT_STATUS_ACCESS_DENIED;
+ }
+
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
return status;
}
/* And restore our original timeout. */
rpccli_set_timeout(cli, orig_timeout);
+ if (NT_STATUS_V(status) == DCERPC_FAULT_ACCESS_DENIED ||
+ NT_STATUS_V(status) == DCERPC_FAULT_SEC_PKG_ERROR) {
+ /*
+ * This can happen if the schannel key is not
+ * valid anymore, we need to invalidate the
+ * all connections to the dc and reestablish
+ * a netlogon connection first.
+ */
+ invalidate_cm_connection(&domain->conn);
+ status = NT_STATUS_ACCESS_DENIED;
+ }
+
if (!NT_STATUS_IS_OK(status)) {
return status;
}