[SSSD] [PATCH 4/5] Streamline ipa_account_info handler

Jakub Hrozek jhrozek at redhat.com
Tue Nov 6 08:09:36 UTC 2012


On Wed, Oct 31, 2012 at 06:37:34PM -0400, Simo Sorce wrote:
> ---
>  src/providers/ipa/ipa_id.c |  128 ++++++++++++++++++++++++--------------------
>  1 files changed, 69 insertions(+), 59 deletions(-)
> 
> diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
> index ab0d8924013941943babb32a96f03560aea8c7f3..7afa6df6fbd841309d33866caf080be12eac170f 100644
> --- a/src/providers/ipa/ipa_id.c
> +++ b/src/providers/ipa/ipa_id.c
> @@ -30,14 +30,38 @@
>  #include "providers/ldap/sdap_async.h"
>  #include "providers/ipa/ipa_id.h"
>  
> +static const char *ipa_account_info_error_text(int ret, int *dp_error,
> +                                               const char *default_text)
> +{
> +    switch (*dp_error) {
> +    case DP_ERR_OK:
> +        if (ret == EOK) {
> +            return NULL;
> +        }
> +        DEBUG(1, ("Bug: dp_error is OK on failed request"));

There's a legacy debug level used here.

> +        *dp_error = DP_ERR_FATAL;
> +        break;
> +    case DP_ERR_OFFLINE:
> +        return "Offline";
> +    case DP_ERR_FATAL:
> +        if (ret == ENOMEM) {
> +            return "Out of memory";
> +        }
> +        break;
> +    default:
> +        break;
> +    }
> +
> +    return  default_text;

Double space.

I can fix both of these before pushing, no big deal. The logic of the
patches is good.

> +}
> +

Otherwise Ack.



More information about the sssd-devel mailing list