[SSSD] [PATCH] LDAP: Add a new error code for malformed access control filter

Sumit Bose sbose at redhat.com
Thu Jan 9 09:39:25 UTC 2014


On Wed, Jan 08, 2014 at 05:55:35PM +0100, Jakub Hrozek wrote:
> Hi,
> 
> the attached patch solves https://fedorahosted.org/sssd/ticket/2164 by
> special casing an openldap return code.
> 
> One drawback of the patch is that if the new return code bubbles all the
> way up, calls to strerror (as opposed to sss_strerror) wouldn't be able
> to print a nice error message. This patch at least converts direct
> consumers of the generic_search request.

I think we should just start using sss_strerror() in new code and
replace strerror() in old code we modify.

...

>  
> diff --git a/src/util/util_errors.c b/src/util/util_errors.c
> index 114c8b04fd354b166d14e526a3bab6a6c0c05951..6860151e1e2fdefd9ebda4005276c6211c447607 100644
> --- a/src/util/util_errors.c
> +++ b/src/util/util_errors.c
> @@ -51,6 +51,7 @@ struct err_string error_to_str[] = {
>      { "Entry not found" }, /* ERR_NOT_FOUND */
>      { "Domain not found" }, /* ERR_DOMAIN_NOT_FOUND */
>      { "Missing configuration file" }, /* ERR_MISSING_CONF */
> +    { "Malformed search filter" }, /* ERR_LDAP_INVALID_FILTER */

minor nitpick                                ^^^^^

otherwise ACK

bye,
Sumit

>  };
>  
>  
> diff --git a/src/util/util_errors.h b/src/util/util_errors.h
> index bca45f392b0357c3f1c848768358cb1d47514715..1332085031dbe6935cbdc94543fa14b09fe81028 100644
> --- a/src/util/util_errors.h
> +++ b/src/util/util_errors.h
> @@ -73,6 +73,7 @@ enum sssd_errors {
>      ERR_NOT_FOUND,
>      ERR_DOMAIN_NOT_FOUND,
>      ERR_MISSING_CONF,
> +    ERR_INVALID_FILTER,
>      ERR_LAST            /* ALWAYS LAST */
>  };
>  
> -- 
> 1.8.4.2
> 

> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel




More information about the sssd-devel mailing list