One correction (not really important): an error in
sdap_account_info_restart(breq) should not put backend to offline:
+static void sdap_account_info_common_done(int ret, struct be_req *breq,
+ const char *str_on_err)
+{
+ struct sdap_id_ctx *ctx;
+ int dp_err = DP_ERR_OK;
+ const char *errstr = NULL;
+ errno_t err;
+
+ if (ret != EOK) {
+ dp_err = DP_ERR_FATAL;
+ errstr = str_on_err;
+
+ if (ret == ETIMEDOUT || ret == EFAULT || ret == EIO) {
+ ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data,
+ struct sdap_id_ctx);
+ if (sdap_check_gssapi_reconnect(ctx)) {
+ if (ctx->gsh) {
+ /* Mark the connection as false so we don't try to use an
+ * invalid connection by mistake later.
+ * If the global sdap handler is NULL, it's ok not to do
+ * anything here. It's always checked by sdap_connected()
+ * before being used.
+ */
+ ctx->gsh->connected = false;
+ }
+ err = sdap_account_info_restart(breq);
+ if (err == EOK) return;
--- should be ----
+ /* reporting restart error */
+ ret = err;
+ } else {
+
+ /* Couldn't reconnect, that was our last try
+ * Go offline now
+ */
+ dp_err = DP_ERR_OFFLINE;
+ sdap_mark_offline(ctx);
+ }
------------------
+ }
+ }
+
+ sdap_handler_done(breq, dp_err, ret, errstr);
+}