mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
lib:krb5_wrap: Add smb_krb5_princ_component()
For now this function is a mere wrapper round krb5_princ_component(), but one whose interface allows for a more sensible implementation. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
d901fe9c67
commit
eec9e54592
@ -141,6 +141,30 @@ const krb5_data *krb5_princ_component(krb5_context context,
|
||||
}
|
||||
#endif
|
||||
|
||||
krb5_error_code smb_krb5_princ_component(krb5_context context,
|
||||
krb5_principal principal,
|
||||
int i,
|
||||
krb5_data *data);
|
||||
krb5_error_code smb_krb5_princ_component(krb5_context context,
|
||||
krb5_principal principal,
|
||||
int i,
|
||||
krb5_data *data)
|
||||
{
|
||||
const krb5_data *kdata = NULL;
|
||||
|
||||
if (i < 0) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
kdata = krb5_princ_component(context, principal, i);
|
||||
if (kdata == NULL) {
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
*data = *kdata;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
* WRAPPING FUNCTIONS
|
||||
|
@ -65,6 +65,11 @@ krb5_error_code krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_con
|
||||
const krb5_data *krb5_princ_component(krb5_context context, krb5_principal principal, int i );
|
||||
#endif
|
||||
|
||||
krb5_error_code smb_krb5_princ_component(krb5_context context,
|
||||
krb5_principal principal,
|
||||
int i,
|
||||
krb5_data *data);
|
||||
|
||||
/* Samba wrapper function for krb5 functionality. */
|
||||
krb5_error_code kerberos_encode_pac(TALLOC_CTX *mem_ctx,
|
||||
struct PAC_DATA *pac_data,
|
||||
|
Loading…
Reference in New Issue
Block a user