On 05/07/2010 06:43 PM, Dmitri Pal wrote:
Eugene Indenbom wrote:
> One correction (not really important): an error in
> sdap_account_info_restart(breq) should not put backend to offline:
>
>
If you do this way shouldn't you set the errstr too?
Sure, just could not think out a good text right away.
But the main point is that sdap_mark_offline is in else branch.
> +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);
> +}
>
>
> _______________________________________________
> sssd-devel mailing list
> sssd-devel(a)lists.fedorahosted.org
>
https://fedorahosted.org/mailman/listinfo/sssd-devel
>
>