(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;
|
char **realms;
|
||||||
krb5_data realm_data;
|
krb5_data realm_data;
|
||||||
char **p;
|
char **p;
|
||||||
|
char *real_hostname;
|
||||||
|
|
||||||
memset(&this_cred, 0, sizeof(this_cred));
|
memset(&this_cred, 0, sizeof(this_cred));
|
||||||
|
|
||||||
@@ -63,9 +64,17 @@ krb5_mk_req(krb5_context context,
|
|||||||
if(r)
|
if(r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = krb5_get_host_realm(context, hostname, &realms);
|
r = krb5_expand_hostname (context, hostname, &real_hostname);
|
||||||
if (r)
|
if (r) {
|
||||||
|
krb5_free_principal (context, this_cred.client);
|
||||||
return r;
|
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.length = strlen(*realms);
|
||||||
realm_data.data = *realms;
|
realm_data.data = *realms;
|
||||||
|
|
||||||
@@ -73,14 +82,17 @@ krb5_mk_req(krb5_context context,
|
|||||||
strlen(*realms),
|
strlen(*realms),
|
||||||
*realms,
|
*realms,
|
||||||
service,
|
service,
|
||||||
hostname,
|
real_hostname,
|
||||||
NULL);
|
NULL);
|
||||||
|
free (real_hostname);
|
||||||
for (p = realms; *p; ++p)
|
for (p = realms; *p; ++p)
|
||||||
free (*p);
|
free (*p);
|
||||||
free (realms);
|
free (realms);
|
||||||
|
|
||||||
if (r)
|
if (r) {
|
||||||
|
krb5_free_principal (context, this_cred.client);
|
||||||
return r;
|
return r;
|
||||||
|
}
|
||||||
this_cred.times.endtime = 0;
|
this_cred.times.endtime = 0;
|
||||||
if (auth_context && *auth_context && (*auth_context)->keytype)
|
if (auth_context && *auth_context && (*auth_context)->keytype)
|
||||||
this_cred.session.keytype = (*auth_context)->keytype;
|
this_cred.session.keytype = (*auth_context)->keytype;
|
||||||
|
Reference in New Issue
Block a user