summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-11-22 16:34:18 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-03-04 23:40:39 +0100
commitc6872e79e8496fd075e20aec0343ade99cca725c (patch)
tree3440487b6a82ad8a331d6398fae4e1cff037544e /src/util
parente1e429c89e70fddcad4210375aacd1e339e6d071 (diff)
downloadsssd-c6872e79e8496fd075e20aec0343ade99cca725c.tar.gz
sssd-c6872e79e8496fd075e20aec0343ade99cca725c.tar.xz
sssd-c6872e79e8496fd075e20aec0343ade99cca725c.zip
Cleanup error message handling for krb5 child
Use the new internal SSSD errors, to simplify error handling. Instead of using up to 3 different error types (system, krb5 and pam_status), collapse all error reporting into one error type mapped on errno_t. The returned error can contain either SSSD internal errors, kerberos errors or system errors, they all use different number spaces so there is no overlap and they can be safely merged. This means that errors being sent from the child to the parent are not pam status error messages anymore. The callers have been changed to properly deal with that. Also note that this patch removes returning SSS_PAM_SYSTEM_INFO from the krb5_child for kerberos errors as all it was doing was simply to make the parent emit the same debug log already emitted by the child, and the code is simpler if we do not do that.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/util_errors.c7
-rw-r--r--src/util/util_errors.h5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/util/util_errors.c b/src/util/util_errors.c
index c196aae38..1760c8d84 100644
--- a/src/util/util_errors.c
+++ b/src/util/util_errors.c
@@ -28,10 +28,15 @@ struct err_string error_to_str[] = {
{ "Invalid Error" }, /* ERR_INVALID */
{ "Internal Error" }, /* ERR_INTERNAL */
{ "Account Unknown" }, /* ERR_ACCOUNT_UNKNOWN */
+ { "Invalid credential type" }, /* ERR_INVALID_CRED_TYPE */
+ { "No credentials available" }, /* ERR_NO_CREDS */
+ { "Credentials are expired" }, /* ERR_CREDS_EXPIRED */
{ "No cached credentials available" }, /* ERR_NO_CACHED_CREDS */
{ "Cached credentials are expired" }, /* ERR_CACHED_CREDS_EXPIRED */
{ "Authentication Denied" }, /* ERR_AUTH_DENIED */
- { "Authentication Failed" }, /* ERR_AUTH_DENIED */
+ { "Authentication Failed" }, /* ERR_AUTH_FAILED */
+ { "Password Change Failed" }, /* ERR_CHPASS_FAILED */
+ { "Network I/O Error" }, /* ERR_NETWORK_IO */
};
diff --git a/src/util/util_errors.h b/src/util/util_errors.h
index 870d9d44b..9292c9959 100644
--- a/src/util/util_errors.h
+++ b/src/util/util_errors.h
@@ -50,10 +50,15 @@ enum sssd_errors {
ERR_INVALID = ERR_BASE + 0,
ERR_INTERNAL,
ERR_ACCOUNT_UNKNOWN,
+ ERR_INVALID_CRED_TYPE,
+ ERR_NO_CREDS,
+ ERR_CREDS_EXPIRED,
ERR_NO_CACHED_CREDS,
ERR_CACHED_CREDS_EXPIRED,
ERR_AUTH_DENIED,
ERR_AUTH_FAILED,
+ ERR_CHPASS_FAILED,
+ ERR_NETWORK_IO,
ERR_LAST /* ALWAYS LAST */
};