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_utils.h | |
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_utils.h')
-rw-r--r-- | src/providers/krb5/krb5_utils.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/providers/krb5/krb5_utils.h b/src/providers/krb5/krb5_utils.h index 7cc57d42f..87bba2bae 100644 --- a/src/providers/krb5/krb5_utils.h +++ b/src/providers/krb5/krb5_utils.h @@ -31,16 +31,41 @@ #include "providers/krb5/krb5_auth.h" #include "providers/data_provider.h" +/* Operations on a credential cache */ +typedef errno_t (*cc_be_create_fn)(const char *location, pcre *illegal_re, + uid_t uid, gid_t gid, bool private_path); +typedef errno_t (*cc_be_check_existing)(const char *location, uid_t uid, + const char *realm, const char *princ, + bool *active, bool *valid); +typedef const char * (*cc_be_ccache_for_princ)(TALLOC_CTX *mem_ctx, + const char *location, + const char *princ); +typedef errno_t (*cc_be_remove)(const char *location); + +/* A ccache back end */ +struct sss_krb5_cc_be { + enum sss_krb5_cc_type type; + + cc_be_create_fn create; + cc_be_check_existing check_existing; + cc_be_ccache_for_princ ccache_for_princ; + cc_be_remove remove; +}; + +struct sss_krb5_cc_be file_cc; + +errno_t cc_file_create(const char *filename, pcre *illegal_re, + uid_t uid, gid_t gid, bool private_path); + +struct sss_krb5_cc_be *get_cc_be_ops(enum sss_krb5_cc_type type); +struct sss_krb5_cc_be *get_cc_be_ops_ccache(const char *ccache); + char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, const char *template, bool file_mode, bool case_sensitive, bool *private_path); errno_t become_user(uid_t uid, gid_t gid); -errno_t create_ccache_dir(TALLOC_CTX *mem_ctx, const char *filename, - pcre *illegal_re, uid_t uid, gid_t gid, - bool private_path); - errno_t get_ccache_file_data(const char *ccache_file, const char *client_name, struct tgt_times *tgtt); #endif /* __KRB5_UTILS_H__ */ |