summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-06-15 13:59:44 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-06-15 14:38:22 -0400
commit6ca87e797982061576885f944e2ccfaba9573897 (patch)
tree6128b84210a53f5f0f98feb8aba1d8056dffc8d7 /src/util
parent7cc8729dec26c1fd5b06323237acc9ba2bdaaa17 (diff)
downloadsssd_unused-6ca87e797982061576885f944e2ccfaba9573897.tar.gz
sssd_unused-6ca87e797982061576885f944e2ccfaba9573897.tar.xz
sssd_unused-6ca87e797982061576885f944e2ccfaba9573897.zip
KRB5: Auto-detect DIR cache support in configure
We can't support the DIR cache features in systems with kerberos libraries older than 1.10. Make sure we don't build it on those systems.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/sss_krb5.c12
-rw-r--r--src/util/sss_krb5.h8
2 files changed, 18 insertions, 2 deletions
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index 8a6bfe2d..6cbf8c61 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -1121,10 +1121,14 @@ sss_krb5_get_type(const char *full_location)
if (strncmp(full_location, SSS_KRB5_FILE,
sizeof(SSS_KRB5_FILE)-1) == 0) {
return SSS_KRB5_TYPE_FILE;
- } else if (strncmp(full_location, SSS_KRB5_DIR,
+ }
+#ifdef HAVE_KRB5_DIRCACHE
+ else if (strncmp(full_location, SSS_KRB5_DIR,
sizeof(SSS_KRB5_DIR)-1) == 0) {
return SSS_KRB5_TYPE_DIR;
- } else if (full_location[0] == '/') {
+ }
+#endif /* HAVE_KRB5_DIRCACHE */
+ else if (full_location[0] == '/') {
return SSS_KRB5_TYPE_FILE;
}
@@ -1147,9 +1151,11 @@ sss_krb5_residual_by_type(const char *full_location,
offset = sizeof(SSS_KRB5_FILE)-1;
}
break;
+#ifdef HAVE_KRB5_DIRCACHE
case SSS_KRB5_TYPE_DIR:
offset = sizeof(SSS_KRB5_DIR)-1;
break;
+#endif /* HAVE_KRB5_DIRCACHE */
default:
return NULL;
}
@@ -1169,9 +1175,11 @@ sss_krb5_cc_file_path(const char *full_location)
switch(cc_type) {
case SSS_KRB5_TYPE_FILE:
return residual;
+#ifdef HAVE_KRB5_DIRCACHE
case SSS_KRB5_TYPE_DIR:
/* DIR::/run/user/tkt_foo */
if (residual[0] == ':') return residual+1;
+#endif
case SSS_KRB5_TYPE_UNKNOWN:
break;
}
diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h
index 34fdc495..4f2e67a7 100644
--- a/src/util/sss_krb5.h
+++ b/src/util/sss_krb5.h
@@ -41,6 +41,12 @@
#define KERBEROS_PWEXPIRE_WARNING_TIME (7 * 24 * 60 * 60)
#define KEYTAB_CLEAN_NAME keytab_name ? keytab_name : "default"
+#if 0
+#if defined HAVE_KRB5_CC_CACHE_MATCH && defined HAVE_KRB5_CC_GET_FULL_NAME
+#define HAVE_KRB5_DIRCACHE 1
+#endif
+#endif
+
const char * KRB5_CALLCONV sss_krb5_get_error_message (krb5_context,
krb5_error_code);
@@ -133,7 +139,9 @@ void sss_krb5_get_init_creds_opt_set_canonicalize(krb5_get_init_creds_opt *opts,
enum sss_krb5_cc_type {
SSS_KRB5_TYPE_FILE,
+#ifdef HAVE_KRB5_DIRCACHE
SSS_KRB5_TYPE_DIR,
+#endif /* HAVE_KRB5_DIRCACHE */
SSS_KRB5_TYPE_UNKNOWN
};