From 4d901a092a69a69be251131174166fc661d13633 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Fri, 24 Oct 2008 19:46:41 +0000 Subject: krb5_build_principal_va does not allocate krb5_principal krb5_build_principal_va does not allocate the outer krb5_principal, making it useless for generating krb5_principals which can be freed with krb5_free_principal. Added krb5_build_principal_alloc_va which allocates the krb5_principal. Added krb5int_build_principal_alloc_va which is used by KIM to avoid code duplication. KIM's kim_identity_create_from_components takes the first component as an argument because principals with no components cannot be represented with the KIM UI. Modified KIM to use this new API. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20918 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-int.h | 9 +++++++++ src/include/krb5/krb5.hin | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/k5-int.h b/src/include/k5-int.h index f05adecf39..cbc810e776 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -2518,6 +2518,15 @@ void KRB5_CALLCONV krb5_realm_iterator_free void KRB5_CALLCONV krb5_free_realm_string (krb5_context context, char *str); +/* Internal principal function used by KIM to avoid code duplication */ +krb5_error_code KRB5_CALLCONV +krb5int_build_principal_alloc_va(krb5_context context, + krb5_principal *princ, + unsigned int rlen, + const char *realm, + const char *first, + va_list ap); + /* Some data comparison and conversion functions. */ #if 0 static inline int data_cmp(krb5_data d1, krb5_data d2) diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index 82e52ab523..62fd90df4e 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -1599,9 +1599,15 @@ krb5_error_code KRB5_CALLCONV_C krb5_build_principal __attribute__ ((sentinel)) #endif ; -krb5_error_code KRB5_CALLCONV krb5_build_principal_va +#if KRB5_DEPRECATED +KRB5_ATTR_DEPRECATED krb5_error_code KRB5_CALLCONV krb5_build_principal_va (krb5_context, krb5_principal, unsigned int, const char *, va_list); +#endif + +/* Version of krb5_build_principal_va which allocates krb5_principal_data */ +krb5_error_code KRB5_CALLCONV krb5_build_principal_alloc_va + (krb5_context, krb5_principal *, unsigned int, const char *, va_list); krb5_error_code KRB5_CALLCONV krb5_425_conv_principal (krb5_context, -- cgit