1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

krb5_wrap: Move krb5_princ_component() to the top

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2016-08-29 08:35:54 +02:00 committed by Andrew Bartlett
parent 1877950250
commit 884972fee3

View File

@ -113,6 +113,21 @@ void krb5_free_unparsed_name(krb5_context context, char *val)
}
#endif
#if defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING) && !defined(HAVE_KRB5_PRINC_COMPONENT)
const krb5_data *krb5_princ_component(krb5_context context,
krb5_principal principal, int i);
const krb5_data *krb5_princ_component(krb5_context context,
krb5_principal principal, int i)
{
static krb5_data kdata;
kdata.data = discard_const_p(char, krb5_principal_get_comp_string(context, principal, i));
kdata.length = strlen((const char *)kdata.data);
return &kdata;
}
#endif
/**********************************************************
* WRAPPING FUNCTIONS
@ -599,19 +614,6 @@ done:
}
#if defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING) && !defined(HAVE_KRB5_PRINC_COMPONENT)
const krb5_data *krb5_princ_component(krb5_context context, krb5_principal principal, int i );
const krb5_data *krb5_princ_component(krb5_context context, krb5_principal principal, int i )
{
static krb5_data kdata;
kdata.data = discard_const_p(char, krb5_principal_get_comp_string(context, principal, i));
kdata.length = strlen((const char *)kdata.data);
return &kdata;
}
#endif
/*
* @brief Get talloced string component of a principal
*