summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2013-08-21 12:44:47 -0400
committerJakub Hrozek <jhrozek@redhat.com>2013-08-22 19:29:08 +0200
commit8340ca480e0fe823441633720d67efc9e4a4bc64 (patch)
tree0913f1a34803b2684c8adfa207c6086f40991226 /src/providers/krb5
parent628f47f0faa5ce5dc0b3790b0dd2f987dddcab19 (diff)
downloadsssd-8340ca480e0fe823441633720d67efc9e4a4bc64.tar.gz
sssd-8340ca480e0fe823441633720d67efc9e4a4bc64.tar.xz
sssd-8340ca480e0fe823441633720d67efc9e4a4bc64.zip
KRB5: Add new #define for collection cache types
Kerberos now supports multiple types of collection caches, not just DIR: caches. We should add a macro for generic collection behavior and use that where appropriate.
Diffstat (limited to 'src/providers/krb5')
-rw-r--r--src/providers/krb5/krb5_child.c16
-rw-r--r--src/providers/krb5/krb5_common.c4
-rw-r--r--src/providers/krb5/krb5_utils.c12
-rw-r--r--src/providers/krb5/krb5_utils.h4
4 files changed, 18 insertions, 18 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 4ba0f3660..8fce600fe 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -436,7 +436,7 @@ done:
return kerr;
}
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
static bool need_switch_to_principal(krb5_context ctx, krb5_principal princ)
{
krb5_error_code kerr;
@@ -497,7 +497,7 @@ done:
return ret;
}
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
static krb5_error_code
store_creds_in_ccache(krb5_context ctx, krb5_principal princ,
@@ -528,7 +528,7 @@ store_creds_in_ccache(krb5_context ctx, krb5_principal princ,
goto done;
}
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
if (need_switch_to_principal(ctx, princ)) {
kerr = krb5_cc_switch(ctx, cc);
if (kerr != 0) {
@@ -536,7 +536,7 @@ store_creds_in_ccache(krb5_context ctx, krb5_principal princ,
goto done;
}
}
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
kerr = krb5_cc_close(ctx, cc);
if (kerr != 0) {
@@ -654,7 +654,7 @@ done:
return kerr;
}
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
static errno_t
create_ccdir(const char *dirname, uid_t uid, gid_t gid)
@@ -781,7 +781,7 @@ done:
return kerr;
}
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
static krb5_error_code
create_ccache(uid_t uid, gid_t gid, krb5_context ctx,
@@ -793,10 +793,10 @@ create_ccache(uid_t uid, gid_t gid, krb5_context ctx,
switch (cctype) {
case SSS_KRB5_TYPE_FILE:
return create_ccache_file(ctx, princ, ccname, creds);
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
case SSS_KRB5_TYPE_DIR:
return create_ccache_in_dir(uid, gid, ctx, princ, ccname, creds);
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
default:
DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown cache type\n"));
return EINVAL;
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index 0e1c10bec..e56dc6245 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -210,12 +210,12 @@ errno_t check_and_export_options(struct dp_option *opts,
}
break;
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
case SSS_KRB5_TYPE_DIR:
DEBUG(SSSDBG_CONF_SETTINGS, ("ccache is of type DIR\n"));
krb5_ctx->cc_be = &dir_cc;
break;
-#endif
+#endif /* HAVE_KRB5_CC_COLLECTION */
default:
DEBUG(SSSDBG_OP_FAILURE, ("Unknown ccname database\n"));
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 1b6d57c60..675a6b71a 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -715,11 +715,11 @@ get_cc_be_ops(enum sss_krb5_cc_type type)
be = &file_cc;
break;
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
case SSS_KRB5_TYPE_DIR:
be = &dir_cc;
break;
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
case SSS_KRB5_TYPE_UNKNOWN:
be = NULL;
@@ -792,11 +792,11 @@ cc_residual_is_used(uid_t uid, const char *ccname,
}
switch (type) {
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
case SSS_KRB5_TYPE_DIR:
ret = S_ISDIR(stat_buf.st_mode);
break;
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
case SSS_KRB5_TYPE_FILE:
ret = S_ISREG(stat_buf.st_mode);
break;
@@ -952,7 +952,7 @@ struct sss_krb5_cc_be file_cc = {
.remove = cc_file_remove,
};
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
/*======== Operations on the DIR: back end ========*/
errno_t
cc_dir_create(const char *location, pcre *illegal_re,
@@ -1190,7 +1190,7 @@ struct sss_krb5_cc_be dir_cc = {
.remove = cc_dir_remove
};
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
errno_t get_domain_or_subdomain(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx,
char *domain_name,
diff --git a/src/providers/krb5/krb5_utils.h b/src/providers/krb5/krb5_utils.h
index 2e1bec717..4a5904cd7 100644
--- a/src/providers/krb5/krb5_utils.h
+++ b/src/providers/krb5/krb5_utils.h
@@ -84,14 +84,14 @@ errno_t become_user(uid_t uid, gid_t gid);
errno_t get_ccache_file_data(const char *ccache_file, const char *client_name,
struct tgt_times *tgtt);
-#ifdef HAVE_KRB5_DIRCACHE
+#ifdef HAVE_KRB5_CC_COLLECTION
extern struct sss_krb5_cc_be dir_cc;
errno_t cc_dir_create(const char *location, pcre *illegal_re,
uid_t uid, gid_t gid, bool private_path);
-#endif /* HAVE_KRB5_DIRCACHE */
+#endif /* HAVE_KRB5_CC_COLLECTION */
errno_t get_domain_or_subdomain(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx,
char *domain_name,