[SSSD] [PATCH] Add sss_ldap_err2string() to handle private error codes

Jakub Hrozek jhrozek at redhat.com
Mon Sep 5 12:53:27 UTC 2011


On Mon, Sep 05, 2011 at 12:36:03PM +0200, Jakub Hrozek wrote:
> On Mon, Sep 05, 2011 at 11:03:06AM +0200, Pavel Březina wrote:
> > https://fedorahosted.org/sssd/ticket/986
> > 
> > [PATCH 1/2] sss_ldap_err2string() created
> > [PATCH 2/2] ldap_err2string() changed to sss_ldap_err2string()
> 
> > +const char* sss_ldap_err2string(int err)
> > +{
> > +    static const char *password_expired = "Password expired";
> > +
> > +    switch (err) {
> > +    case LDAP_X_SSSD_PASSWORD_EXPIRED:
> > +        return password_expired;
> 
> Actually, do we want to treat these error strings as translatable? I
> would think so, to treat them the same as ldap_err2string()
> 

I had a closer look and libldap would only retun localized string if the
LDAP_LOCALIZE macro was on. Currently the only way to set it is to
compile with -DLDAP_LOCALIZE (there's no configure flag) and the macro
is not set in Fedora or RHEL by default. So I think we're safe with not
localizing.

By the way, is there a reason for defining the password_expired variable
instead of just returning the string constant?



More information about the sssd-devel mailing list