(krb5_mk_req): use krb5_expand_hostname
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6670 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -55,6 +55,7 @@ krb5_mk_req(krb5_context context,
|
||||
char **realms;
|
||||
krb5_data realm_data;
|
||||
char **p;
|
||||
char *real_hostname;
|
||||
|
||||
memset(&this_cred, 0, sizeof(this_cred));
|
||||
|
||||
@@ -63,9 +64,17 @@ krb5_mk_req(krb5_context context,
|
||||
if(r)
|
||||
return r;
|
||||
|
||||
r = krb5_get_host_realm(context, hostname, &realms);
|
||||
if (r)
|
||||
r = krb5_expand_hostname (context, hostname, &real_hostname);
|
||||
if (r) {
|
||||
krb5_free_principal (context, this_cred.client);
|
||||
return r;
|
||||
}
|
||||
|
||||
r = krb5_get_host_realm(context, real_hostname, &realms);
|
||||
if (r) {
|
||||
krb5_free_principal (context, this_cred.client);
|
||||
return r;
|
||||
}
|
||||
realm_data.length = strlen(*realms);
|
||||
realm_data.data = *realms;
|
||||
|
||||
@@ -73,14 +82,17 @@ krb5_mk_req(krb5_context context,
|
||||
strlen(*realms),
|
||||
*realms,
|
||||
service,
|
||||
hostname,
|
||||
real_hostname,
|
||||
NULL);
|
||||
free (real_hostname);
|
||||
for (p = realms; *p; ++p)
|
||||
free (*p);
|
||||
free (realms);
|
||||
|
||||
if (r)
|
||||
if (r) {
|
||||
krb5_free_principal (context, this_cred.client);
|
||||
return r;
|
||||
}
|
||||
this_cred.times.endtime = 0;
|
||||
if (auth_context && *auth_context && (*auth_context)->keytype)
|
||||
this_cred.session.keytype = (*auth_context)->keytype;
|
||||
|
Reference in New Issue
Block a user