From 1c022b3556f442f57326c4a3f250128b1bd232ae Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 30 Aug 2013 17:25:01 -0400 Subject: krb5: Unify function to create ccache files Only 2 types (FILE and DIR) need to precreate files or directories on the file system, and the 2 functions were basically identical. Consolidate all in one common function and use that function directly where needed instead of using indirection. Resolves: https://fedorahosted.org/sssd/ticket/2061 --- src/providers/krb5/krb5_utils.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/providers/krb5/krb5_utils.h') diff --git a/src/providers/krb5/krb5_utils.h b/src/providers/krb5/krb5_utils.h index b364f87a..5f720335 100644 --- a/src/providers/krb5/krb5_utils.h +++ b/src/providers/krb5/krb5_utils.h @@ -42,15 +42,9 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb, const char *user, const char *upn); -/* 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); - /* A ccache back end */ struct sss_krb5_cc_be { enum sss_krb5_cc_type type; - - cc_be_create_fn create; }; extern struct sss_krb5_cc_be file_cc; @@ -58,9 +52,6 @@ extern struct sss_krb5_cc_be file_cc; errno_t create_ccache_dir(const char *dirname, pcre *illegal_re, uid_t uid, gid_t gid, bool private_path); -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); @@ -76,6 +67,8 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, struct sss_creds **saved_creds); errno_t restore_creds(struct sss_creds *saved_creds); +errno_t sss_krb5_precreate_ccache(const char *ccname, pcre *illegal_re, + uid_t uid, gid_t gid, bool private_path); errno_t sss_krb5_cc_destroy(const char *ccname, uid_t uid, gid_t gid); errno_t sss_krb5_check_ccache_princ(uid_t uid, gid_t gid, const char *ccname, const char *principal); @@ -90,9 +83,6 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name, extern struct sss_krb5_cc_be dir_cc; extern struct sss_krb5_cc_be keyring_cc; -errno_t cc_dir_create(const char *location, pcre *illegal_re, - uid_t uid, gid_t gid, bool private_path); - #endif /* HAVE_KRB5_CC_COLLECTION */ -- cgit