mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s4-kdc/db_glue: avoid accessing private struct members when there are accessor funcs.
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
e2eef86431
commit
4b12fcebaf
@ -1653,6 +1653,7 @@ static krb5_error_code samba_kdc_lookup_server(krb5_context context,
|
||||
krb5_principal enterprise_prinicpal = NULL;
|
||||
|
||||
if (smb_krb5_principal_get_type(context, principal) == KRB5_NT_ENTERPRISE_PRINCIPAL) {
|
||||
char *str = NULL;
|
||||
/* Need to reparse the enterprise principal to find the real target */
|
||||
if (krb5_princ_size(context, principal) != 1) {
|
||||
ret = KRB5_PARSE_MALFORMED;
|
||||
@ -1661,9 +1662,13 @@ static krb5_error_code samba_kdc_lookup_server(krb5_context context,
|
||||
krb5_princ_size(context, principal));
|
||||
return ret;
|
||||
}
|
||||
ret = krb5_parse_name(context,
|
||||
krb5_principal_get_comp_string(context, principal, 0),
|
||||
str = smb_krb5_principal_get_comp_string(mem_ctx, context, principal, 0);
|
||||
if (str == NULL) {
|
||||
return KRB5_PARSE_MALFORMED;
|
||||
}
|
||||
ret = krb5_parse_name(context, str,
|
||||
&enterprise_prinicpal);
|
||||
talloc_free(str);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user