diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-05-17 18:06:34 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-14 15:52:29 -0400 |
commit | fd8595874aa06c8057740001ec465ba76b4af142 (patch) | |
tree | 34432d6fea33da9f25512da487cdbf9fc2b95f53 /src/providers/krb5/krb5_common.c | |
parent | 7b9f1e13c750fed76886513071a2b63949181ea4 (diff) | |
download | sssd-fd8595874aa06c8057740001ec465ba76b4af142.tar.gz sssd-fd8595874aa06c8057740001ec465ba76b4af142.tar.xz sssd-fd8595874aa06c8057740001ec465ba76b4af142.zip |
Add a credential cache back end structure
To be able to add support for new credential cache types easily, this
patch creates a new structure sss_krb5_cc_be that defines common
operations with a credential cache, such as create, check if used or remove.
Diffstat (limited to 'src/providers/krb5/krb5_common.c')
-rw-r--r-- | src/providers/krb5/krb5_common.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c index 022745d61..91816662b 100644 --- a/src/providers/krb5/krb5_common.c +++ b/src/providers/krb5/krb5_common.c @@ -31,6 +31,7 @@ #include "providers/dp_backend.h" #include "providers/krb5/krb5_common.h" #include "providers/krb5/krb5_opts.h" +#include "providers/krb5/krb5_utils.h" errno_t check_and_export_lifetime(struct dp_option *opts, const int opt_id, const char *env_name) @@ -95,6 +96,7 @@ errno_t check_and_export_options(struct dp_option *opts, const char *dummy; char *use_fast_str; char *fast_principal; + enum sss_krb5_cc_type cc_be; realm = dp_opt_get_cstring(opts, KRB5_REALM); if (realm == NULL) { @@ -178,11 +180,15 @@ errno_t check_and_export_options(struct dp_option *opts, DEBUG(1, ("Missing credential cache name template.\n")); return EINVAL; } - if (dummy[0] != '/' && strncmp(dummy, "FILE:", 5) != 0) { - DEBUG(1, ("Currently only file based credential caches are supported " - "and krb5ccname_template must start with '/' or 'FILE:'\n")); + + cc_be = sss_krb5_get_type(dummy); + if (cc_be != SSS_KRB5_TYPE_FILE || dummy[0] != '/') { + DEBUG(SSSDBG_CONF_SETTINGS, + ("Currently only file based credential caches are supported " + "and krb5ccname_template must start with '/' or 'FILE:'\n")); return EINVAL; } + krb5_ctx->cc_be = &file_cc; return EOK; } |