diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2013-08-15 19:36:26 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-27 17:05:15 +0200 |
commit | aeb1e654c337037b6bdb350e1ec8aaa065e86794 (patch) | |
tree | 080a1a2a7129006be55e61db158154f8a226432f /src/util | |
parent | fe1afaccc7c9a99df823a7c44cd89fc3c619715a (diff) | |
download | sssd-aeb1e654c337037b6bdb350e1ec8aaa065e86794.tar.gz sssd-aeb1e654c337037b6bdb350e1ec8aaa065e86794.tar.bz2 sssd-aeb1e654c337037b6bdb350e1ec8aaa065e86794.zip |
KRB5: Add support for KEYRING cache type
https://fedorahosted.org/sssd/ticket/2036
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/sss_krb5.c | 14 | ||||
-rw-r--r-- | src/util/sss_krb5.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c index 457a52c0..b25ed249 100644 --- a/src/util/sss_krb5.c +++ b/src/util/sss_krb5.c @@ -928,6 +928,7 @@ sss_krb5_free_keytab_entry_contents(krb5_context context, #define SSS_KRB5_FILE "FILE:" #define SSS_KRB5_DIR "DIR:" +#define SSS_KRB5_KEYRING "KEYRING:" enum sss_krb5_cc_type sss_krb5_get_type(const char *full_location) @@ -945,7 +946,12 @@ sss_krb5_get_type(const char *full_location) sizeof(SSS_KRB5_DIR)-1) == 0) { return SSS_KRB5_TYPE_DIR; } + else if (strncmp(full_location, SSS_KRB5_KEYRING, + sizeof(SSS_KRB5_KEYRING)-1) == 0) { + return SSS_KRB5_TYPE_KEYRING; + } #endif /* HAVE_KRB5_CC_COLLECTION */ + else if (full_location[0] == '/') { return SSS_KRB5_TYPE_FILE; } @@ -973,7 +979,12 @@ sss_krb5_residual_by_type(const char *full_location, case SSS_KRB5_TYPE_DIR: offset = sizeof(SSS_KRB5_DIR)-1; break; + + case SSS_KRB5_TYPE_KEYRING: + offset = sizeof(SSS_KRB5_KEYRING)-1; + break; #endif /* HAVE_KRB5_CC_COLLECTION */ + default: return NULL; } @@ -991,6 +1002,9 @@ sss_krb5_cc_file_path(const char *full_location) residual = sss_krb5_residual_by_type(full_location, cc_type); switch(cc_type) { +#ifdef HAVE_KRB5_CC_COLLECTION + case SSS_KRB5_TYPE_KEYRING: +#endif /* HAVE_KRB5_CC_COLLECTION */ case SSS_KRB5_TYPE_FILE: return residual; #ifdef HAVE_KRB5_CC_COLLECTION diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h index 1c10d471..b1074f81 100644 --- a/src/util/sss_krb5.h +++ b/src/util/sss_krb5.h @@ -147,7 +147,9 @@ enum sss_krb5_cc_type { SSS_KRB5_TYPE_FILE, #ifdef HAVE_KRB5_CC_COLLECTION SSS_KRB5_TYPE_DIR, + SSS_KRB5_TYPE_KEYRING, #endif /* HAVE_KRB5_CC_COLLECTION */ + SSS_KRB5_TYPE_UNKNOWN }; |