From f2004cdbca0cb79dc15ad3b91fc375c1dd687608 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Wed, 20 Jul 2011 19:14:34 +0000 Subject: Add krb5_init_context_profile API ticket: 6929 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25026 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-int.h | 3 ++- src/include/krb5/krb5.hin | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 76993f397..a4ac496c2 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -606,7 +606,8 @@ krb5_error_code krb5_sync_disk_file(krb5_context, FILE *fp); krb5_error_code krb5int_init_context_kdc(krb5_context *); -krb5_error_code krb5_os_init_context(krb5_context, krb5_boolean); +krb5_error_code krb5_os_init_context(krb5_context context, profile_t profile, + krb5_flags flags); void krb5_os_free_context(krb5_context); diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index c6a1ba2a4..21698fe06 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -2695,6 +2695,9 @@ krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab, * begin "func-proto.h" */ +#define KRB5_INIT_CONTEXT_SECURE 0x1 /** Use secure context configuration */ +#define KRB5_INIT_CONTEXT_KDC 0x2 /** Use KDC configuration if available */ + /** * Create a krb5 library context. * @@ -2734,6 +2737,26 @@ krb5_init_context(krb5_context *context); krb5_error_code KRB5_CALLCONV krb5_init_secure_context(krb5_context *context); +/** + * Create a krb5 library context using a specified profile. + * + * @param [in] profile Profile object (NULL to create default profile) + * @param [in] flags Context initialization flags + * @param [out] context Library context + * + * Create a context structure, optionally using a specified profile and + * initialization flags. If @a profile is NULL, the default profile will be + * created from config files. If @a profile is non-null, a copy of it will be + * made for the new context; the caller should still clean up its copy. Valid + * flag values are: + * + * @li @c KRB5_INIT_CONTEXT_SECURE Ignore environment variables + * @li @c KRB5_INIT_CONTEXT_KDC Use KDC configuration if creating profile + */ +krb5_error_code KRB5_CALLCONV +krb5_init_context_profile(struct _profile_t *profile, krb5_flags flags, + krb5_context *context); + /** * Free a krb5 library context. * -- cgit