summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2012-05-02 13:22:08 -0400
committerSimo Sorce <idra@samba.org>2012-05-04 16:51:29 +0200
commit27549b4e31b47fab23af0bce6bf888e4148f88e9 (patch)
tree0cb25901f770a63c8bbe53db35ac285c5bb9d339 /source4/rpc_server
parenteb9e3e8a54aa7d6b805d280fd5586f9d1a2a094a (diff)
downloadsamba-27549b4e31b47fab23af0bce6bf888e4148f88e9.tar.gz
samba-27549b4e31b47fab23af0bce6bf888e4148f88e9.tar.bz2
samba-27549b4e31b47fab23af0bce6bf888e4148f88e9.zip
Fix direct access to krb5_principal structure
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/drsuapi/writespn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/rpc_server/drsuapi/writespn.c b/source4/rpc_server/drsuapi/writespn.c
index 63fdef21f5..ccf612be56 100644
--- a/source4/rpc_server/drsuapi/writespn.c
+++ b/source4/rpc_server/drsuapi/writespn.c
@@ -57,6 +57,7 @@ static bool writespn_check_spn(struct drsuapi_bind_state *b_state,
krb5_context krb_ctx;
krb5_error_code kerr;
krb5_principal principal;
+ krb5_data *component;
const char *dns_name, *dnsHostName;
/* The service principal name shouldn't be NULL */
@@ -112,14 +113,15 @@ static bool writespn_check_spn(struct drsuapi_bind_state *b_state,
return false;
}
- if (principal->name.name_string.len != 2) {
+ if (krb5_princ_size(krb_ctx, principal) != 2) {
krb5_free_principal(krb_ctx, principal);
krb5_free_context(krb_ctx);
talloc_free(tmp_ctx);
return false;
}
- dns_name = principal->name.name_string.val[1];
+ component = krb5_princ_component(krb_ctx, principal, 1);
+ dns_name = (const char *)component->data;
if (strcasecmp(dns_name, dnsHostName) != 0) {
krb5_free_principal(krb_ctx, principal);