summaryrefslogtreecommitdiffstats
path: root/src/util/sss_ldap.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-02-26 16:25:07 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-03-19 14:07:41 +0100
commit233a3c6c48972b177e60d6ef4cecfacd3cf31659 (patch)
treee67d6eaed705d8c76173af0c06b49072224460be /src/util/sss_ldap.c
parent4f2e932acd5266e9d4e3f55966baafbdbd2ae210 (diff)
downloadsssd-233a3c6c48972b177e60d6ef4cecfacd3cf31659.tar.gz
sssd-233a3c6c48972b177e60d6ef4cecfacd3cf31659.tar.xz
sssd-233a3c6c48972b177e60d6ef4cecfacd3cf31659.zip
Use common error facility instead of sdap_result
Simplifies and consolidates error reporting for ldap authentication paths. Adds 3 new error codes: ERR_CHPASS_DENIED - Used when password constraints deny password changes ERR_ACCOUNT_EXPIRED - Account is expired ERR_PASSWORD_EXPIRED - Password is expired
Diffstat (limited to 'src/util/sss_ldap.c')
-rw-r--r--src/util/sss_ldap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c
index 060aacf9e..f7834d940 100644
--- a/src/util/sss_ldap.c
+++ b/src/util/sss_ldap.c
@@ -32,12 +32,9 @@
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:
+ if (IS_SSSD_ERROR(err)) {
+ return sss_strerror(err);
+ } else {
return ldap_err2string(err);
}
}