diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/sss_ldap.c | 12 | ||||
-rw-r--r-- | src/util/sss_ldap.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index de4bebf8..e799e431 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -29,6 +29,18 @@ #include "util/sss_ldap.h" #include "util/util.h" +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; + default: + return ldap_err2string(err); + } +} + int sss_ldap_get_diagnostic_msg(TALLOC_CTX *mem_ctx, LDAP *ld, char **_errmsg) { char *errmsg = NULL; diff --git a/src/util/sss_ldap.h b/src/util/sss_ldap.h index 4b4d9c1b..38785b5a 100644 --- a/src/util/sss_ldap.h +++ b/src/util/sss_ldap.h @@ -27,6 +27,8 @@ #include <talloc.h> #include <tevent.h> +#define LDAP_X_SSSD_PASSWORD_EXPIRED 0x555D + #ifdef LDAP_OPT_DIAGNOSTIC_MESSAGE #define SDAP_DIAGNOSTIC_MESSAGE LDAP_OPT_DIAGNOSTIC_MESSAGE #else @@ -37,6 +39,8 @@ #endif #endif +const char* sss_ldap_err2string(int err); + int sss_ldap_get_diagnostic_msg(TALLOC_CTX *mem_ctx, LDAP *ld, char **_errmsg); |